/**
 * 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;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Desktop full-width container */
@media (min-width: 768px) {
    #app-container {
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
    }

    .app-bottom-nav {
        display: none !important;
    }
}

/* 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;
    width: 100%;
    z-index: 50;
}

/* 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;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: #f9fafb;
}

/* Desktop full-width layout */
@media (min-width: 768px) {
    #app-container {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh;
        border: none !important;
        box-shadow: none !important;
    }

    body {
        background-color: #f9fafb;
        display: block !important;
    }
}

/* 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;
    width: 100%;
    z-index: 50;
}

/* 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 */
}

/* 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);
    width: 100%;
}

/* 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;
}

/* Wishlist Heart Button & Active Red State (works even without Tailwind CDN) */
.wishlist-btn {
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.wishlist-btn:active {
    transform: scale(0.92);
}

.wishlist-btn.wishlisted {
    background-color: #fef2f2 !important;
    border: 1px solid #fecaca !important;
}

.wishlist-btn.wishlisted .wishlist-icon,
.wishlist-icon.wishlisted {
    color: #ef4444 !important;
    font-weight: 900 !important;
}

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

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

/* Modern WooCommerce Notices (Cart, Checkout, Product pages) */
.woocommerce-notices-wrapper {
    width: 100%;
    margin-bottom: 16px;
}

.woocommerce-notices-wrapper:empty {
    display: none;
    margin-bottom: 0;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 14px 42px 14px 16px !important;
    margin: 0 0 14px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    list-style: none !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
    animation: shopkartNoticeSlideIn 0.25s ease-out;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    content: '' !important;
    position: static !important;
    display: inline-block !important;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.woocommerce-message {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border: 1px solid #6ee7b7 !important;
    border-left: 4px solid #10b981 !important;
    color: #065f46 !important;
}

.woocommerce-message::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23059669'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1.2 14.2L6.6 12l1.4-1.4 2.8 2.8 5.8-5.8L18 9l-7.2 7.2z'/%3E%3C/svg%3E") !important;
}

.woocommerce-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border: 1px solid #93c5fd !important;
    border-left: 4px solid #2563eb !important;
    color: #1e40af !important;
}

.woocommerce-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563eb'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E") !important;
}

.woocommerce-error {
    flex-direction: column;
    align-items: flex-start;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border: 1px solid #fca5a5 !important;
    border-left: 4px solid #ef4444 !important;
    color: #991b1b !important;
}

.woocommerce-error::before {
    display: none !important;
}

.woocommerce-error li {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
}

.woocommerce-error li::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

.woocommerce-message .button,
.woocommerce-message a.restore-item,
.woocommerce-info .button {
    margin-left: auto;
    background: #059669 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    transition: opacity 0.15s ease;
}

.woocommerce-info .button {
    background: #2563eb !important;
}

.woocommerce-message .button:hover,
.woocommerce-message a.restore-item:hover,
.woocommerce-info .button:hover {
    opacity: 0.9;
}

.shopkart-notice-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.shopkart-notice-close:hover {
    background: rgba(15, 23, 42, 0.16);
}

.shopkart-notice-hiding {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@keyframes shopkartNoticeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}