/* ==========================================================================
   assets/css/style.css
   Gaya adaptif: nuansa mobile app (Android-like) <768px, web app >=768px
   ========================================================================== */

:root {
    --forest:       #1B4332;
    --forest-dark:  #081C15;
    --forest-mid:   #2D6A4F;
    --gold:         #D4A373;
    --gold-dark:    #B98A57;
    --soft:         #F8F9FA;
    --ink:          #212529;
    --muted:        #6c757d;
    --line:         #e9ecef;
    --radius:       14px;
    --shadow-sm:    0 2px 10px rgba(0, 0, 0, .06);
    --shadow-md:    0 8px 26px rgba(0, 0, 0, .10);
}

* { -webkit-tap-highlight-color: transparent; }

body {
    background: var(--soft);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    padding-bottom: 76px; /* ruang untuk bottom nav mobile */
}

a { text-decoration: none; }

/* --------------------------------------------------------------------------
   TOMBOL TEMA
   -------------------------------------------------------------------------- */
.btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #3a2a17;
    font-weight: 600;
}
.btn-gold:hover, .btn-gold:focus { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }

.btn-primary-forest { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn-primary-forest:hover { background: var(--forest-mid); border-color: var(--forest-mid); color: #fff; }

.btn-wa { background: #25D366; border-color: #25D366; color: #fff; font-weight: 600; }
.btn-wa:hover { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }

.btn-cart-add {
    background: var(--forest);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-weight: 600;
    padding: .5rem;
}
.btn-cart-add:hover { background: var(--forest-mid); color: #fff; }
.btn-cart-add:disabled { background: #adb5bd; }

/* --------------------------------------------------------------------------
   DESKTOP NAVBAR
   -------------------------------------------------------------------------- */
.navbar-desktop {
    background: var(--forest);
    box-shadow: var(--shadow-sm);
}
.navbar-desktop .nav-link { color: rgba(255, 255, 255, .82); font-weight: 500; }
.navbar-desktop .nav-link:hover,
.navbar-desktop .nav-link.active { color: #fff; }
.navbar-desktop .navbar-brand { font-size: 1.15rem; }
.btn-cart { position: relative; }
.btn-cart .cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: .68rem;
}

/* --------------------------------------------------------------------------
   MOBILE TOP APP BAR
   -------------------------------------------------------------------------- */
.mobile-appbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: var(--forest);
    color: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 .5rem;
    box-shadow: var(--shadow-sm);
}
.appbar-btn {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.35rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.appbar-title {
    flex: 1;
    text-align: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: .62rem;
}

/* Bottom sheet (offcanvas bawah) */
.sheet-bottom { border-radius: 20px 20px 0 0; }
.chip {
    display: inline-block;
    padding: .35rem .8rem;
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 50px;
    color: var(--forest);
    font-size: .82rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   BOTTOM NAVIGATION (mobile)
   -------------------------------------------------------------------------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 64px;
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 1050;
    box-shadow: 0 -3px 14px rgba(0, 0, 0, .07);
    padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: .68rem;
    position: relative;
    padding-top: 4px;
}
.bottom-nav a i { font-size: 1.35rem; }
.bottom-nav a.active { color: var(--forest); font-weight: 700; }
.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    margin-right: -22px;
    background: var(--gold);
    color: #3a2a17;
    font-size: .6rem;
    border-radius: 50px;
    padding: 1px 5px;
    min-width: 17px;
    text-align: center;
}

/* Tombol WhatsApp mengambang */
.fab-wa {
    position: fixed;
    right: 14px;
    bottom: 78px;
    z-index: 1045;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   HERO
   -------------------------------------------------------------------------- */
.hero-slide {
    min-height: 220px;
    background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(8, 28, 21, .82) 0%, rgba(8, 28, 21, .35) 100%);
}
.hero-content { position: relative; z-index: 2; color: #fff; padding: 2.5rem 0; }
.hero-title { font-weight: 800; font-size: 1.5rem; line-height: 1.25; text-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.hero-subtitle { color: rgba(255, 255, 255, .88); margin-bottom: 1.1rem; font-size: .95rem; }

/* --------------------------------------------------------------------------
   JUDUL SECTION
   -------------------------------------------------------------------------- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.6rem 0 1rem;
}
.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    padding-left: .7rem;
    border-left: 4px solid var(--gold);
    color: var(--forest-dark);
}
.section-link { color: var(--forest-mid); font-weight: 600; font-size: .85rem; }

/* --------------------------------------------------------------------------
   KARTU KATEGORI
   -------------------------------------------------------------------------- */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem .5rem;
    color: var(--forest-dark);
    text-align: center;
    font-size: .78rem;
    font-weight: 600;
    height: 100%;
    transition: transform .15s, box-shadow .15s;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); color: var(--forest); }
.category-card i { font-size: 1.6rem; color: var(--forest-mid); }

/* --------------------------------------------------------------------------
   KARTU PRODUK
   -------------------------------------------------------------------------- */
.product-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-thumb { display: block; position: relative; aspect-ratio: 1 / 1; background: #eef1f0; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-discount {
    position: absolute; top: 8px; left: 8px;
    background: #e63946; color: #fff;
    font-size: .68rem; padding: 2px 8px; border-radius: 50px; font-weight: 700;
}
.badge-habis {
    position: absolute; top: 8px; right: 8px;
    background: rgba(0, 0, 0, .65); color: #fff;
    font-size: .68rem; padding: 2px 8px; border-radius: 50px;
}
.product-card .card-body { padding: .7rem .75rem .35rem; }
.product-cat {
    font-size: .68rem; color: var(--gold-dark);
    text-transform: uppercase; letter-spacing: .4px; font-weight: 700;
}
.product-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; color: var(--ink); font-weight: 600; font-size: .88rem;
    line-height: 1.3; min-height: 2.3em; margin: .2rem 0 .35rem;
}
.product-name:hover { color: var(--forest-mid); }
.product-price { font-size: .82rem; }
.price-now { color: var(--forest); font-weight: 800; font-size: .98rem; }

/* --------------------------------------------------------------------------
   KARTU ARTIKEL
   -------------------------------------------------------------------------- */
.article-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.article-thumb { display: block; aspect-ratio: 16 / 9; background: #eef1f0; overflow: hidden; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge-cat {
    display: inline-block; background: rgba(27, 67, 50, .1); color: var(--forest);
    font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 50px; margin-bottom: .5rem;
}
.article-title { font-size: 1rem; font-weight: 700; line-height: 1.35; margin-bottom: .4rem; }
.article-title a { color: var(--ink); }
.article-title a:hover { color: var(--forest-mid); }
.article-excerpt { font-size: .84rem; color: var(--muted); margin-bottom: .6rem; }
.article-meta { font-size: .75rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   CTA BAND
   -------------------------------------------------------------------------- */
.cta-band {
    background: linear-gradient(135deg, var(--forest) 0%, var(--forest-mid) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

/* --------------------------------------------------------------------------
   FOOTER DESKTOP
   -------------------------------------------------------------------------- */
.site-footer { background: var(--forest-dark); color: rgba(255, 255, 255, .8); }
.footer-title { font-weight: 700; color: #fff; }
.footer-heading { color: #fff; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: .9rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255, 255, 255, .72); font-size: .88rem; }
.footer-links a:hover { color: var(--gold); }
.footer-social a { color: rgba(255, 255, 255, .8); font-size: 1.3rem; margin-right: .8rem; }
.footer-social a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .55); }

/* --------------------------------------------------------------------------
   ADAPTIF
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .hero-slide { min-height: 400px; }
    .hero-title { font-size: 2.6rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-content { padding: 3.5rem 0; }
    .section-title { font-size: 1.4rem; }
}

/* --------------------------------------------------------------------------
   FILTER SIDEBAR (katalog)
   -------------------------------------------------------------------------- */
.filter-card, .summary-card, .struk-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}
.filter-title { font-size: 1rem; font-weight: 700; color: var(--forest-dark); margin-bottom: 1rem; }
.filter-group { margin-bottom: 1rem; }
.filter-label {
    display: block; font-size: .78rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: .4rem;
}
.size-pill input { display: none; }
.size-pill span {
    display: inline-block; padding: .25rem .7rem; border: 1px solid var(--line);
    border-radius: 50px; font-size: .8rem; cursor: pointer; background: #fff;
}
.size-pill input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 600; }
.chip-active { background: var(--forest); color: #fff; border-color: var(--forest); }

/* --------------------------------------------------------------------------
   DETAIL PRODUK
   -------------------------------------------------------------------------- */
.product-gallery { border-radius: var(--radius); overflow: hidden; background: #eef1f0; }
.product-gallery .carousel-item img { aspect-ratio: 1 / 1; object-fit: cover; }
.gallery-thumb {
    width: 64px; height: 64px; object-fit: cover; border-radius: 10px;
    border: 2px solid transparent; cursor: pointer;
}
.gallery-thumb:hover { border-color: var(--forest-mid); }
.price-detail { color: var(--forest); font-weight: 800; font-size: 1.5rem; }
.spec-box { background: var(--soft); border-radius: var(--radius); padding: .5rem 1rem; }
.spec-box th { width: 40%; color: var(--muted); font-weight: 600; font-size: .85rem; }
.spec-box td { font-size: .88rem; }
.qty-input { max-width: 150px; }

/* --------------------------------------------------------------------------
   KERANJANG
   -------------------------------------------------------------------------- */
.cart-list { display: flex; flex-direction: column; gap: .75rem; }
.cart-item {
    display: flex; gap: .85rem; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: .75rem; box-shadow: var(--shadow-sm);
}
.cart-item-img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; flex-shrink: 0; background: #eef1f0; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 700; font-size: .92rem; }
.cart-item-price { font-size: .82rem; color: var(--muted); }
.text-forest { color: var(--forest) !important; }

/* --------------------------------------------------------------------------
   STRUK / INVOICE
   -------------------------------------------------------------------------- */
.struk-card { padding: 1.5rem; }
.struk-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   HALAMAN ARTIKEL
   -------------------------------------------------------------------------- */
.article-hero { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.article-content { font-size: .95rem; line-height: 1.8; color: #343a40; }
.article-content img { max-width: 100%; height: auto; border-radius: 10px; }
.article-content h2, .article-content h3 { font-weight: 700; margin-top: 1.4rem; color: var(--forest-dark); }
.sidebar-article {
    display: flex; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line);
    color: inherit; align-items: center;
}
.sidebar-article:last-of-type { border-bottom: 0; }
.sidebar-article img { width: 62px; height: 62px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.sidebar-article-title { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.sidebar-article:hover .sidebar-article-title { color: var(--forest-mid); }

/* --------------------------------------------------------------------------
   ADMIN PANEL
   -------------------------------------------------------------------------- */
.admin-body { background: #f1f3f5; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    background: var(--forest-dark); color: #fff; width: 240px; flex-shrink: 0;
    position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 1040;
}
.admin-brand {
    display: flex; align-items: center; gap: .5rem; padding: 1rem;
    font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.admin-menu { list-style: none; padding: .5rem 0; margin: 0; }
.admin-menu a {
    display: flex; align-items: center; gap: .65rem; padding: .7rem 1.1rem;
    color: rgba(255, 255, 255, .78); font-size: .9rem;
}
.admin-menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-menu a.active { background: var(--forest-mid); color: #fff; font-weight: 600; border-left: 3px solid var(--gold); }
.admin-menu a i { width: 20px; text-align: center; }
.admin-content { flex: 1; margin-left: 240px; min-width: 0; }
.admin-topbar {
    background: #fff; border-bottom: 1px solid var(--line); padding: .75rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1030;
}
.admin-main { padding: 1.25rem; }
.stat-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem; display: flex; align-items: center; gap: .9rem; height: 100%;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; flex-shrink: 0;
}
.stat-value { font-size: 1.2rem; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.bg-forest { background: var(--forest) !important; }
.bg-gold { background: var(--gold) !important; color: #3a2a17 !important; }

/* Tabel admin responsif */
.table-admin thead th { font-size: .78rem; text-transform: uppercase; color: var(--muted); letter-spacing: .3px; background: var(--soft); }
.table-admin td { vertical-align: middle; font-size: .88rem; }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; }
}

/* --------------------------------------------------------------------------
   CETAK
   -------------------------------------------------------------------------- */
@media print {
    .no-print, .navbar-desktop, .mobile-appbar, .bottom-nav, .fab-wa, .site-footer { display: none !important; }
    body { background: #fff; padding: 0; }
    .struk-card { border: 0; box-shadow: none; padding: 0; }
}
