/* ==========================================================================
   TU Theme - Responsive CSS
   Mobile-first breakpoints and responsive adjustments
   ========================================================================== */

/* ==========================================================================
   Extra Small devices (phones, less than 576px)
   ========================================================================== */

@media (max-width: 575.98px) {
    :root {
        --tu-container-padding: 1rem;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Hero */
    .tu-hero__title {
        font-size: 1.75rem;
    }

    .tu-hero__subtitle {
        font-size: 0.75rem;
    }

    .tu-hero__nav {
        width: 40px;
        height: 40px;
    }

    /* Products */
    .tu-products-grid {
        gap: var(--tu-space-sm);
    }

    .tu-product-card__title {
        font-size: 0.8125rem;
    }

    /* Promo Banner */
    .tu-promo-banner {
        min-height: 300px;
    }

    .tu-promo-banner__title {
        font-size: 1.75rem;
    }

    /* Section */
    .tu-section {
        padding: var(--tu-space-xl) 0;
    }

    /* Trending */
    .tu-trending__image {
        width: 80px;
        height: 80px;
    }

    /* Buttons */
    .tu-btn--large {
        padding: var(--tu-space-sm) var(--tu-space-lg);
        font-size: var(--tu-fs-sm);
    }
}

/* ==========================================================================
   Small devices (landscape phones, 576px and up)
   ========================================================================== */

@media (min-width: 576px) and (max-width: 767.98px) {

    /* Products grid */
    .tu-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* ==========================================================================
   Medium devices (tablets, 768px and up)
   ========================================================================== */

@media (min-width: 768px) and (max-width: 991.98px) {

    /* Navigation */
    .tu-header__nav {
        display: none;
    }

    .tu-header__menu-toggle {
        display: flex;
    }

    /* Products */
    .tu-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .tu-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Large devices (desktops, 992px and up)
   ========================================================================== */

@media (min-width: 992px) {
    :root {
        --tu-container-padding: 2rem;
    }

    /* Show desktop navigation */
    .tu-header__nav {
        display: flex;
    }

    /* Hide mobile toggle */
    .tu-header__menu-toggle {
        display: none;
    }

    /* Footer */
    .tu-footer__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==========================================================================
   Extra large devices (large desktops, 1200px and up)
   ========================================================================== */

@media (min-width: 1200px) {
    :root {
        --tu-container-max: 1440px;
    }

    /* Products */
    .tu-products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Hero */
    .tu-hero__slide {
        min-height: 700px;
    }

    .tu-hero__title {
        font-size: 3.5rem;
    }
}

/* ==========================================================================
   Extra extra large devices (larger desktops, 1400px and up)
   ========================================================================== */

@media (min-width: 1400px) {
    :root {
        --tu-container-max: 1600px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .tu-announcement-bar,
    .tu-header__menu-toggle,
    .tu-header__actions,
    .tu-mobile-menu,
    .tu-hero__nav,
    .tu-hero__dots,
    .tu-product-card__actions,
    .tu-footer__newsletter,
    .tu-social {
        display: none !important;
    }

    .tu-header {
        position: static;
        box-shadow: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        text-decoration: underline;
    }

    .tu-container {
        max-width: 100%;
        padding: 0;
    }
}

/* ==========================================================================
   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;
    }

    .tu-hero__slide.is-active {
        animation: none;
    }
}

/* ==========================================================================
   Dark Mode Support (optional)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Uncomment to enable dark mode
    :root {
        --tu-primary: #ffffff;
        --tu-secondary: #b0b0b0;
        --tu-white: #121212;
        --tu-light-gray: #1e1e1e;
        --tu-border: #333333;
    }
    
    body {
        background-color: #121212;
    }
    
    .tu-header {
        background-color: #1e1e1e;
    }
    
    .tu-product-card__image-wrap {
        background-color: #2a2a2a;
    }
    */
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --tu-border: #000000;
    }

    .tu-btn {
        border-width: 3px;
    }

    a:focus,
    button:focus {
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* ==========================================================================
   Focus Styles for Keyboard Navigation
   ========================================================================== */

*:focus-visible {
    outline: 2px solid var(--tu-primary);
    outline-offset: 2px;
}

.tu-btn:focus-visible {
    outline-color: var(--tu-accent);
    box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.3);
}

/* ==========================================================================
   Touch Device Adjustments
   ========================================================================== */

@media (hover: none) {

    /* Show actions always on touch devices */
    .tu-product-card__actions {
        opacity: 1;
        transform: translateX(0);
    }

    /* Larger touch targets */
    .tu-header__action-btn {
        width: 44px;
        height: 44px;
    }

    .tu-product-card__action {
        width: 40px;
        height: 40px;
    }
}

/* ==========================================================================
   Landscape Orientation for Mobile
   ========================================================================== */

@media (max-width: 991.98px) and (orientation: landscape) {
    .tu-hero__slide {
        min-height: 350px;
    }

    .tu-promo-banner {
        min-height: 250px;
    }
}

/* ==========================================================================
   Container Query Support (Progressive Enhancement)
   ========================================================================== */

@supports (container-type: inline-size) {
    .tu-products-grid {
        container-type: inline-size;
    }

    @container (min-width: 600px) {
        .tu-product-card__title {
            font-size: var(--tu-fs-base);
        }
    }
}
