/**
 * IT IS DONE - Responsive Styles
 * Consistent breakpoints:
 * - Mobile: below 480px
 * - Tablet: 480px to 1023px
 * - Desktop: 1024px and above
 */

/* Default grid styles for all pages */
.grid {
    display: grid;
    gap: var(--space-md);
}

/* Tablet & Mobile: Below 1024px */
@media (max-width: 1023px) {
    /* Navigation - Hide desktop menu, show burger */
    .nav-links,
    .nav-cta {
        display: none;
    }

    .burger {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Mobile menu when active - SLIDES FROM LEFT BELOW HEADER */
    .nav-links.mobile-active {
        display: flex !important;
        flex-direction: column;
        position: fixed !important;
        top: 80px !important; /* Below header */
        left: 0 !important;
        bottom: auto !important;
        right: auto !important;
        width: 280px;
        min-height: fit-content;
        max-height: calc(100vh - 80px);
        background: var(--white) !important;
        padding: 1.5rem;
        box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 12px 0;
        gap: 1rem;
        z-index: calc(var(--z-sticky) - 1) !important; /* Just below header */
        overflow-y: auto;
    }

    .nav-links.mobile-active a {
        font-size: 1.1rem;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        display: block;
        color: var(--text-main);
        text-decoration: none;
        transition: background 0.2s;
    }

    .nav-links.mobile-active a:hover {
        background: var(--bg-body);
    }

    /* Main content */
    main {
        padding-inline: var(--space-md);
    }

    /* Hero - Stack on tablet/mobile */
    .hero {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        margin-top: var(--space-md);
    }

    .hero-right {
        order: -1;
    }

    /* Section headers - Stack */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Grid - Single column on tablet/mobile */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Mobile Only: Below 480px */
@media (max-width: 479px) {
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    /* Language Switcher - Even smaller on mobile */
    .language-switcher {
        font-size: 0.55rem;
        padding: 0.2rem 0.4rem;
    }

    /* ALL grids - 1 card per row on mobile */
    .grid,
    .services-grid,
    .why-choose-grid {
        grid-template-columns: 1fr !important;
        gap: var(--space-md);
    }

    /* Hero card grid */
    .hero-card-grid {
        grid-template-columns: 1fr;
    }

    /* Hero meta */
    .hero-meta {
        gap: 0.9rem;
    }

    /* Hero list - Single column */
    .hero-list {
        grid-template-columns: 1fr;
    }

    /* Buttons - Full width on small mobile */
    .hero-actions {
        width: 100%;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Section spacing */
    .section {
        margin-bottom: 2rem;
    }

    /* Cards - Less padding */
    .card {
        padding: 0.9rem;
    }

    /* Cookie Banner */
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner-actions {
        width: 100%;
    }

    .btn-cookie {
        flex: 1;
    }

    /* Footer - Single column and centered */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section {
        text-align: center;
    }

    .footer-brand {
        justify-content: center;
        margin: 0 auto;
    }

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

    .footer-info {
        text-align: center;
    }
}

/* Tablet: 480px to 1023px */
@media (max-width: 1023px) and (min-width: 480px) {
    /* ALL grids - 2 cards per row on tablet */
    .grid,
    .services-grid,
    .why-choose-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--space-md);
    }

    /* Hero list - 3 items per row on tablet */
    .hero-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    /* Footer - 2 columns on tablet */
    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 1024px and above */
@media (min-width: 1024px) {
    /* Default grid - 4 cards per row on desktop */
    .grid,
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }

    /* About page grid - 3 cards per row on desktop (for 6 cards) */
    .why-choose-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    /* Hero - More dramatic */
    .hero {
        gap: 3rem;
        margin-top: 2rem;
        margin-bottom: 3rem;
    }

    /* Footer - 4 columns on desktop */
    .footer-inner {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large Desktop: 1280px+ */
@media (min-width: 1280px) {
    /* Increase max-width slightly */
    .container,
    .nav-container,
    main,
    .footer-inner {
        max-width: 1200px;
    }

    /* More breathing room */
    main {
        padding-top: 2rem;
        padding-bottom: 4rem;
    }
}

/* Print Styles */
@media print {
    header {
        position: static;
    }

    .burger,
    .nav-cta,
    .language-switcher,
    .cookie-banner {
        display: none !important;
    }

    .hero,
    .section {
        break-inside: avoid;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--text-muted);
    }

    .btn-primary,
    .btn-secondary {
        border: 1px solid var(--blue-dark);
    }
}

/* Reduced Motion */
@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;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --shadow-soft: 0 0 0 2px var(--text-main);
        --shadow-button: 0 0 0 2px var(--blue-dark);
    }

    .card,
    .hero-card {
        border: 2px solid var(--text-main);
    }
}
