/* ==========================================
   RESET & VARIABLE CONFIGURATION
   ========================================== */
:root {
    --primary-color: #10b981;      /* Hijau Segar Modern */
    --primary-hover: #059669;
    --primary-light: #ecfdf5;
    --dark-color: #0f172a;         /* Slate Hitam Elegan */
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --accent-orange: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-light);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ==========================================
   TOPBAR & HEADER NAVIGATION
   ========================================== */
.topbar {
    background-color: var(--dark-color);
    color: #cbd5e1;
    font-size: 13px;
    padding: 8px 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 24px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--dark-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    color: var(--primary-color);
}

.logo span {
    color: var(--primary-color);
}

/* Search Bar Modern */
.search {
    flex: 1;
    max-width: 550px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
}

.search input {
    width: 100%;
    padding: 12px 100px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background: #f1f5f9;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.search button {
    position: absolute;
    right: 4px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.search button:hover {
    background-color: var(--primary-hover);
}

/* Cart Button */
.cart-btn, .cart {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    background: var(--primary-light);
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.2s;
    cursor: pointer;
    border: none;
}

.cart-btn:hover, .cart:hover {
    background: #d1fae5;
}

.cart-icon-wrapper {
    position: relative;
    color: var(--primary-color);
    font-size: 18px;
    display: flex;
    align-items: center;
}

#cart-count {
    background: var(--accent-orange);
    color: white;
    font-size: 11px;
    font-weight: 800;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

/* Navigation Menu */
.main-nav {
    border-top: 1px solid #f1f5f9;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

.main-nav a {
    display: block;
    padding: 12px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

.main-nav a.active, .main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px 2px 0 0;
}


/* ==========================================
   CAROUSEL CUSTOM STYLES
   ========================================== */
.carousel-section {
    position: relative;
    z-index: 1;
}

.carousel-img {
    height: 400px;
    object-fit: cover;
    object-position: center;
}

.custom-caption {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    max-width: 600px;
    margin: 0 auto 20px auto;
    color: #ffffff !important;
}

.custom-caption h5 {
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 6px;
    color: #ffffff;
}

.custom-caption p {
    font-size: 14px;
    margin-bottom: 0;
    color: #e2e8f0;
}


/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    padding: 40px 0;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
}

.badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary-hover);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero-text h1 {
    font-size: 38px;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-outline {
    background: white;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: #f1f5f9;
}

/* Promo Card Modern */
.hero-promo-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.promo-tag {
    background: var(--accent-orange);
    color: white;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 12px;
}

.promo-body h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.promo-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.promo-price-tag {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.current-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-hover);
}

.old-price {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: 14px;
}


/* ==========================================
   BENEFITS CARDS
   ========================================== */
.benefits-wrapper {
    margin-top: -20px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.benefit-card {
    background: white;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 16px;
}

.benefit-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.benefit-card strong {
    display: block;
    font-size: 14px;
}

.benefit-card span {
    color: var(--text-muted);
    font-size: 12px;
}


/* ==========================================
   SECTIONS & CATEGORIES
   ========================================== */
.section {
    padding: 30px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.section-head h2 {
    font-size: 22px;
    font-weight: 800;
}

.section-sub {
    color: var(--text-muted);
    font-size: 14px;
}

.link-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.cat {
    background: white;
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    color: var(--dark-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.cat span {
    font-size: 20px;
}

.cat:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Sort & Tools */
.tools {
    display: flex;
    gap: 10px;
    align-items: center;
}

#sort-select {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: white;
    font-size: 14px;
    outline: none;
}

.btn-reset, .link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.btn-reset:hover, .link-btn:hover {
    text-decoration: underline;
}

/* About Banner */
.about-banner {
    background: var(--dark-color);
    color: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-top: 40px;
}

.about-content h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.about-content p {
    color: #94a3b8;
    max-width: 600px;
}


/* ==========================================
   OVERLAY & DRAWER KERANJANG (SLIDE-IN)
   ========================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Panel Keranjang (Drawer) */
.drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 999;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.open, .drawer.active {
    right: 0;
}

/* Header Keranjang */
.drawer-head {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-head h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

#close-cart {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

#close-cart:hover {
    color: var(--dark-color);
}

/* Isi Keranjang */
.drawer-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.drawer-body:empty::before,
.cart-empty-text {
    content: "Keranjang masih kosong. Pilih produk dulu, ya.";
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 40px;
    line-height: 1.5;
}

/* Footer Keranjang & Button */
.drawer-foot {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: #ffffff;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin-bottom: 16px;
}

.total-row strong {
    font-size: 18px;
    color: var(--dark-color);
}

.btn-whatsapp, #checkout-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    transition: background 0.2s;
}

.btn-whatsapp:hover, #checkout-btn:hover {
    background-color: var(--primary-hover);
}


/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background: white;
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
    padding-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.footer-col p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 12px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.footer-col a:hover {
    color: var(--primary-color);
}

.contact-list li {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-list i {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #f1f5f9;
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}


/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .header-row {
        flex-wrap: wrap;
    }

    .search {
        order: 3;
        width: 100%;
        max-width: 100%;
    }

    .hero-inner {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .topbar-inner {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .carousel-img {
        height: 220px;
    }

    .custom-caption {
        padding: 10px 14px;
        margin-bottom: 10px;
    }

    .custom-caption h5 {
        font-size: 14px;
    }

    .custom-caption p {
        font-size: 11px;
    }
}

/* ==========================================
   PRODUCT GRID & CARDS (Sesuai Desain Gambar)
   ========================================== */
.product-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-list {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-thumb {
    background-color: #f1f5f9;
    border-radius: var(--radius-sm);
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.badge-discount {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.product-icon {
    font-size: 48px;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

.product-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    line-height: 1.3;
}

.product-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-hover);
}

.btn-add-cart {
    width: 100%;
    background-color: #064e3b;
    color: #ffffff;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 6px;
}

.btn-add-cart:hover {
    background-color: #047857;
}

/* ==========================================
   DRAWER CART ITEMS
   ========================================== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-icon {
    font-size: 24px;
    background: #f1f5f9;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.cart-item-price {
    font-size: 13px;
    color: var(--primary-hover);
    font-weight: 700;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-qty {
    background: #e2e8f0;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
}

.btn-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #ef4444;
    cursor: pointer;
}

/* Toast Notice */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark-color);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ==========================================
   PERBAIKAN: KARTU PRODUK & KERANJANG
   (disesuaikan dengan kelas yang dibuat script.js)
   ========================================== */
.product-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-items: stretch;
}

.product-item {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-item .thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}

.product-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-item .thumb-icon {
    font-size: 48px;
}

/* badge diskon (menimpa gaya .badge milik hero) */
.product-item .badge {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 1;
    margin: 0;
    padding: 3px 8px;
    border-radius: 12px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.product-item h3 {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--dark-color);
    margin: 0 0 6px;
}

.product-item .price {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-hover);
}

.product-item .price s {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.product-item .btn {
    margin-top: auto;
    width: 100%;
    justify-content: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: #064e3b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.product-item .btn:hover {
    background: #047857;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    margin-top: 24px;
}

/* ===== Overlay: script.js memakai kelas "show" ===== */
.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ===== Isi keranjang (kelas dari script.js) ===== */
.cart-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 40px;
    line-height: 1.5;
}

.cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.cart-row small {
    color: var(--primary-hover);
    font-weight: 700;
}

.cart-row .qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-row .qty button {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: #e2e8f0;
    font-weight: 700;
    cursor: pointer;
}

.cart-row .qty button:hover {
    background: #cbd5e1;
}