/* =======================================
   VARIABEL WARNA & TEMA (Warm & Cozy)
   ======================================= */
   :root {
    --bg-color: #F8F5F2; /* Krem terang yang cozy */
    --surface-color: #FFFFFF;
    --text-main: #332B29; /* Coklat sangat gelap keabu-abuan agar profesional, tapi tidak pure black */
    --text-muted: #8F847D;
    --accent-color: #D4A373; /* Warna Latte soft */
    
    --brand-color: #332B29; /* Akan di-override dinamis oleh JS untuk elemen tertentu */
    --border-rad-lg: 16px;
    --border-rad-md: 10px;
    
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hard: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 100px; /* Ruang untuk floating bar */
}

/* =======================================
   HEADER
   ======================================= */
.app-header {
    background-color: var(--surface-color);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    margin-bottom: 24px;
}
.app-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}
.app-header h1 span {
    color: var(--accent-color);
}
.app-header p {
    font-size: 14px;
    color: var(--text-muted);
}

/* =======================================
   LAYOUTING UTAMA UTK VIEW (Home / Produk)
   ======================================= */
.view-section {
    display: none;
    padding: 0 20px;
    max-width: 1000px; /* Lebar lebih luas dan responsif untuk desktop maupun mobile */
    margin: 0 auto;
}
.view-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.section-title p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* =======================================
   KARTU BRAND (Grid)
   ======================================= */
.grid-container {
    display: grid;
    /* Grid otomatis menyesuaikan jumlah kolom di layar besar atau kecil */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.brand-card {
    background: var(--surface-color);
    border-radius: var(--border-rad-lg);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transisi lebih halus (tidak kaku) */
}
.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hard); /* Efek melayang saat di-hover komputer */
}
.brand-card:active {
    transform: scale(0.97);
}
.brand-icon {
    font-size: 60px; /* Diperbesar untuk emoji */
    margin-bottom: 16px; /* Jarak dibuat lebih senggang */
    display: block;
    width: 100%;
}
.brand-card h3 {
    font-size: 18px; /* Ukuran font judul brand sedikit diperbesar */
    font-weight: 800;
}

/* =======================================
   HALAMAN PRODUK
   ======================================= */
.product-header {
    background: var(--brand-color);
    color: #fff;
    padding: 24px 20px;
    border-radius: var(--border-rad-lg);
    margin-bottom: 20px;
    transition: background 0.3s;
}
.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
}

.menu-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--surface-color);
    border-radius: var(--border-rad-md);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}
.tab-btn.active {
    background: var(--brand-color);
    color: #fff;
}

/* List Produk */
.products-list {
    display: grid;
    /* Membuat bentuk grid yang responsif menyamping di desktop */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.product-item {
    background: var(--surface-color);
    border-radius: var(--border-rad-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease; /* Transisi halus */
    cursor: pointer;
}
.product-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hard);
}
.prod-image {
    width: 60px;
    height: 60px;
    background: var(--bg-color);
    border-radius: var(--border-rad-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    overflow: hidden;
}
/* Jika gambar berupa tag IMG (URL) */
.prod-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prod-info {
    flex: 1;
}
.prod-info h4 {
    font-size: 15px;
    font-weight: 700;
}
.prod-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0;
}
.price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.price-asli {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}
.prod-price {
    font-weight: 800;
    color: var(--brand-color);
    font-size: 15px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 20px;
}
.qty-btn {
    background: var(--surface-color);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}
