/**
 * ShopKart Main Styles
 * Extracted from inline styles for better caching and performance
 */

/* ==========================================
   HEADER.PHP STYLES - Mobile App-like Layout
   ========================================== */

/* Mobile App-like Layout - Fixed */
html {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100%;
    overflow-x: hidden;
}

/* Prevent zoom on input focus */
input,
select,
textarea {
    font-size: 16px !important;
    -webkit-user-select: text;
}

/* App-like touch interactions */
.touch-action {
    touch-action: manipulation;
}

/* Prevent text selection on UI elements */
.nav-item,
.category-item,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Full height layout */
#app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
}

/* Desktop responsive container */
@media (min-width: 768px) {
    #app-container {
        max-width: 480px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        border-left: 1px solid #e5e7eb;
        border-right: 1px solid #e5e7eb;
    }
}

@media (min-width: 1024px) {
    #app-container {
        max-width: 420px;
    }
}

/* Fixed header */
.app-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 40;
}

/* Scrollable main content */
.app-main {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fixed bottom navigation */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

/* Desktop centering for bottom nav */
@media (min-width: 768px) {
    .app-bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: 480px;
        max-width: 480px;
    }
}

@media (min-width: 1024px) {
    .app-bottom-nav {
        width: 420px;
        max-width: 420px;
    }
}

/* Category scroll styles */
.category-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Category scroll fix */
.category-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem;
    gap: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
    /* Contain horizontal scroll within element */
    overscroll-behavior-y: none;
    /* Allow vertical page scroll */
    touch-action: pan-x;
    /* Only allow horizontal panning */
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

/* Prevent horizontal scroll on main content */
.app-main>* {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Grid layout fixes */
.grid {
    width: 100%;
    box-sizing: border-box;
}

/* Ensure proper padding */
.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.active-nav {
    color: #2563eb !important;
}

/* Allow native browser pull-to-refresh on all pages */
.app-main {
    overflow-y: auto;
    overscroll-behavior-y: auto;
    /* Allow native pull-to-refresh */
    overscroll-behavior-x: none;
    /* Prevent horizontal overscroll */
    -webkit-overflow-scrolling: touch;
}

/* Ensure content fits properly */
main {
    min-height: auto;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   SINGLE-PRODUCT.PHP STYLES
   ========================================== */

/* Mobile App-like Layout - Refactored for Native Scroll */
html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    min-height: 100%;
}

/* Prevent zoom on input focus */
input,
select,
textarea {
    font-size: 16px !important;
    -webkit-user-select: text;
}

/* App-like touch interactions */
.touch-action {
    touch-action: manipulation;
}

/* Prevent text selection on UI elements */
.nav-item,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Layout Container */
#app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    background-color: #f9fafb;
}

/* Desktop responsive container */
@media (min-width: 768px) {
    #app-container {
        max-width: 480px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        border-left: 1px solid #e5e7eb;
        border-right: 1px solid #e5e7eb;
        min-height: 100vh;
    }

    body {
        background-color: #f0f2f5;
        display: flex;
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    #app-container {
        max-width: 420px;
    }
}

/* Sticky header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
}

/* Main content */
.app-main {
    flex: 1;
    padding-bottom: 90px;
    /* Safe area for fixed bottom bar */
}

/* Fixed bottom navigation */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

/* Desktop centering for bottom nav */
@media (min-width: 768px) {
    .app-bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        width: 480px;
        max-width: 480px;
    }
}

@media (min-width: 1024px) {
    .app-bottom-nav {
        width: 420px;
        max-width: 420px;
    }
}

/* Prevent horizontal scroll on main content */
.app-main>* {
    max-width: 100vw;
    overflow-x: hidden;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.active-nav {
    color: #2563eb !important;
}

/* Add space for bottom bar on single product pages */
body.single-product .app-main {
    padding-bottom: 70px;
    /* Reduced from 80px to match smaller button height */
}

/* Desktop responsive container for bottom bar */
@media (min-width: 768px) {
    #product-bottom-bar {
        left: 50%;
        transform: translateX(-50%);
        width: 480px;
        max-width: 480px;
    }
}

@media (min-width: 1024px) {
    #product-bottom-bar {
        width: 420px;
        max-width: 420px;
    }
}

/* Ensure bottom bar is above other elements and always visible */
#product-bottom-bar {
    z-index: 60;
    /* Higher than bottom nav (z-50) */
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

/* Hide bottom navigation on single product pages */
body.single-product .app-bottom-nav {
    display: none !important;
}

/* Shimmer Effect for Loading */
.shimmer-effect {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}