/* ============================================================================
FLORIST STARTER THEME - MOBILE NAVIGATION STYLES
Path: /assets/css/02-layout/mobile-nav.css
Version: 2.0.0 (Design System 2.0.0 Compliant - Mobile Sidebar Drawer)
============================================================================ */

/* --- 1. SIDEBAR HEADER & LOGO --- */
.st-sidebar-header {
    padding: 16px 20px;
    background: var(--st-surface-card, #ffffff);
    border-bottom: 1px solid var(--st-stone-200, #e7e5e4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.st-sidebar-header .st-brand-text {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--st-charcoal-900, #111827);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-sidebar-header .st-brand-text span {
    color: var(--st-brand-700, #be0038);
}

#mobile-sidebar-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-stone-100, #f5f5f4);
    border: none;
    border-radius: var(--st-radius-full, 9999px);
    color: var(--st-charcoal-700, #374151);
    cursor: pointer;
    transition: all 0.2s ease;
}

#mobile-sidebar-close:hover {
    background: var(--st-brand-50, #fff1f2);
    color: var(--st-brand-700, #be0038);
}

/* --- 2. MENU LIST (CLEAN & SNAPPY) --- */
.st-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.st-mobile-menu {
    list-style: none;
    padding: 0 16px;
    margin: 0;
}

.st-mobile-menu li {
    margin-bottom: 4px;
}

.st-mobile-menu li a {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--st-charcoal-800, #1f2937);
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--st-radius-md, 12px);
    transition: all 0.2s ease;
}

.st-mobile-menu li a:hover,
.st-mobile-menu li.current-menu-item > a {
    background-color: var(--st-brand-50, #fff1f2);
    color: var(--st-brand-700, #be0038);
}

.st-mobile-menu li.current-menu-item > a {
    font-weight: 700;
}

/* --- 3. FOOTER SIDEBAR (WhatsApp) --- */
.st-sidebar-footer {
    padding: 16px 20px;
    background: var(--st-surface-card, #ffffff);
    border-top: 1px solid var(--st-stone-200, #e7e5e4);
    margin-top: auto;
}

.st-sidebar-help-text {
    font-size: 12px;
    color: var(--st-charcoal-600, #4b5563);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.st-btn-wa-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--st-whatsapp, #25D366);
    color: #ffffff !important;
    padding: 12px 18px;
    border-radius: var(--st-radius-md, 12px);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
    transition: all 0.2s ease;
}

.st-btn-wa-sidebar:hover {
    background: var(--st-whatsapp-hover, #1fb855);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

/* ============================================================================
4. MEDIA QUERIES - BREAKPOINT (768px)
============================================================================ */

/* A. MOBILE (< 768px) - App-Like Sidebar Experience */
@media (max-width: 767px) {
    .st-mobile-sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 320px;
        height: 100dvh;
        background: var(--st-canvas, #FCFAF9);
        z-index: 99999;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }
    
    .st-mobile-sidebar.active {
        transform: translateX(0);
    }
    
    .st-body-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 99998;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s ease;
    }
    
    .st-body-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* B. TABLET & DESKTOP (>= 768px) - Hide Mobile Elements */
@media (min-width: 768px) {
    .st-mobile-sidebar,
    .st-body-overlay,
    .st-mobile-trigger,
    #mobile-menu-trigger,
    #mobile-sidebar-open-btn {
        display: none !important;
    }
}

/* ============================================================================
5. KATALOG BOTTOM SHEET (SKIN SYNCED)
============================================================================ */
.st-katalog-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-color);
    z-index: 100001;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
}

@media (min-width: 1024px) {
    .st-katalog-sheet,
    #katalogSheet {
        display: none !important;
    }
}

.st-katalog-sheet.active {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.st-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color, rgba(0,0,0,0.1));
    margin: 12px auto;
    border-radius: 2px;
}

/* Header & Title */
.st-sheet-header {
    padding: 10px 20px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    position: relative;
}

.st-sheet-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.st-sheet-title h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-color);
    text-transform: var(--btn-text-transform);
}

/* Close Button */
.st-sheet-close {
    margin-left: auto;
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.st-sheet-close:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

.st-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 40px 20px;
}

/* Menu Grid/List */
.st-katalog-grid {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.st-katalog-grid > li {
    list-style: none !important;
    margin-bottom: 8px !important;
}

.st-katalog-grid > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    border: 1px solid rgba(0,0,0,0.03);
    text-transform: var(--btn-text-transform);
    transition: 0.2s ease;
}

.st-katalog-grid > li > a:hover {
    background: var(--border-color, rgba(0,0,0,0.05));
    color: var(--primary-color);
}

/* Indikator Panah */
.st-katalog-grid .menu-item-has-children > a::after {
    content: 'expand_more';
    font-family: 'Material Symbols Outlined' !important;
    font-size: 20px;
    line-height: 1;
    width: auto !important;
    height: auto !important;
    border: none !important;
    transform: none !important;
    transition: transform 0.3s ease;
}

.st-katalog-grid .menu-item-has-children.is-open > a::after {
    transform: rotate(180deg) !important;
    color: var(--primary-color);
}

.st-katalog-grid .sub-menu .menu-item-has-children > a::after {
    border: none !important;
    transform: none !important;
}

/* Sub-Menu Level 2 */
.st-katalog-grid .sub-menu {
    list-style: none !important;
    padding: 6px 0 10px 12px !important;
    margin: 0 !important;
    display: none;
    border-left: 2px solid var(--st-stone-200, #E5E7EB);
    margin-left: 18px !important;
}

.st-katalog-grid .menu-item-has-children.is-open > .sub-menu {
    display: block;
}

.st-katalog-grid .sub-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: var(--text-muted, #4B5563);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 14.5px;
    font-weight: 500;
    border-radius: 8px;
    transition: 0.2s ease;
}

.st-katalog-grid .sub-menu > li > a:hover {
    color: var(--primary-color);
    background: rgba(0,0,0,0.02);
}

/* Sub-Menu Level 3 (Nested Accordion / Grandchildren) */
.st-katalog-grid .sub-menu .menu-item-has-children > a {
    font-weight: 600;
    color: var(--st-charcoal-800, #1F2937);
}

.st-katalog-grid .sub-menu .menu-item-has-children > a::after {
    content: 'expand_more';
    font-family: 'Material Symbols Outlined' !important;
    font-size: 18px;
    color: var(--st-charcoal-400, #9CA3AF);
    transition: transform 0.3s ease;
}

.st-katalog-grid .sub-menu .menu-item-has-children.is-open > a::after {
    transform: rotate(180deg) !important;
    color: var(--primary-color) !important;
}

.st-katalog-grid .sub-menu .sub-menu {
    padding: 4px 0 8px 12px !important;
    margin-left: 12px !important;
    border-left: 2px solid var(--st-brand-200, #FECDD3);
    background: rgba(0, 0, 0, 0.015);
    border-radius: 0 8px 8px 0;
}

.st-katalog-grid .sub-menu .sub-menu > li > a {
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--st-charcoal-600, #4B5563);
}

.st-katalog-grid .sub-menu .sub-menu > li > a:hover {
    color: var(--primary-color);
    padding-left: 16px;
}

/* State Aktif */
.st-katalog-grid li a:active {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

/* ============================================================================
6. BOTTOM NAVIGATION BAR (MD3 - APP-LIKE UI)
============================================================================ */
.md3-navigation-bar {
    display: none !important; /* Default hidden, shown via media query */
}

/* A. TABLET & MOBILE (<= 1024px) - Show Bottom Nav */
@media (max-width: 1024px) {
    .md3-navigation-bar {
        display: flex !important;
    }
    
    body {
        padding-bottom: 80px !important; /* Space for bottom nav */
    }
}

/* B. DESKTOP ONLY (> 1024px) - Hide Bottom Nav */
@media (min-width: 1025px) {
    .md3-navigation-bar {
        display: none !important;
    }
}

/* --- Bottom Nav Styling --- */
.md3-navigation-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background-color: var(--header-bg);
    display: flex;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    gap: 4px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(0,0,0,0.02);
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-icon-container {
    position: relative;
    width: 64px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}

.nav-label {
    font-family: var(--font-body);
    font-size: var(--st-text-xs, 0.75rem);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: var(--btn-text-transform);
    transition: all 0.2s ease;
}

/* --- STATE AKTIF (MENGGUNAKAN LOGIKA MD3 & BRANDING) --- */
/* Indikator Pill (Background Ikon) */
.nav-item.active .nav-icon-container {
    background-color: var(--st-brand-50, #FFF1F2);
}

/* Warna Ikon & Label */
.nav-item.active .material-symbols-outlined {
    color: var(--st-brand-700, #be0038) !important;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.nav-item.active .nav-label {
    color: var(--st-brand-700, #be0038);
    font-weight: 700;
}

/* --- OVERRIDE KHUSUS SKIN LUXE --- */
.skin-luxe .nav-item.active .nav-icon-container,
.skin-luxury .nav-item.active .nav-icon-container {
    background-color: var(--primary-soft, rgba(197, 168, 128, 0.16));
    border-radius: var(--border-radius, 8px);
}

.skin-luxe .nav-item.active .material-symbols-outlined,
.skin-luxury .nav-item.active .material-symbols-outlined {
    color: var(--accent-color) !important;
}

.skin-luxe .nav-item.active .nav-label,
.skin-luxury .nav-item.active .nav-label {
    color: var(--primary-color);
}

/* ============================================================================
7. MOBILE APP HEADER (Sticky)
Managed centrally in /assets/css/05-mobile-app/app-shell.css
============================================================================ */

/* ============================================================================
8. FILTER OVERLAY (BOTTOM SHEET) - RESPONSIVE
============================================================================ */
.st-filter-overlay.active {
    display: flex !important;
    visibility: visible;
    opacity: 1;
}

.st-filter-sheet-content {
    width: 100%;
    background: #ffffff !important;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.3);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: #333;
    pointer-events: auto;
}

.st-filter-overlay.active .st-filter-sheet-content {
    transform: translateY(0);
}

/* Desktop: Centered Modal */
@media (min-width: 1025px) {
    .st-filter-overlay {
        align-items: center !important;
    }
    
    .st-filter-sheet-content {
        width: 90% !important;
        max-width: 600px !important;
        border-radius: 16px !important;
    }
}

/* ============================================================================
9. UTILITY & HELPER CLASSES
============================================================================ */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block !important;
}

/* A. MOBILE (< 768px) */
@media (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }
}

/* B. TABLET & DESKTOP (>= 768px) */
@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
}

/* ============================================================================
10. RESPONSIVE ADJUSTMENTS FOR SMALL SCREENS
============================================================================ */
@media (max-width: 360px) {
    .st-header-fake-search .st-placeholder {
        font-size: 12px;
    }
    
    .st-header-fake-search {
        padding: 0 8px;
    }
    
    .md3-navigation-bar {
        height: 70px;
    }
    
    .nav-label {
        font-size: 10px;
    }
}

/* ============================================================================
11. PWA CAROUSEL (FORCE SNAP & NO SCROLLBAR)
============================================================================ */
@media (max-width: 1024px) {
    .st-nav-carousel-wrapper {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 15px !important;
        padding: 20px 15px !important;
        scrollbar-width: none !important;
    }
    
    .st-nav-carousel-wrapper::-webkit-scrollbar {
        display: none !important;
        height: 0 !important;
    }
    
    .st-nav-item {
        flex: 0 0 120px !important;
        width: 120px !important;
        scroll-snap-align: start !important;
        scroll-snap-stop: always !important;
    }
}

/* Force hide scrollbar in PWA mode */
@media (display-mode: standalone) {
    .st-nav-carousel-wrapper {
        scrollbar-width: none !important;
    }
    
    .st-nav-carousel-wrapper::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    html {
        scrollbar-width: none;
    }
    
    html::-webkit-scrollbar {
        display: none;
    }
}