.qty-display {
    font-weight: 700;
    font-size: 14px;
    min-width: 16px;
    text-align: center;
}
.size-options {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 10px;
    background: #f7f3ef;
    padding: 6px;
    border-radius: 999px;
}
.size-option {
    position: relative;
}
.size-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.size-option span {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    color: #6b5f59;
    background: #fff;
    border: 1px solid #e9e1db;
    cursor: pointer;
}
.size-option input:checked + span {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
}
.add-btn {
    background: var(--brand-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
}

/* =======================================
   FLOATING CART BAR
   ======================================= */
.cart-bar {
    position: fixed;
    bottom: 24px;
    left: 20px;
    right: 20px;
    max-width: 560px;
    margin: 0 auto;
    background: var(--text-main);
    color: #fff;
    padding: 16px 20px;
    border-radius: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-hard);
    transition: transform 0.3s;
}
.cart-bar.hidden {
    transform: translateY(150px);
}
.cart-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cart-badge {
    background: var(--accent-color);
    color: #fff;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}
.cart-text {
    font-weight: 600;
    font-size: 14px;
}
.cart-total {
    font-weight: 800;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* Responsif Posisi Cart jika di Komputer/Desktop */
@media (min-width: 768px) {
    .cart-bar {
        left: auto;
        right: 40px;
        bottom: 40px;
        width: 400px;
    }
}

/* =======================================
   MODAL CHECKOUT
   ======================================= */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.modal.hidden {
    display: none;
}
.modal-content {
    background: var(--surface-color);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.close-btn {
    background: var(--bg-color);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-main);
}

.cart-items-list {
    margin-bottom: 24px;
    max-height: 250px;
    overflow-y: auto;
}
.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #E0DCD9;
}
.cart-item-row h5 {
    font-size: 14px;
    margin-bottom: 4px;
}

/* Form Checkout */
.checkout-form {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--border-rad-md);
    margin-bottom: 24px;
}
.checkout-form h4 {
    margin-bottom: 16px;
    font-size: 15px;
}
.form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #E0DCD9;
    background: #fff;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}
.form-group textarea {
    resize: none;
    height: 70px;
}

.checkout-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.final-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}
.final-total strong {
    font-size: 20px;
    color: #25D366; /* Hijau WA biar terasosiasi dengan checkout */
}

.wa-btn {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: var(--border-rad-md);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s;
}
.wa-btn:disabled {
    background: #A5D6A7; /* Warna hijau luntur saat didisabled */
    cursor: not-allowed;
    box-shadow: none;
}

/* =======================================
   CARA ORDER (Home)
   ======================================= */
.how-to-order {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--border-rad-lg);
    margin-top: 32px;
    box-shadow: var(--shadow-soft);
}
.how-to-order h3 {
    margin-bottom: 12px;
    font-size: 17px;
    color: var(--text-main);
    font-weight: 800;
}
.how-to-order ol {
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-muted);
}
.how-to-order ol li {
    margin-bottom: 10px;
}

/* =======================================
   SYARAT & KETENTUAN (Cart)
   ======================================= */
.snk-box {
    background: #FFF8E1; /* Warna kuning peringatan yang lembut */
    padding: 16px;
    border-radius: var(--border-rad-md);
    margin-bottom: 24px;
    border: 1px solid #FFE082;
}
.snk-box h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: #F57F17;
    font-weight: 800;
}
.snk-box ul {
    padding-left: 18px;
    font-size: 12px;
    color: #795548;
    margin-bottom: 16px;
}
.snk-box ul li {
    margin-bottom: 6px;
}
.snk-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #5D4037;
}
.snk-checkbox input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: #F57F17;
    cursor: pointer;
}

/* =======================================
   TOAST NOTIFICATION
   ======================================= */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #332B29;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    z-index: 9999;
    box-shadow: var(--shadow-hard);
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s;
}
.toast.hidden {
    opacity: 0;
    transform: translate(-50%, -20px);
    pointer-events: none;
}

/* =======================================
   MODAL DETAIL PRODUK
   ======================================= */
.product-detail-content {
    padding: 0 !important;
    overflow: hidden;
    position: relative;
}
.abs-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    box-shadow: var(--shadow-soft);
}
.detail-hero-img {
    width: 100%;
    height: 280px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
}
.detail-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mencegah gambar terpotong */
}
.detail-body {
    padding: 24px;
    text-align: center;
}
.detail-body h3 {
    font-size: 22px;
    font-weight: 800;
}
.detail-desc {
    color: var(--text-muted);
    margin: 10px 0 20px 0;
    font-size: 15px;
    line-height: 1.5;
}
.detail-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-color);
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
}
.detail-price .price-asli {
    font-size: 16px;
    font-weight: normal;
}
.detail-action {
    display: flex;
    justify-content: center;
    width: 100%;
}