/* Mobile-First Responsive Enhancements */

/* Touch Optimization */
button, a, .clickable {
    min-height: 44px;
    min-width: 44px;
}

/* iOS Safari Viewport Height Fix */
.hero-title-wrapper {
    height: 55vh;
    height: 55dvh; /* keep CTA visible below title */
    max-height: 55vh;
}

/* Ensure hero content (CTA) stays within the first screen on mobile */
@media (max-width: 640px) {
    header.h-screen {
        height: auto;
        min-height: 100svh;
        padding-bottom: 2.5rem;
    }
}

/* iPhone Notch & Safe Area Support */
nav {
    padding-top: env(safe-area-inset-top);
}

body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Prevent Zoom on Input Focus */
input, textarea, select {
    font-size: 16px;
}

/* Mobile Scroll Performance */
.mobile-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .text-responsive {
        font-size: clamp(1rem, 4vw, 1.25rem);
    }
    
    .heading-responsive {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
}

/* Product page hero thumbs: allow wrap and tighter sizing on mobile */
@media (max-width: 640px) {
    .hero-thumb {
        width: 64px;
        height: 64px;
    }

    .hero-thumb img {
        object-fit: contain;
    }

    .hero-nav-prev,
    .hero-nav-next {
        width: 44px;
        height: 44px;
    }
}

/* Product page: hide thumbs on mobile (dots only) */
@media (max-width: 640px) {
    .hero-thumb-strip {
        display: none !important;
    }
}

/* Disable hover zoom on touch devices */
@media (hover: none) {
    #heroGlassImage,
    #heroGlassImage:hover,
    .hero-thumb img,
    .hero-thumb img:hover {
        transform: none !important;
    }
}

/* Stacked-card thumbs layout on mobile */
@media (max-width: 640px) {
    .hero-controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .hero-thumb-strip {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 78px;
        gap: 10px;
        max-width: 88vw;
        overflow-x: auto;
        padding: 6px 10px 8px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .hero-thumb {
        width: 78px;
        height: 78px;
        scroll-snap-align: center;
        opacity: 0.8;
        transform: scale(0.94);
    }

    .hero-thumb.ring-brand-accent {
        transform: scale(1.05);
        opacity: 1;
        z-index: 2;
    }

    .hero-nav-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .hero-nav-prev,
    .hero-nav-next {
        width: 46px;
        height: 46px;
    }
}

/* Mobile Gallery Swipe Hints */
@media (max-width: 768px) {
    .swipe-hint {
        display: block;
        animation: swipeHint 2s ease-in-out infinite;
    }
}

@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* Mobile Video Optimization */
@media (max-width: 768px) {
    video {
        object-fit: cover;
    }
    
    .video-container {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
        height: 0;
        overflow: hidden;
    }
    
    .video-container video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    .mobile-menu {
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
    
    .mobile-menu a {
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
}

/* Mobile Image Optimization */
@media (max-width: 640px) {
    img {
        max-width: 100%;
        height: auto;
    }
    
    .hero-image {
        transform: scale(0.8);
    }
}

/* Reduce Motion on Mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Performance */
@media (max-width: 768px) {
    .parallax-fg,
    .parallax-bg {
        transform: none !important;
        will-change: auto;
    }
    
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
