/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    /* LIGHT MODE (NOW LIGHT GREEN) */
    --bg-body: #E8F5E9;       /* <--- CHANGED TO LIGHT GREEN */
    --bg-glass: rgba(255, 255, 255, 0.25);
    --bg-card: #FFFFFF;
    --text-main: #1B241D;
    --text-muted: #6B7C70;
    
    --primary: #1B5E20;
    --primary-light: #2E7D32;
    --accent: #C8A951;
    
    --border: rgba(27, 94, 32, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 5px 15px rgba(0,0,0,0.08);
    
    --nav-height: 80px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* DARK MODE */
    --bg-body: #0a1f12;
    --bg-glass: rgba(0, 0, 0, 0.4);
    --bg-card: #132e1e;
    --text-main: #E8F5E9;
    --text-muted: #A5D6A7;
    
    --primary: #4CAF50;
    --primary-light: #66BB6A;
    --accent: #FFD54F;
    
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    font-family: 'Inter', sans-serif; 
    transition: var(--transition);
    padding-top: var(--nav-height); 
    overflow-x: hidden;
    /* Optional: Subtle Texture */
    background-image: radial-gradient(circle at 10% 20%, rgba(27, 94, 32, 0.05) 0%, transparent 20%);
}

h1, h2, h3, h4, h5 { font-family: 'Poppins', sans-serif; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
button { cursor: pointer; border: none; font-family: inherit; }
img { max-width: 100%; display: block; }

/* =========================================
   2. NAVBAR & SEARCH
   ========================================= */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(255, 255, 255, 0.05);
    z-index: 1000; display: flex; align-items: center; justify-content: space-between;
    padding: 0 5%; border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    height: 70px;
}

.brand-name { font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.brand-name span { color: var(--accent); }

.nav-center { display: flex; gap: 30px; }
.nav-link { font-weight: 500; font-size: 0.95rem; position: relative; color: var(--text-main); opacity: 0.8; }
.nav-link:hover, .nav-link.active { opacity: 1; color: var(--primary); }
.nav-link::after {
    content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px;
    background: var(--accent); transition: var(--transition);
}
.nav-link.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 15px; }

/* --- EXPANDING SEARCH --- */
.search-container { position: relative; display: flex; align-items: center; justify-content: flex-end; }
.search-input-box {
    width: 0; opacity: 0; visibility: hidden;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 30px; padding: 8px 15px; transition: var(--transition);
    position: absolute; right: 0; box-shadow: var(--shadow); z-index: 1002;
}
.search-input-box.active { width: 260px; opacity: 1; visibility: visible; right: 45px; }
.search-input-box input { width: 100%; border: none; background: transparent; color: var(--text-main); font-size: 0.9rem; outline: none; }

.search-results {
    position: absolute; top: 50px; right: 0; width: 300px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); display: none; flex-direction: column;
    max-height: 400px; overflow-y: auto; z-index: 1001;
}
.search-results.show { display: flex; }
.search-item { padding: 10px 15px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); transition: 0.2s; cursor: pointer; }
.search-item:hover { background: var(--border); }
.search-item img { width: 30px; height: 30px; border-radius: 5px; object-fit: cover; }
.search-cat-header { font-size: 0.75rem; color: var(--accent); font-weight: 700; padding: 5px 15px; background: rgba(0,0,0,0.02); }

/* Buttons */
.icon-btn { 
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: transparent; color: var(--text-main); transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--border); color: var(--primary); }
.cart-badge {
    position: absolute; top: -2px; right: -2px;
    background: var(--accent); color: #000; font-weight: bold;
    font-size: 0.7rem; width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* =========================================
   3. HERO & SECTIONS
   ========================================= */
.hero-wrapper {
    display: grid; grid-template-columns: 2.5fr 1fr; gap: 20px;
    width: 95%; max-width: 1400px; margin: 20px auto; height: 600px;
}

.main-slider {
    position: relative; width: 100%; height: 100%;
    border-radius: 24px; overflow: hidden;
    box-shadow: var(--shadow); background-color: var(--bg-card);
}
.slide { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s ease; z-index: 1; }
.slide.active { opacity: 1; z-index: 2; }
.slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.6) 30%, transparent); }

