:root {
    --theme-color: #28a745;
    --theme-color-dark: #1e7e34;
}

body {
    background-color: #f5f6f8;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    padding-bottom: 80px;
}

/* ===== Header Toko ===== */
.toko-header {
    background: linear-gradient(135deg, var(--theme-color), var(--theme-color-dark));
    color: #fff;
    padding: 18px 16px 55px 16px;
    border-radius: 0 0 24px 24px;
    position: relative;
}

.toko-header .toko-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    background: #fff;
}

.toko-header h5 {
    margin-bottom: 2px;
    font-weight: 700;
}

.toko-header small {
    opacity: 0.9;
}

.search-box {
    margin-top: -35px;
    padding: 0 16px;
}

.search-box .form-control {
    border-radius: 30px;
    padding: 12px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: none;
}

/* ===== Kategori Chip ===== */
.kategori-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 14px 16px 6px 16px;
    scrollbar-width: none;
}
.kategori-scroll::-webkit-scrollbar { display: none; }

.kategori-chip {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.kategori-chip.active,
.kategori-chip:hover {
    background: var(--theme-color);
    color: #fff;
    border-color: var(--theme-color);
}

/* ===== Produk Card ===== */
.produk-grid {
    padding: 8px 12px 12px 12px;
}

.produk-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.12s;
}

.produk-card:active {
    transform: scale(0.98);
}

.produk-foto-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f0f0;
}

.produk-foto-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.produk-card .no-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 2rem;
}

.btn-zoom-foto {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 2;
}

.btn-zoom-foto:active {
    background: rgba(0,0,0,0.75);
}

.produk-card-body {
    padding: 10px 10px 12px 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.produk-nama {
    font-size: 0.88rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.produk-deskripsi {
    font-size: 0.72rem;
    font-weight: 400;
    color: #999;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.produk-satuan {
    font-size: 0.72rem;
    color: #999;
    margin-bottom: 6px;
}

.produk-noted {
    font-size: 0.7rem;
    color: #b45309;
    background: #fff7e6;
    border: 1px solid #ffe0a3;
    border-radius: 5px;
    padding: 2px 6px;
    margin-bottom: 6px;
    line-height: 1.3;
    display: inline-block;
}

.satuan-select {
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    color: #555;
    background-color: #fafafa;
}
.satuan-select:focus {
    box-shadow: none;
    border-color: var(--theme-color);
}

.produk-harga {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--theme-color-dark);
    margin-bottom: 8px;
}

.produk-action {
    margin-top: auto;
}

.btn-tambah {
    width: 100%;
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-tambah:hover { background: var(--theme-color-dark); color: #fff; }

.qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--theme-color);
    border-radius: 8px;
    overflow: hidden;
}

.qty-control button {
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 700;
    width: 32px;
    height: 30px;
    font-size: 1rem;
}

.qty-control span {
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ===== Floating Cart Button ===== */
.floating-cart {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 500px;
    background: var(--theme-color);
    color: #fff;
    border-radius: 14px;
    padding: 14px 18px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1030;
    border: none;
}

.floating-cart .cart-count-badge {
    background: #fff;
    color: var(--theme-color-dark);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 10px;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state i { font-size: 3rem; margin-bottom: 10px; display: block; }

/* ===== Offcanvas Cart ===== */
.cart-item {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.cart-item img, .cart-item .no-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}
.cart-item-info { flex-grow: 1; }
.cart-item-info .nama { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.cart-item-info .harga-satuan { font-size: 0.75rem; color: #888; }
.cart-item-info .cart-item-noted { font-size: 0.7rem; color: #b45309; margin-top: 2px; }
.cart-item-remove {
    color: #dc3545;
    background: none;
    border: none;
    font-size: 0.78rem;
}

.total-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 16px;
    margin: 10px 0;
}

/* ===== Admin sidebar ===== */
.admin-sidebar {
    min-height: 100vh;
    background: #1e293b;
    color: #cbd5e1;
}
.admin-sidebar .brand {
    padding: 18px 20px;
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    border-bottom: 1px solid #334155;
}
.admin-sidebar a {
    color: #cbd5e1;
    padding: 11px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: #334155;
    color: #fff;
    border-left-color: var(--theme-color);
}
.admin-topbar {
    background: #fff;
    padding: 12px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card .icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
}

.admin-content { padding: 20px; }

@media (max-width: 767px) {
    .produk-nama { font-size: 0.85rem; }
}

/* ===== Pop-up Pengumuman ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-box {
    background: #fff;
    border-radius: 16px;
    padding: 26px 22px 22px 22px;
    max-width: 380px;
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    transform: scale(0.75) translateY(30px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.popup-overlay.show .popup-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: #f1f1f1;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
}

.popup-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--theme-color, #28a745);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 14px auto;
}

.popup-judul {
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.popup-pesan {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 18px;
    white-space: pre-line;
}

.popup-btn-tutup {
    background: var(--theme-color, #28a745);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 28px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* ===== Lightbox Foto Produk ===== */
.foto-lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.foto-lightbox.show {
    opacity: 1;
    visibility: visible;
}

.foto-lightbox-content {
    max-width: 100%;
    max-height: 100%;
    text-align: center;
}

.foto-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.foto-lightbox.show .foto-lightbox-content img {
    transform: scale(1);
}

.foto-lightbox-caption {
    color: #fff;
    font-size: 0.85rem;
    margin-top: 12px;
}

.foto-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
