/**
 * Trustywell - Responsive Styling Overrides (responsive.css)
 * Mobile-first touch enhancements, viewport adjustments, and responsive containers.
 */

/* Responsive Table Wrapper */
.responsive-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive Header & Mobile Logo Constraints */
@media (max-width: 639px) {
    header .max-w-7xl > div {
        min-width: 0;
    }
    header img[alt="Trustywell"] {
        height: 36px;
        max-height: 36px;
        max-width: 140px;
        width: auto;
        object-fit: contain;
        flex-shrink: 0;
        display: block;
    }
}

@media (max-width: 360px) {
    header img[alt="Trustywell"] {
        height: 30px;
        max-height: 30px;
        max-width: 110px;
        width: auto;
        object-fit: contain;
        flex-shrink: 0;
        display: block;
    }
}

/* Theme Toggle Precision Alignment & Dual-Theme Visibility */
.theme-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle;
    line-height: 1;
}

.theme-toggle-btn svg {
    flex-shrink: 0;
    margin: auto;
}

/* Light Theme: Moon is visible, Sun is hidden */
html:not(.dark) .theme-toggle-btn .theme-icon-sun {
    display: none !important;
}
html:not(.dark) .theme-toggle-btn .theme-icon-moon {
    display: inline-block !important;
}

/* Dark Theme: Sun is visible in Gold, Moon is hidden */
html.dark .theme-toggle-btn .theme-icon-sun {
    display: inline-block !important;
}
html.dark .theme-toggle-btn .theme-icon-moon {
    display: none !important;
}

/* Hero Slider Consistent Dimensions & Responsive Layout */
#hero-slider {
    position: relative;
    width: 100%;
    border-radius: 1.5rem;
    overflow: hidden;
}

#hero-slider #slider-track {
    position: relative;
    width: 100%;
    height: 460px;
    overflow: hidden;
}

@media (min-width: 480px) {
    #hero-slider #slider-track {
        height: 440px;
    }
}

@media (min-width: 768px) {
    #hero-slider #slider-track {
        height: 410px;
    }
}

@media (min-width: 1024px) {
    #hero-slider #slider-track {
        height: 410px;
    }
}

.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Most Popular Health Guides Mobile Peek Carousel */
#health-guides-track {
    will-change: transform;
    touch-action: pan-y pinch-zoom;
}

.health-guide-card {
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease, box-shadow 0.45s ease;
}

/* Featured Formulations Single-Item Carousel */
#featured-formulations-slider {
    position: relative;
    width: 100%;
    border-radius: 1.5rem;
    overflow: hidden;
}

#featured-formulations-slider #featured-track {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
}

@media (min-width: 480px) {
    #featured-formulations-slider #featured-track {
        height: 460px;
    }
}

@media (min-width: 640px) {
    #featured-formulations-slider #featured-track {
        height: 390px;
    }
}

@media (min-width: 1024px) {
    #featured-formulations-slider #featured-track {
        height: 410px;
    }
}

.featured-product-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide,
    #health-guides-track,
    .health-guide-card,
    .featured-product-slide {
        transition: none !important;
    }
    .hero-slide img,
    .health-guide-card img,
    .featured-product-slide img {
        transition: none !important;
        transform: none !important;
    }
}

/* Touch Friendly Targets on Mobile Devices */
@media (max-width: 768px) {
    .btn, 
    nav a, 
    .admin-nav-item {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    .mobile-menu-open {
        overflow: hidden;
    }

    .prose {
        font-size: 1rem;
        line-height: 1.7;
    }

    .prose h1 {
        font-size: 1.75rem;
    }

    .prose h2 {
        font-size: 1.375rem;
    }
}

/* Premium Wellness Elevation & Soft Shadows */
.wellness-card-elevate {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.wellness-card-elevate:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(7, 56, 43, 0.09), 0 4px 12px -3px rgba(0, 0, 0, 0.04);
}

html.dark .wellness-card-elevate:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(45, 85, 68, 0.3) !important;
}

@media (prefers-reduced-motion: reduce) {
    .wellness-card-elevate {
        transition: none !important;
        transform: none !important;
    }
}
