/* ===========================
   TRACKTRAIL LTD - Responsive Styles
   Mobile-First Media Queries
   =========================== */

/* ===========================
   TABLET & BELOW (max-width: 991px)
   =========================== */
@media screen and (max-width: 991px) {

    /* Typography */
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    /* Header */
    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: var(--space-6);
        background-color: var(--color-white);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
    }

    .nav--open {
        transform: translateX(0);
    }

    .nav__item {
        border-bottom: 1px solid var(--color-gray-light);
    }

    .nav__link {
        padding: var(--space-4);
        font-size: var(--text-lg);
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        padding-left: var(--space-6);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
    }

    .dropdown--open {
        max-height: 500px;
    }

    .dropdown__link {
        padding: var(--space-3) var(--space-4);
    }

    .menu-toggle {
        display: flex;
    }

    .header__cta {
        display: none;
    }

    /* Hero */
    .hero {
        min-height: 500px;
    }

    .hero--home {
        min-height: 550px;
    }

    .hero__title {
        font-size: var(--text-4xl);
    }

    .hero__subtitle {
        font-size: var(--text-lg);
    }

    .hero__shapes {
        display: none;
    }

    /* Grids */
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .features {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .process {
        grid-template-columns: repeat(2, 1fr);
    }

    .process__step:not(:last-child)::after {
        display: none;
    }

    .sectors {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }

    .footer__brand {
        grid-column: 1 / -1;
        max-width: none;
    }

    /* Service Overview */
    .service-overview {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .service-overview__content {
        max-width: none;
    }
}

/* ===========================
   LARGE MOBILE (max-width: 767px)
   =========================== */
@media screen and (max-width: 767px) {
    :root {
        --space-24: 4rem;
        --space-20: 3.5rem;
        --space-16: 3rem;
    }

    /* Typography */
    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

    /* Container */
    .container {
        padding: 0 var(--space-4);
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-10)) 0 var(--space-10);
    }

    .hero--home {
        min-height: auto;
    }

    .hero__badge {
        font-size: var(--text-xs);
        margin-bottom: var(--space-4);
    }

    .hero__title {
        font-size: var(--text-3xl);
        margin-bottom: var(--space-4);
    }

    .hero__subtitle {
        font-size: var(--text-base);
        margin-bottom: var(--space-6);
    }

    .hero__actions {
        flex-direction: column;
    }

    .hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Grids */
    .grid--2,
    .grid--3 {
        grid-template-columns: 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .feature {
        padding: var(--space-6);
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    .stat__number {
        font-size: var(--text-4xl);
    }

    .process {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .process__step {
        display: flex;
        text-align: left;
        gap: var(--space-4);
        padding: var(--space-4);
        background-color: var(--color-off-white);
        border-radius: var(--radius-lg);
    }

    .process__step::before {
        margin: 0;
        flex-shrink: 0;
    }

    .sectors {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cards */
    .card {
        padding: var(--space-6);
    }

    /* Footer */
    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer__legal {
        justify-content: center;
    }

    /* CTA */
    .cta {
        padding: var(--space-12) 0;
    }

    .cta__title {
        font-size: var(--text-2xl);
    }

    .cta__text {
        font-size: var(--text-base);
    }

    /* Cookie Banner */
    .cookie-banner__inner {
        flex-direction: column;
        text-align: center;
    }

    .cookie-banner__actions {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   SMALL MOBILE (max-width: 575px)
   =========================== */
@media screen and (max-width: 575px) {

    /* Typography */
    h1 {
        font-size: var(--text-2xl);
    }

    /* Header */
    .header__logo {
        font-size: var(--text-base);
    }

    .header__logo-icon {
        width: 36px;
        height: 36px;
        font-size: var(--text-base);
    }

    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }

    .btn--lg {
        padding: var(--space-4) var(--space-8);
        font-size: var(--text-base);
    }

    /* Stats */
    .stats {
        gap: var(--space-4);
    }

    .stat__number {
        font-size: var(--text-3xl);
    }

    /* Sectors */
    .sectors {
        grid-template-columns: 1fr;
    }

    .sector {
        display: flex;
        align-items: center;
        gap: var(--space-4);
        text-align: left;
        padding: var(--space-4);
    }

    .sector__icon {
        margin-bottom: 0;
        font-size: 1.5rem;
    }

    /* Form */
    .form__input,
    .form__textarea,
    .form__select {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }

    /* Section */
    .section {
        padding: var(--space-12) 0;
    }

    .section__header {
        margin-bottom: var(--space-10);
    }

    /* Service List */
    .service-list__item {
        flex-direction: column;
        gap: var(--space-2);
    }
}

/* ===========================
   ACCESSIBILITY: 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 {
        --color-gray: #525252;
        --color-gray-dark: #262626;
        --shadow-sm: 0 0 0 1px var(--color-gray-dark);
        --shadow-md: 0 0 0 2px var(--color-gray-dark);
    }

    .btn {
        border-width: 3px;
    }

    a:focus-visible,
    button:focus-visible {
        outline-width: 4px;
    }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {

    .header,
    .footer,
    .cookie-banner,
    .hero__shapes,
    .btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .hero {
        min-height: auto;
        padding: 1rem 0;
        background: none;
        color: #000;
    }

    .hero__title,
    .hero__subtitle {
        color: #000;
    }

    a {
        text-decoration: underline;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}