.side-banner {
    position: relative; width: 100%; height: 100%;
    border-radius: 24px; /* ROUNDED CORNERS FOR SUB BANNER */
    overflow: hidden;
    box-shadow: var(--shadow); background-color: var(--primary);
    display: flex; align-items: flex-end;
}

/* --- GLASS CARD (ROUNDED CORNERS) --- */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 24px; /* <--- UPDATED: ROUNDER CORNERS */
}

.hero-content {
    position: relative; z-index: 10; top: 50%; transform: translateY(-50%);
    margin-left: 60px; padding: 40px; max-width: 500px;
}
.hero-title { font-size: 3rem; color: #fff; line-height: 1.1; margin-bottom: 10px; }
.hero-sub { font-size: 1.1rem; color: #ddd; margin-bottom: 25px; }

.btn-premium {
    padding: 12px 30px; border-radius: 30px;
    background: var(--accent); color: #000; font-weight: 600;
    display: inline-block; transition: var(--transition);
}
.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(200, 169, 81, 0.4); }

.slider-dots { position: absolute; bottom: 20px; left: 60px; z-index: 10; display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; background: rgba(255,255,255,0.5); border-radius: 50%; cursor: pointer; transition: 0.3s; }
.dot.active { background: var(--accent); transform: scale(1.2); }

/* FEATURES STRIP */
.features-strip {
    width: 90%; max-width: 1200px; margin: -40px auto 60px;
    position: relative; z-index: 20;
    display: flex; justify-content: space-around;
    background: var(--bg-card);
}
[data-theme="light"] .features-strip { background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); }
[data-theme="dark"] .features-strip { background: rgba(20, 50, 30, 0.8); backdrop-filter: blur(10px); border: 1px solid var(--border); }
.feature-item { display: flex; align-items: center; gap: 15px; }
.feature-icon { font-size: 1.5rem; color: var(--accent); width: 50px; height: 50px; border-radius: 50%; background: var(--bg-body); display: flex; align-items: center; justify-content: center; }

/* =========================================
   4. SECTIONS & CARDS
   ========================================= */
.section-wrapper { width: 95%; max-width: 1400px; margin: 60px auto; }
.section-header { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end; }
.section-title { font-size: 1.8rem; color: var(--primary); position: relative; padding-left: 15px; }
.section-title::before { content: ''; position: absolute; left: 0; top: 10%; height: 80%; width: 4px; background: var(--accent); border-radius: 2px; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }

.product-card {
    background: var(--bg-card); border-radius: 20px;
    overflow: hidden; border: 1px solid var(--border);
    transition: var(--transition); cursor: pointer;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }

.prod-img-box { height: 250px; width: 100%; position: relative; overflow: hidden; }
.prod-img-box img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.product-card:hover img { transform: scale(1.05); }

.badge-discount {
    position: absolute; top: 10px; left: 10px;
    background: #ff4757; color: white;
    padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; z-index: 5;
}

.prod-details { padding: 15px; }
.prod-title { font-weight: 600; font-size: 1rem; margin-bottom: 5px; color: var(--text-main); }
.price-row { display: flex; gap: 10px; align-items: baseline; margin-top: 5px; }
.price-current { color: var(--primary); font-weight: 700; font-size: 1.1rem; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.9rem; }

/* --- PRODUCT BUTTONS --- */
.prod-actions { display: flex; gap: 10px; margin-top: 15px; z-index: 20; position: relative; }
.btn-card { flex: 1; padding: 8px 0; border-radius: 50px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }

