/* Responsive Design */

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero__title {
        font-size: 4rem;
    }
    
    .section__title {
        font-size: 3rem;
    }
}

/* Medium screens (768px to 1199px) */
@media (max-width: 1199px) {
    .container {
        padding: 0 2rem;
    }
    
    .hero__container {
        gap: 3rem;
    }
    
    .hero__cards {
        width: 350px;
        height: 350px;
    }
    
    .services__grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .about__content {
        gap: 3rem;
    }
    
    .contact__content {
        gap: 3rem;
    }
    
    .footer__content {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
        gap: 2rem;
    }
}

/* Tablet screens (768px to 991px) */
@media (max-width: 991px) {
    .nav__menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem 0;
        gap: 1rem;
        box-shadow: 0 10px 30px rgba(56, 86, 102, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav__menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav__toggle {
        display: flex;
    }
    
    .nav__toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav__toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav__toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero__visual {
        order: -1;
    }
    
    .hero__cards {
        width: 300px;
        height: 300px;
    }
    
    .hero__title {
        font-size: 3rem;
    }
    
    .hero__buttons {
        justify-content: center;
    }
    
    .about__content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about__values {
        grid-template-columns: 1fr;
    }
    
    .contact__content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .footer__content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .footer__brand {
        grid-column: 1 / -1;
    }
}

/* Small tablet screens (576px to 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .hero {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__description {
        font-size: 1.125rem;
    }
    
    .hero__buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero__stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .hero__cards {
        width: 250px;
        height: 250px;
    }
    
    .floating-card {
        padding: 1rem;
    }
    
    .card-1 {
        top: 10px;
        left: -10px;
    }
    
    .card-2 {
        top: 90px;
        right: -10px;
    }
    
    .card-3 {
        bottom: 10px;
        right: -10px;
    }
    
    .section__title {
        font-size: 2rem;
    }
    
    .section__description {
        font-size: 1rem;
    }
    
    .services__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .about__stats {
        grid-template-columns: 1fr;
    }
    
    .about__values {
        gap: 1rem;
    }
    
    .value-card {
        padding: 1rem;
    }
    
    .portfolio__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .testimonials__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .form__row {
        grid-template-columns: 1fr;
    }
    
    .footer__content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer__legal {
        justify-content: center;
    }
    
    .whatsapp-button {
        bottom: 1rem;
        right: 1rem;
    }
    
    .whatsapp-tooltip {
        max-width: 200px;
        right: -50px;
    }
}

/* Mobile screens (up to 575px) */
@media (max-width: 575px) {
    .hero__title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero__description {
        font-size: 1rem;
    }
    
    .hero__cards {
        width: 200px;
        height: 200px;
    }
    
    .floating-card {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .card__icon {
        width: 32px;
        height: 32px;
    }
    
    .card__content h4 {
        font-size: 0.875rem;
    }
    
    .card__content p {
        font-size: 0.75rem;
    }
    
    .section__title {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .btn--large {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .service-card {
        padding: 1.25rem;
    }
    
    .service-card__icon {
        width: 48px;
        height: 48px;
    }
    
    .service-card__title {
        font-size: 1.125rem;
    }
    
    .cta-card {
        padding: 2rem 1.5rem;
    }
    
    .cta-card h3 {
        font-size: 1.5rem;
    }
    
    .about__stat {
        padding: 1rem;
    }
    
    .about__stat-number {
        font-size: 1.5rem;
    }
    
    .value-card__icon {
        width: 40px;
        height: 40px;
    }
    
    .mission-card {
        padding: 2rem 1.5rem;
    }
    
    .mission-card h3 {
        font-size: 1.5rem;
    }
    
    .mission-card p {
        font-size: 1rem;
    }
    
    .project-card__content {
        padding: 1.25rem;
    }
    
    .testimonial-card {
        padding: 1.25rem;
    }
    
    .testimonials__title {
        font-size: 1.75rem;
    }
    
    .contact__form {
        padding: 1.5rem;
    }
    
    .contact__detail {
        align-items: flex-start;
    }
    
    .contact__detail-icon {
        width: 40px;
        height: 40px;
    }
    
    .contact__quick {
        padding: 1.25rem;
    }
    
    .footer__content {
        gap: 2rem;
    }
    
    .footer__brand p {
        font-size: 0.875rem;
    }
    
    .footer__contact-item {
        font-size: 0.8rem;
    }
    
    .whatsapp-button__link {
        width: 48px;
        height: 48px;
    }
    
    .whatsapp-tooltip {
        max-width: 180px;
        padding: 0.75rem;
        right: -70px;
    }
    
    .whatsapp-tooltip p {
        font-size: 0.7rem;
    }
}

/* Extra small screens (up to 375px) */
@media (max-width: 375px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero__title {
        font-size: 1.75rem;
    }
    
    .hero__cards {
        width: 180px;
        height: 180px;
    }
    
    .floating-card {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .section__title {
        font-size: 1.5rem;
    }
    
    .section__description {
        font-size: 0.9rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-card__icon {
        width: 40px;
        height: 40px;
    }
    
    .cta-card {
        padding: 1.5rem 1rem;
    }
    
    .about__stat {
        padding: 0.75rem;
    }
    
    .value-card {
        padding: 0.75rem;
    }
    
    .mission-card {
        padding: 1.5rem 1rem;
    }
    
    .project-card__content {
        padding: 1rem;
    }
    
    .testimonial-card {
        padding: 1rem;
    }
    
    .contact__form {
        padding: 1.25rem;
    }
    
    .contact__quick {
        padding: 1rem;
    }
    
    .whatsapp-tooltip {
        max-width: 160px;
        right: -80px;
    }
}

/* Print styles */
@media print {
    .header,
    .whatsapp-button,
    .btn,
    .nav__toggle {
        display: none !important;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    section {
        padding: 1rem 0;
        break-inside: avoid;
    }
    
    .hero__background,
    .hero__pattern {
        display: none;
    }
    
    .floating-card {
        position: static;
        display: inline-block;
        margin: 0.5rem;
    }
    
    .service-card,
    .value-card,
    .project-card,
    .testimonial-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .footer {
        background: transparent;
        color: #000;
    }
    
    .footer__social-links {
        display: none;
    }
    
    * {
        color-adjust: exact;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-card {
        animation: none;
    }
    
    .whatsapp-button__link {
        animation: none;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn--outline {
        border-width: 3px;
    }
    
    .service-card,
    .value-card,
    .project-card,
    .testimonial-card {
        border: 2px solid #385666;
    }
    
    .floating-card {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .hero__badge,
    .section__badge {
        border: 1px solid currentColor;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #b3b3b3;
        --border-color: #404040;
    }
    
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .header {
        background: rgba(26, 26, 26, 0.95);
        border-bottom-color: var(--border-color);
    }
    
    .nav__title,
    .nav__link {
        color: var(--text-primary);
    }
    
    .nav__link:hover {
        color: #89c14e;
    }
    
    .services,
    .portfolio {
        background: var(--bg-secondary);
    }
    
    .service-card,
    .value-card,
    .project-card,
    .testimonial-card,
    .contact__form {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    
    .service-card__title,
    .value-card h3,
    .project-card__content h3,
    .testimonial-card__author strong,
    .contact__form h3,
    .contact__info h3 {
        color: var(--text-primary);
    }
    
    .service-card__description,
    .value-card p,
    .project-card__content p,
    .testimonial-card p,
    .contact__info > p {
        color: var(--text-secondary);
    }
    
    .form__group input,
    .form__group select,
    .form__group textarea {
        background: var(--bg-primary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .form__group input:focus,
    .form__group select:focus,
    .form__group textarea:focus {
        border-color: #89c14e;
    }
    
    .whatsapp-tooltip {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
    }
    
    .whatsapp-tooltip::after {
        border-top-color: var(--bg-secondary);
    }
}

/* Focus visible for better accessibility */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus-visible,
    .nav__link:focus-visible,
    .project-card__link:focus-visible {
        outline: 2px solid #89c14e;
        outline-offset: 2px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    .hero__container {
        gap: 2rem;
    }
    
    .hero__title {
        font-size: 2rem;
    }
    
    .hero__stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .hero__cards {
        width: 200px;
        height: 200px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav__link {
        padding: 0.75rem;
    }
    
    .service-card:hover,
    .value-card:hover,
    .project-card:hover,
    .testimonial-card:hover {
        transform: none;
    }
    
    .floating-card:hover {
        transform: none;
    }
    
    .whatsapp-button__link:hover {
        transform: none;
    }
    
    .tooltip:hover::before,
    .tooltip:hover::after {
        display: none;
    }
}