/* ===========================================================
   Tema: Cerah Putih & Abu-abu Biru - Website Jualan
   =========================================================== */
:root {
    --bg-0: #eef1f6;
    --bg-1: #f6f8fb;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --border: #dde3ec;
    --border-bright: #c4ccd9;
    --accent-1: #030303;
    --accent-2: #5b7597;
    --accent-3: #8ea0b8;
    --accent-glow: rgba(91, 117, 151, .16);
    --text-1: #1f2b3d;
    --text-2: #4b5c72;
    --text-muted: #8794a6;
    --radius: 14px;
    --shadow-glow: 0 0 18px var(--accent-glow);
    --topbar-h: 68px;
    --font: 'Poppins', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 20% -10%, #ffffff 0%, var(--bg-0) 60%) fixed;
    color: var(--text-1);
    font-family: var(--font);
    scroll-behavior: smooth;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent-3), var(--border-bright));
    border-radius: 10px;
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--topbar-h, 68px);
    padding: 11px 11px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.92));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(31,43,61,.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: .3px;
    min-width: 0;
    order: 2;
    flex: 1;
}
.brand .brand-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-badge {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--surface-2), var(--bg-1));
    border: 1px solid var(--border-bright);
    box-shadow: var(--shadow-glow);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: var(--surface);
    border: 0px solid var(--border);
    color: var(--text-1);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    order: 1;
    flex-shrink: 0;
}

.search-box {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    order: 0;
}
.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 14px;
}
.search-box input::placeholder { color: var(--text-muted); }

.topbar-actions { order: 3; flex-shrink: 0; }
.topbar-actions a.btn-admin {
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--surface-2), var(--bg-1));
    border: 1px solid var(--border-bright);
    box-shadow: var(--shadow-glow);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text-1);
}
.topbar-actions a.btn-admin:hover { border-color: var(--accent-2); }

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    min-height: calc(100vh - var(--topbar-h, 68px));
}

/* ---------- Sidenav ---------- */
.sidenav {
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    border-right: 1px solid var(--border);
    padding: 22px 16px;
    position: sticky;
    top: var(--topbar-h, 68px);
    align-self: start;
    height: calc(100vh - var(--topbar-h, 68px));
    overflow-y: auto;
}

.sidenav h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 6px 6px 14px;
}

.sidenav ul { list-style: none; margin: 0; padding: 0; }

.sidenav li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    margin-bottom: 6px;
    border-radius: 10px;
    color: var(--text-2);
    font-size: 14.5px;
    font-weight: 500;
    transition: all .2s ease;
    border: 1px solid transparent;
}

.sidenav li a:hover {
    background: var(--surface-2);
    color: var(--text-1);
    border-color: var(--border);
}

.sidenav li a.active {
    background: linear-gradient(135deg, rgba(91,117,151,.14), rgba(142,160,184,.1));
    color: var(--accent-1);
    border-color: var(--border-bright);
    box-shadow: inset 0 0 0 1px rgba(91,117,151,.12), 0 0 12px rgba(91,117,151,.10);
}

.sidenav .count {
    font-size: 11px;
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--text-muted);
}
.sidenav li a.active .count {
    background: var(--accent-2);
    color: #ffffff;
}

/* ---------- Main content ---------- */
.content { padding: 26px 28px 60px; }

.page-title {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-title .accent {
    width: 6px; height: 24px;
    border-radius: 4px;
    background: linear-gradient(var(--accent-1), var(--accent-3));
    box-shadow: var(--shadow-glow);
    display: inline-block;
}

/* ---------- Kelompok Kategori ---------- */
.category-section {
    margin-bottom: 34px;
}
.category-section:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--accent-1);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    position: relative;
}
.category-title::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 56px;
    height: 2px;
    background: var(--accent-2);
}

/* ---------- Grid produk (6 item per baris di desktop) ---------- */
.item-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.item-card {
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
}
.item-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 40%, rgba(91,117,151,.06) 50%, transparent 60%);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}
.item-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-bright);
    box-shadow: 0 12px 28px rgba(31,43,61,.12), var(--shadow-glow);
}
.item-card:hover::before { opacity: 1; }