.btn-card-cart { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-card-cart:hover { background: var(--primary); color: white; }

.btn-card-buy { background: var(--primary); border: 1px solid var(--primary); color: white; }
.btn-card-buy:hover { background: var(--primary-light); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

/* =========================================
   5. FOOTER
   ========================================= */
.main-footer {
    background: linear-gradient(135deg, #05140A 0%, #0F2E1C 100%);
    color: white; padding: 80px 5% 30px; margin-top: 80px;
    border-top: 4px solid var(--accent);
}
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; margin-bottom: 50px; }
.footer-brand h4 { font-size: 2rem; margin-bottom: 20px; color: white; }
.footer-brand span { color: var(--accent); }
.footer-desc { color: rgba(255,255,255,0.7); line-height: 1.6; font-size: 0.95rem; max-width: 300px; }
.footer-col h5 { color: var(--accent); margin-bottom: 25px; font-size: 1.1rem; letter-spacing: 1px; }

.footer-links a { display: block; color: rgba(255,255,255,0.6); margin-bottom: 12px; transition: 0.3s; font-size: 0.95rem; }
.footer-links a:hover { color: white; transform: translateX(5px); }

.social-links { display: flex; gap: 15px; margin-top: 25px; }
.social-btn {
    width: 45px; height: 45px; background: rgba(255,255,255,0.05);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.1); color: white; transition: 0.3s;
}
.social-btn:hover { background: var(--accent); color: black; transform: translateY(-3px); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px;
    display: flex; justify-content: space-between;
    font-size: 0.85rem; color: rgba(255,255,255,0.4);
}

.floating-cart {
    position: fixed; bottom: 30px; right: 30px;
    width: 60px; height: 60px; background: var(--accent);
    color: #000; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3); z-index: 999;
}

/* =========================================
   6. RESPONSIVE
   ========================================= */
/* --- MOBILE BOTTOM NAV STYLES --- */
.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--bg-card); border-top: 1px solid var(--border);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2); z-index: 2000;
    justify-content: space-around; padding: 12px 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-muted); font-size: 0.7rem; font-weight: 600; flex: 1; position: relative;
}
.bottom-nav-item i { font-size: 1.2rem; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary); }

@media (max-width: 900px) {
    /* Navbar & App Spacing */
    body { padding-bottom: 70px; }
    .nav-center { display: none; }
    .mobile-bottom-nav { display: flex; }
    .floating-cart { display: none !important; } /* Hide floating cart on mobile */
    #topbar .nav-right a[href="cart.html"] { display: none; } /* Hide top cart on mobile */
    
    /* Fix Top Bar Overlap */
    .brand-name { font-size: 1.1rem !important; gap: 5px !important; }
    .brand-name img { height: 28px !important; }
    .nav-right { gap: 5px; }
    .icon-btn { width: 35px; height: 35px; }
    
    /* Slimmer Banners */
    .hero-wrapper { grid-template-columns: 1fr; height: auto; margin-top: 20px; }
    .main-slider { height: 220px; border-radius: 16px; }
    .side-banner { height: 160px; display: flex; margin-top: 15px; border-radius: 16px; }
    .hero-content { margin-left: 10px; padding: 15px; max-width: 85%; top: 55%; }
    .hero-title { font-size: 1.6rem; margin-bottom: 5px; }
    .hero-sub { font-size: 0.85rem; margin-bottom: 12px; }
    .btn-premium { padding: 8px 18px; font-size: 0.85rem; }
    .slider-dots { left: 50%; transform: translateX(-50%); bottom: 10px; }
    .side-banner .side-content { margin: 10px !important; padding: 15px !important; }
    
    /* 2 Products Per Row */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card { border-radius: 16px; }
    .prod-img-box { height: 140px; }
    .prod-details { padding: 10px; }
    .prod-title { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .price-current { font-size: 1rem; }
    .price-old { font-size: 0.8rem; }
    .btn-card { padding: 6px 0; font-size: 0.75rem; }
    .prod-actions { flex-direction: column; gap: 6px; }
    
    /* Misc */
    .features-strip { flex-direction: column; gap: 15px; margin-top: 20px; padding: 20px; width: 95%; }
    .search-input-box.active { width: 180px; right: 40px; }
}

/* Progressive Image Loading */
.blur-load {
    filter: blur(15px);
    transition: filter 0.6s ease-out;
}
.blur-load.loaded {
    filter: blur(0);
}

.hero-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px; /* Use 20px for a "pill" shape or 8px for soft corners */
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 10px;
}