/* Custom Styles for Basotho Tea Company */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Hero Slideshow */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

/* Product Slideshow */
.product-slideshow {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.product-slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease;
}

.product-slideshow img.active {
    opacity: 1;
    position: relative;
}

/* Navigation Transition */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98);
}

/* Mobile Menu Animation */
#mobile-menu {
    transition: all 0.3s ease;
    transform-origin: top;
}

#mobile-menu.hidden {
    display: none;
}

/* Hover Effects */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* Line clamp for descriptions */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #fce7f3;
}

::-webkit-scrollbar-thumb {
    background: #ec4899;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #db2777;
}

/* Video Reels Progress Animation */
@keyframes progress {
    from { width: 0; }
    to { width: 100%; }
}

.playing .progress-bar {
    animation: progress 15s linear;
}

/* Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Animation for WhatsApp Button */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.fixed.bottom-6.right-6 {
    animation: float 3s ease-in-out infinite;
}

/* Button Hover Effects */
button, a {
    transition: all 0.3s ease;
}

/* Image Loading Placeholder */
img {
    background-color: #fce7f3;
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background-color: #fbcfe8;
    color: #831843;
}

/* Touch Optimization */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent zoom on input focus for iOS */
input, select, textarea {
    font-size: 16px !important;
    touch-action: manipulation;
}

/* Responsive Typography */
@media (max-width: 640px) {
    .font-serif.text-5xl {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    .font-serif.text-4xl {
        font-size: 1.875rem;
    }
    
    /* Mobile-optimized section padding */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Mobile navigation improvements */
    #mobile-menu {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Larger touch targets on mobile */
    .mobile-touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Product card mobile optimizations */
    .product-slideshow {
        touch-action: pan-y pinch-zoom;
    }
    
    /* Hero text mobile optimization */
    #home h1 {
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* WhatsApp button mobile safe area */
    .fixed.bottom-6.right-6 {
        bottom: max(1.5rem, env(safe-area-inset-bottom));
        right: max(1.5rem, env(safe-area-inset-right));
    }
    
    /* Mobile landscape optimization */
    @media (max-height: 500px) and (orientation: landscape) {
        #home {
            min-height: auto;
            padding-top: 6rem;
            padding-bottom: 4rem;
        }
        
        .slide {
            position: relative;
            height: 100vh;
        }
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Mobile category cards */
    #categories .aspect-\[4\/5\] {
        aspect-ratio: 3/4;
    }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
    .product-slideshow {
        aspect-ratio: 16/10;
    }
}

/* High DPI mobile screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode support for mobile browsers */
@media (prefers-color-scheme: dark) {
    /* Keep site light as designed, but respect system preferences where appropriate */
    ::selection {
        background-color: #be185d;
        color: white;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .slideshow-container .slide {
        transition: none;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* CSS specific to iOS devices */
    .fixed {
        position: fixed;
        transform: translateZ(0);
    }
    
    /* Prevent callout menu on images */
    img {
        -webkit-touch-callout: none;
    }
}

/* Android Chrome specific */
@supports not (-webkit-touch-callout: none) {
    /* CSS for non-iOS devices */
    ::-webkit-scrollbar {
        width: 8px;
    }
}

/* Card Hover Lift Effect */
.hover\:shadow-2xl:hover {
    transform: translateY(-4px);
}

/* Loading Skeleton Animation */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #fce7f3 4%, #f9a8d4 25%, #fce7f3 36%);
    background-size: 1000px 100%;
}

/* Backdrop Blur Support */
@supports not (backdrop-filter: blur(12px)) {
    .backdrop-blur-md {
        background-color: rgba(255, 255, 255, 0.95);
    }
    
    .bg-white\/95 {
        background-color: rgba(255, 255, 255, 0.98);
    }
}