.item-card .thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
}

.item-card .info { padding: 12px 13px 6px 13px; }

.item-card .cat-tag {
    display: inline-block;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--accent-2);
    background: rgba(91,117,151,.09);
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.item-card .name {
    font-size: 15.5px;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.3;
    color: var(--text-1);
}

.item-card .price {
    font-size: 16px;
    font-weight: 600;
    color: #c2680b;
    margin:1px 0px 3px 0px!important
}

/* ---------- Lihat lainnya (per kategori) ---------- */
.category-more {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    /*border-radius: 999px;*/
    /*border: 1px solid var(--border);*/
    /*background: var(--surface);*/
    color: var(--accent-1);
    font-weight: 600;
    font-size: 13px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.btn-more::after {
    content: "\2192";
    transition: transform .2s ease;
}
.btn-more:hover {
    border-color: var(--accent-3);
    background: var(--surface-2);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.btn-more:hover::after { transform: translateX(3px); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* ---------- Halaman detail item ---------- */
.detail-wrap {
    display: grid;
    grid-template-columns: minmax(280px, 460px) 1fr;
    gap: 32px;
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 16px 40px rgba(31,43,61,.10);
}

.detail-wrap .thumb-big {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--bg-1);
    box-shadow: var(--shadow-glow);
}

.detail-info .cat-tag {
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--accent-2);
    background: rgba(91,117,151,.09);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.detail-info h1 {
    font-size: 28px;
    margin: 0 0 6px;
    font-weight: 600;
    color: var(--text-1);
}

.detail-info .price-big {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #c2680b;
    margin-top:10px !important;
}

.detail-info .desc {
    color: var(--text-2);
    line-height: 1.75;
    margin-bottom: 26px;
    white-space: pre-line;
}

.btn-buy {
    display: block;
    text-align: center;
    align-items: center;
    gap: 10px;
    padding: 15px 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2fb9e8, #0b8fd8); /* aksen biru Telegram, tetap dipertahankan agar mudah dikenali */
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 10px 26px rgba(11,143,216,.25);
    transition: transform .2s ease, box-shadow .2s ease;
    border: none;
    cursor: pointer;
}
.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(11,143,216,.35);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 18px;
}
.back-link:hover { color: var(--text-1); }

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--bg-1);
}

/* ---------- Overlay untuk sidenav mobile ---------- */
.overlay {
    display: none;
    position: fixed;
    top: var(--topbar-h, 68px);
    left: 0; right: 0; bottom: 0;
    background: rgba(31,43,61,.35);
    z-index: 40;
}
.overlay.show { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .menu-toggle { display: inline-flex; align-items: center; }

    /* Baris 1: toggle - brand - tombol admin. Baris 2: pencarian full width,
       supaya kotak pencarian tidak menutupi elemen lain. */
    .topbar { flex-wrap: wrap; }
    .search-box {
        order: 4;
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        margin-top: 4px;
    }

    /* Sidenav mulai tepat di bawah topbar, bukan dari atas layar. */
    .sidenav {
        position: fixed;
        top: var(--topbar-h, 68px);
        left: 0;
        height: calc(100vh - var(--topbar-h, 68px));
        width: 260px;
        z-index: 1999;
        transform: translateX(-105%);
        transition: transform .3s ease;
        box-shadow: 8px 0 30px rgba(31,43,61,.15);
    }
    .sidenav.open { transform: translateX(0); }

    .detail-wrap { grid-template-columns: 1fr; }
    .content { padding: 18px 16px 40px; }

    /* Tampilan HP/tablet: 3 item per baris */
    .item-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
    .item-card .name { font-size: 12.5px; }
    .item-card .price { font-size: 13px; }
    .item-card .info { padding: 8px 8px 4px 8px; }
    .detail-info h1 { font-size: 22px; }
}
