/* ==========================================================================
   Kids Mall - App Shell CSS (Header, Footer, PWA Splash, Navigation)
   Separated from PHP templates for maximum cacheability and clean view source
   ========================================================================== */

/* 1. Splash Screen & Animations */
@keyframes splashPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.9; }
}

#pwa-splash-screen {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.scrollbar-hidden::-webkit-scrollbar { display: none; }
.scrollbar-hidden { -ms-overflow-style: none; scrollbar-width: none; }

.animate-fade { animation: kmFadeIn 0.3s ease-in-out; }
@keyframes kmFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 2. Header Links & Badges */
.km-header-nav-link {
    color: #17345F;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.55rem;
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}
.km-header-nav-link:hover {
    color: #E5232A;
}

.badge-timing-open {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #16a34a !important;
    font-weight: 700;
}
.badge-timing-closed {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #dc2626 !important;
    font-weight: 700;
}

/* 3. Mobile Touch & App Optimizations */
@media (max-width: 991.98px) {
    body { -webkit-tap-highlight-color: transparent; }
    a, button { touch-action: manipulation; }
    .native-touch-scroll {
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    .native-touch-scroll::-webkit-scrollbar { display: none; }
}

/* 4. Sticky Mobile Bottom Navigation Bar */
.km-mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px) 4px;
    z-index: 1040;
}
.km-mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 8px;
    position: relative;
    transition: color 0.15s ease, transform 0.15s ease;
}
.km-mob-nav-item i {
    font-size: 1.25rem;
    line-height: 1.1;
    margin-bottom: 2px;
}
.km-mob-nav-item.active {
    color: var(--theme-primary, #E5232A);
}
.km-mob-nav-item:hover, .km-mob-nav-item:active {
    color: var(--theme-primary, #E5232A);
}
.km-mob-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--theme-primary, #E5232A);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 9999px;
    padding: 1px 5px;
    line-height: 1.2;
}

/* 5. Floating Action Buttons & Mini Cart */
.floating-action-btn {
    position: fixed;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    z-index: 1040;
    transition: transform 0.3s ease;
    transform: translateY(0);
}
@media (max-width: 991.98px) {
    #floatingMiniCart {
        bottom: 68px !important;
        margin: 12px !important;
    }
}

/* 6. Footer Utility Helpers */
.hover-white:hover {
    color: #ffffff !important;
    transition: color 0.2s ease;
}
.hover-success:hover {
    color: var(--theme-primary, #E5232A) !important;
}
.transition-all {
    transition: all 0.3s ease;
}
.tracking-wider {
    letter-spacing: 0.05em;
}
@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid #e5e7eb;
    }
}

/* 7. Kids Mall Luxury Right-Side Sliding Mini-Cart Drawer (Fast Checkout Sidebar) */
.km-cart-drawer-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(18, 59, 114, 0.55) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 1000000 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}
.km-cart-drawer-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
}
.km-cart-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 440px !important;
    max-width: 92vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #FFFFFF !important;
    z-index: 1000001 !important;
    box-shadow: -8px 0 32px rgba(18, 59, 114, 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    overflow: hidden !important;
}
.km-cart-drawer.active {
    transform: translateX(0) !important;
}
.km-cart-drawer-header {
    flex-shrink: 0 !important;
    padding: 16px 20px !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
.km-cart-drawer-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding: 16px 20px !important;
    background: #F8FAFD !important;
    -webkit-overflow-scrolling: touch;
}
.km-cart-drawer-footer {
    flex-shrink: 0 !important;
    padding: 16px 20px !important;
    background: #FFFFFF !important;
    border-top: 1px solid #E2E8F0 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06) !important;
}

