/* Madrid SEO - Responsive Styles v2 */

/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1280px;
    }
}

/* Medium-Large Devices (992px to 1199px) */
@media (max-width: 1199px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }

    .process-step::after {
        display: none;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Tablets (768px to 991px) */
@media (max-width: 991px) {
    html {
        font-size: 15px;
    }

    .nav {
        height: 80px;
    }

    main {
        padding-top: 80px;
    }

    .hero .container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-image {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero::before {
        width: 120%;
        right: -30%;
        opacity: 0.2;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-image {
        order: -1;
    }

    .about-image-badge {
        bottom: -10px;
        right: auto;
        left: 20px;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .nav-links > li > a,
    .nav-links > li > .dropdown-link {
        padding: 0.5rem 0.75rem;
    }
}

/* Mobile Landscape / Small Tablets (576px to 767px) */
@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links > li {
        border-bottom: 1px solid var(--border);
    }

    .nav-links > li:last-child {
        border-bottom: none;
        margin-top: 1.5rem;
    }

    .nav-links > li > a,
    .nav-links > li > .dropdown-link {
        padding: 1.25rem 1rem;
        font-size: 1.1rem;
        border-radius: 0;
    }

    /* Mobile Dropdown */
    .dropdown {
        flex-wrap: wrap;
    }

    .dropdown-link {
        flex: 1;
    }

    .dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        border-left: 1px solid var(--border);
    }

    .dropdown-toggle.active svg {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        box-shadow: none;
        background: var(--cream);
        transition: max-height 0.3s ease;
        padding: 0;
        border-radius: 0;
    }

    .dropdown-menu.active {
        max-height: 600px;
        padding: 0.5rem;
    }

    .dropdown-menu li a {
        padding-left: 2rem;
    }

    .lang-switcher {
        margin: 0;
        text-align: center;
    }

    .lang-btn {
        width: 100%;
        padding: 1.25rem;
        font-size: 1rem;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: 3rem 0;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .hero-image {
        max-width: 300px;
    }

    .hero-badge {
        margin-bottom: 1.5rem;
    }

    /* Sections */
    .services-section,
    .about-section,
    .process-section,
    .testimonials-section,
    .cta-section {
        padding: 5rem 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stats-section {
        padding: 4rem 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .stat-number {
        font-size: 3rem;
    }

    .process-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .process-number {
        width: 80px;
        height: 80px;
        font-size: 1.5rem;
    }

    /* Logo Ticker */
    .logo-ticker {
        padding: 2rem 0;
    }

    .logo-ticker-item {
        padding: 0 2rem;
    }

    /* Footer */
    .footer {
        padding: 4rem 0 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-contact li {
        justify-content: center;
    }

    /* Page Hero */
    .page-hero {
        padding: 4rem 0;
    }

    /* Cards */
    .card {
        padding: 2rem;
    }

    /* CTA */
    .cta-section::before {
        width: 100%;
        left: -30%;
    }
}

/* Small Mobile (max-width: 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 1.25rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .btn {
        padding: 1rem 1.75rem;
        font-size: 0.9rem;
    }

    .service-card {
        padding: 2rem;
    }

    .about-list li {
        font-size: 1rem;
    }

    .about-image-badge {
        padding: 1.5rem;
    }

    .about-image-badge strong {
        font-size: 2.5rem;
    }

    .stats-grid {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .testimonial-card {
        padding: 2rem;
    }

    .testimonial-quote {
        font-size: 1.05rem;
        padding-left: 1.5rem;
    }

    .testimonial-quote::before {
        font-size: 3rem;
    }

    .form-control {
        padding: 0.875rem 1rem;
    }

    .faq-question {
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }

    .faq-answer p {
        padding: 0 1.5rem 1.25rem;
    }

    .section-header p {
        font-size: 1.1rem;
    }
}

/* Extra Small Mobile (max-width: 375px) */
@media (max-width: 375px) {
    html {
        font-size: 13px;
    }

    .nav {
        height: 70px;
    }

    main {
        padding-top: 70px;
    }

    .nav-links {
        top: 70px;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .process-number {
        width: 70px;
        height: 70px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .service-card:hover {
        transform: none;
    }

    .card:hover {
        transform: none;
    }

    .testimonial-card:hover {
        transform: none;
    }

    /* Larger touch targets */
    .nav-links > li > a,
    .nav-links > li > .dropdown-link,
    .dropdown-menu li a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .dropdown-toggle {
        min-width: 48px;
        min-height: 48px;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .mobile-menu-toggle,
    .cta-section,
    .logo-ticker {
        display: none;
    }

    main {
        padding-top: 0;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .hero::before {
        display: none;
    }

    .service-card,
    .testimonial-card,
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
        color: black;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow: rgba(0, 0, 0, 0.4);
        --shadow-lg: rgba(0, 0, 0, 0.5);
        --border: #4F200D;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .service-card,
    .testimonial-card,
    .card,
    .faq-item {
        border: 2px solid var(--brown);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .hero-image {
        animation: none;
    }

    .logo-ticker-track {
        animation: none;
    }

    .scroll-indicator::after {
        animation: none;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    /* Site maintains light design by default */
}
