/* Face Care BD - Fixed Stylesheet with Mobile Menu Fix */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;600;700&display=swap');

:root {
    --primary: #16a34a;
    --primary-hover: #15803d;
    --bg-light: #f0fdf4;
    --text-dark: #0f172a;
    --text-gray: #334155;
    --border: #e2e8f0;
}

/* Global */
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }

/* Top Progress Bar */
#top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #16a34a; /* Primary Green */
    z-index: 10001; /* Above sticky header */
    transition: width 0.3s ease;
    opacity: 0;
}

#top-progress-bar.loading {
    opacity: 1;
    width: 90%; /* Animate to 90% then wait for page load */
    transition: width 1s cubic-bezier(0.1, 0.05, 0.4, 0.1);
}

#top-progress-bar.finish {
    width: 100% !important;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s 0.2s;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
}

body {
    margin: 0;
    font-family: 'Hind Siliguri', system-ui, sans-serif;
    color: var(--text-dark);
    background: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =============================================
   MOBILE MENU - HIDDEN BY DEFAULT (CRITICAL!)
   Using multiple methods to ensure it stays hidden
   ============================================= */

/* Primary hide - these selectors must match header_fixed.php */
#mobile-menu-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* When opened via JS */
#mobile-menu-container.open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Topbar & Navigation */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s ease;
}

.topbar.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom-color: transparent;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 12px;
}

.logo {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .2px;
    color: var(--primary);
    text-decoration: none;
}

/* Desktop menu */
.menu {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s;
}

.menu a:hover {
    color: var(--primary);
}

.right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Language */
.lang a {
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--text-dark);
    transition: all 0.2s;
    display: inline-block;
}

.lang a:hover,
.lang a.active {
    background: var(--bg-light);
    border-color: #86efac;
}

/* Toast Notification Animation */
#toast {
    visibility: hidden;
    min-width: 280px;
    background-color: #16a34a !important; /* Force Green */
    color: #fff !important;
    text-align: center;
    border-radius: 12px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.4s, bottom 0.4s, visibility 0.4s;
}

#toast.show {
    visibility: visible !important;
    opacity: 1 !important;
    bottom: 50px !important;
}

/* Hamburger Button - HIDDEN ON DESKTOP */
.hamburger-btn {
    display: none !important;
}

/* Desktop-only class */
.desktop-only {
    display: flex !important;
}

/* ==================
   MOBILE BREAKPOINT
   ================== */
@media (max-width: 768px) {
    /* Hide desktop elements */
    .desktop-only {
        display: none !important;
    }
    
    .menu {
        display: none !important;
    }
    
    /* Show hamburger on mobile */
    .hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Hero Section */
.hero {
    padding: 60px 0;
    background: linear-gradient(180deg, var(--bg-light) 0%, #fff 100%);
}

.heroGrid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 40px;
    align-items: center;
}

.h1 {
    font-size: 48px;
    line-height: 1.1;
    margin: 0 0 16px;
    color: #14532d;
}

.p {
    margin: 0 0 24px;
    color: var(--text-gray);
    font-size: 18px;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-hover);
}

/* Badges */
.badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.badge {
    border: 1px dashed #86efac;
    background: var(--bg-light);
    border-radius: 14px;
    padding: 16px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    color: #166534;
}

/* Cards & Products */
.secTitle {
    font-size: 28px;
    margin: 60px 0 24px;
    text-align: center;
    color: #1e293b;
}

.cardRow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    background: #fff;
    text-align: center;
    font-weight: 600;
    transition: transform 0.2s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    border-color: #86efac;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    transition: all 0.2s;
    background: #fff;
}

.product:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.prod-img {
    height: 180px;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    margin-bottom: 12px;
}

.price {
    font-weight: 800;
    margin-top: 8px;
    color: var(--primary);
    font-size: 18px;
}

.add-btn {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: var(--text-dark);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.add-btn:hover {
    background: #334155;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 40px 0;
    color: #475569;
    background: #f8fafc;
}

.footer-link {
    color: #2563eb;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Products Page Layout */
.page-header {
    background: var(--bg-light);
    padding: 40px 0;
    margin-bottom: 40px;
    text-align: center;
}

.page-title {
    font-size: 32px;
    color: #14532d;
    margin: 0;
}

.layout-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
    align-items: start;
}

.sidebar {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    position: sticky;
    top: 100px;
}

.filter-group { margin-bottom: 24px; }
.filter-title { font-weight: 700; margin-bottom: 12px; display: block; }
.filter-list { list-style: none; padding: 0; margin: 0; }
.filter-list li { margin-bottom: 8px; }
.filter-list label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }

.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

/* Product Details */
.breadcrumb { margin-bottom: 20px; font-size: 14px; color: #64748b; }
.breadcrumb a { color: #64748b; text-decoration: none; }

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.main-image { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; }
.thumbnails { display: flex; gap: 12px; }
.thumb { width: 80px; height: 80px; background: #f1f5f9; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.thumb.active { border-color: var(--primary); }

.p-title { font-size: 32px; margin: 0 0 10px; line-height: 1.2; }
.p-price { font-size: 24px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.p-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: #166534; background: #dcfce7; padding: 4px 12px; border-radius: 99px; margin-bottom: 20px; }
.stock-dot { width: 8px; height: 8px; background: #16a34a; border-radius: 50%; }
.p-short-desc { color: var(--text-gray); line-height: 1.6; margin-bottom: 30px; }

.p-actions { display: flex; gap: 16px; margin-bottom: 16px; }
.qty-selector { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty-selector button { background: #f8fafc; border: none; width: 40px; font-size: 18px; cursor: pointer; }
.qty-selector input { width: 50px; text-align: center; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-weight: 600; }
.btn-add-cart { flex: 1; background: var(--text-dark); color: white; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-buy-now { width: 100%; background: var(--primary); color: white; border: none; padding: 14px; border-radius: 8px; font-weight: 700; font-size: 16px; cursor: pointer; margin-bottom: 30px; }
.btn-buy-now:hover { background: var(--primary-hover); }

.product-tabs { margin-top: 60px; border-top: 1px solid var(--border); padding-top: 40px; }
.tab-title { font-size: 20px; margin-bottom: 12px; color: #1e293b; }
.tab-content { color: var(--text-gray); margin-bottom: 30px; line-height: 1.7; }

/* --- Floating Cart Trigger --- */
#floating-cart-trigger {
    position: fixed;
    right: 20px;
    bottom: 30px;
    background: #004d40; /* Dark Green */
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    min-width: 80px;
    transition: transform 0.2s;
}

#floating-cart-trigger:hover {
    transform: scale(1.05);
}

.cart-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 4px;
}

#floating-cart-count {
    position: absolute;
    top: -10px;
    right: -12px;
    background: #dc2626; /* Red */
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 50%;
    border: 2px solid #004d40;
}

.cart-price-label {
    font-size: 13px;
    font-weight: 700;
    display: block;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 5px;
    padding-top: 3px;
}

/* --- Cart Sidebar --- */
#cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Hidden by default */
    width: 350px;
    height: 100%;
    background: white;
    z-index: 10000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

#cart-sidebar.open {
    right: 0;
}

#cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
}

#cart-sidebar-overlay.show {
    display: block;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.close-sidebar {
    background: #f1f5f9;
    border: none;
    font-size: 24px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-sidebar:hover {
    background: #e2e8f0;
}

/* Sidebar Content */
#sidebar-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.sidebar-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 20px;
    color: #0f172a;
}

.checkout-btn-sidebar {
    display: block;
    background: #8bc34a; /* Light Green */
    color: white;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: background 0.2s;
}

.checkout-btn-sidebar:hover {
    background: #7cb342;
}

/* Mobile Responsive for Cart */
@media (max-width: 480px) {
    #cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    #floating-cart-trigger {
        bottom: 20px;
        right: 15px;
    }
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .heroGrid { grid-template-columns: 1fr; text-align: center; }
    .cardRow, .products, .badges { grid-template-columns: repeat(2, 1fr); }
    .h1 { font-size: 32px; }
    .layout-grid { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}

@media (max-width: 768px) {
    .product-detail-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 480px) {
    .cardRow, .products, .badges { grid-template-columns: 1fr; }
}
