/*
  Style utama Da Di Ya Snack
  Tema: krem, putih, cokelat tua, dan oranye muda.
*/
:root {
    --cream: #fff5e6;
    --cream-2: #f8e8cf;
    --white: #ffffff;
    --brown: #4a2c20;
    --brown-2: #70462f;
    --orange: #f6a94b;
    --orange-dark: #de7f1e;
    --green: #2f8f5b;
    --red: #d94a38;
    --muted: #7a6a5f;
    --border: #ead6be;
    --shadow: 0 12px 30px rgba(74, 44, 32, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--cream);
    color: var(--brown);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 245, 230, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: var(--shadow);
    object-fit: cover;
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 700;
}

.nav a {
    padding: 8px 10px;
    border-radius: 999px;
}

.nav a:hover,
.nav a.active {
    background: var(--white);
    color: var(--orange-dark);
}

.cart-button {
    position: relative;
    border: 0;
    background: var(--brown);
    color: var(--white);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    box-shadow: var(--shadow);
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--orange);
    color: var(--brown);
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid var(--cream);
}

.hero {
    padding: 64px 0 44px;
    background:
        radial-gradient(circle at top left, rgba(246, 169, 75, 0.35), transparent 32%),
        linear-gradient(135deg, var(--cream), #fffaf2 55%, #ffe2b9);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 36px;
    align-items: center;
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--white);
    color: var(--orange-dark);
    font-weight: 800;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.02;
    margin: 18px 0 14px;
}

.hero p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
    max-width: 620px;
}

.info-list {
    display: grid;
    gap: 10px;
    margin: 20px 0 28px;
}

.info-item {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 700;
}

.hero-card {
    background: var(--white);
    border-radius: 30px;
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.hero-card img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 24px;
    background: var(--cream-2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--orange); color: var(--brown); }
.btn-dark { background: var(--brown); color: var(--white); }
.btn-light { background: var(--white); color: var(--brown); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-success { background: var(--green); color: var(--white); }
.btn-small { padding: 8px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.section { padding: 54px 0; }
.section-title {
    text-align: center;
    margin-bottom: 28px;
}
.section-title h2 {
    margin: 0 0 8px;
    font-size: clamp(26px, 4vw, 38px);
}
.section-title p { color: var(--muted); margin: 0; }

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.feature-card,
.product-card,
.panel-card,
.form-card,
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--cream-2);
    font-size: 26px;
    margin-bottom: 12px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    display: flex;
    flex-direction: column;
    padding: 14px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 18px;
    background: var(--cream-2);
}

.product-body { padding: 14px 6px 6px; flex: 1; display: flex; flex-direction: column; }
.product-title { margin: 0; font-size: 20px; }
.product-desc { color: var(--muted); line-height: 1.5; min-height: 46px; }
.product-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin: auto 0 14px;
}
.price { color: var(--orange-dark); font-weight: 900; font-size: 20px; }
.stock { font-size: 13px; font-weight: 800; background: var(--cream-2); padding: 7px 10px; border-radius: 999px; }
.stock.empty { background: #fde0db; color: var(--red); }

.footer {
    background: var(--brown);
    color: var(--white);
    padding: 34px 0;
    margin-top: 40px;
}
.footer p { color: rgba(255,255,255,.78); }

.cart-overlay,
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(35, 21, 15, .42);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.cart-overlay.show,
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -430px;
    width: min(420px, 92vw);
    height: 100vh;
    background: var(--white);
    z-index: 110;
    box-shadow: -16px 0 34px rgba(35, 21, 15, .18);
    transition: right .25s ease;
    display: flex;
    flex-direction: column;
}
.cart-sidebar.show { right: 0; }

.cart-header,
.modal-header {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-header h3,
.modal-header h3 { margin: 0; }
.icon-btn {
    border: 0;
    background: var(--cream-2);
    color: var(--brown);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 900;
}
.cart-items { padding: 18px; overflow: auto; flex: 1; }
.cart-empty { text-align: center; color: var(--muted); margin: 60px 0; }
.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; }
.cart-item h4 { margin: 0 0 6px; }
.cart-item p { margin: 0; color: var(--muted); font-size: 13px; }
.qty-controls { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.qty-controls button {
    width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--cream-2); font-weight: 900; cursor: pointer;
}
.remove-item { background: transparent; border: 0; color: var(--red); cursor: pointer; font-weight: 800; }
.cart-footer { border-top: 1px solid var(--border); padding: 18px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 20px; font-weight: 900; margin-bottom: 14px; }

.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -44%);
    width: min(680px, calc(100% - 26px));
    max-height: 92vh;
    overflow: auto;
    background: var(--white);
    border-radius: 24px;
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: var(--shadow);
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal-body { padding: 18px; }

.form-grid { display: grid; gap: 14px; }
.form-group label { display: block; font-weight: 800; margin-bottom: 7px; }
.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    color: var(--brown);
    background: #fffdf9;
}
textarea.form-control { min-height: 98px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.order-summary {
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 14px;
}
.order-summary ul { margin: 8px 0 0; padding-left: 20px; }

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: var(--brown);
    color: var(--white);
    padding: 13px 16px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: .25s ease;
    z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }

.page-hero {
    padding: 40px 0;
    background: linear-gradient(135deg, #fffaf2, #ffe4bf);
    border-bottom: 1px solid var(--border);
}
.page-hero h1 { margin: 0 0 8px; font-size: 38px; }
.page-hero p { margin: 0; color: var(--muted); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--cream); font-size: 14px; }

.alert { padding: 14px 16px; border-radius: 16px; margin: 14px 0; border: 1px solid var(--border); }
.alert-success { background: #e8f7ef; color: #17633a; }
.alert-warning { background: #fff1d8; color: #8a5400; }
.alert-danger { background: #ffe4e0; color: #9b2f23; }

.timeline { display: grid; gap: 12px; margin-top: 18px; }
.timeline-step {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fffdf9;
}
.timeline-dot {
    width: 28px; height: 28px; border-radius: 50%; background: var(--cream-2); display: grid; place-items: center; font-weight: 900;
}
.timeline-step.active { border-color: var(--orange); background: #fff4e4; }
.timeline-step.done .timeline-dot { background: var(--green); color: var(--white); }
.timeline-step.active .timeline-dot { background: var(--orange); color: var(--brown); }

.payment-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.qris-box { text-align: center; }
.qris-box img { width: 240px; margin: 0 auto 12px; border-radius: 18px; border: 1px solid var(--border); }

.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar-admin { background: var(--brown); color: var(--white); padding: 22px; }
.sidebar-admin h2 { margin-top: 0; }
.sidebar-admin a { display: block; padding: 11px 12px; border-radius: 12px; margin: 7px 0; color: rgba(255,255,255,.88); }
.sidebar-admin a:hover, .sidebar-admin a.active { background: rgba(255,255,255,.12); color: var(--white); }
.admin-main { padding: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat-card strong { display: block; font-size: 30px; margin-top: 8px; color: var(--orange-dark); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, var(--cream), #ffe1b5); }
.login-card { width: min(420px, 100%); }
.thumb { width: 72px; height: 56px; object-fit: cover; border-radius: 10px; }
.bukti-img { max-width: 180px; border-radius: 12px; border: 1px solid var(--border); }

@media (max-width: 900px) {
    .hero-grid,
    .payment-layout,
    .admin-layout { grid-template-columns: 1fr; }
    .features,
    .product-grid,
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar-admin { position: static; }
}

@media (max-width: 640px) {
    .header-inner { align-items: flex-start; }
    .nav { display: none; }
    .features,
    .product-grid,
    .stats-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 38px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; }
}


.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--brown);
    border-radius: 999px;
    padding: 10px 13px;
    font-weight: 900;
    cursor: pointer;
}

.btn:focus-visible,
.form-control:focus,
.cart-button:focus-visible,
.icon-btn:focus-visible,
.menu-toggle:focus-visible {
    outline: 3px solid rgba(246, 169, 75, .45);
    outline-offset: 2px;
}

.panel-card h1:first-child,
.panel-card h2:first-child,
.form-card h1:first-child,
.form-card h2:first-child { margin-top: 0; }

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

@media (max-width: 640px) {
    .brand-subtitle { display: none; }
    .menu-toggle { display: inline-flex; }
    .header-inner { align-items: center; }
    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: 18px;
        padding: 8px;
        order: 5;
    }
    .nav.show { display: flex; }
    .nav a { width: 100%; }
    .cart-item { grid-template-columns: 56px 1fr; }
    .cart-item .remove-item { grid-column: 2; justify-self: start; padding-left: 0; }
    .page-hero h1 { font-size: 30px; }
    .admin-main { padding: 18px; }
}

/* Bagian checkout keranjang */
.cart-footer {
    position: sticky;
    bottom: 0;
    padding: 18px 14px 14px;
    background: #ffffff;
    border-top: 1px solid #efd7bd;
    box-shadow: 0 -10px 28px rgba(74, 42, 31, 0.08);
    z-index: 5;
}

.checkout-summary {
    margin-bottom: 12px;
}

.cart-item-count {
    display: block;
    margin-bottom: 5px;
    color: #916d5b;
    font-size: 12px;
}

.checkout-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffa93f, #f28a22);
    color: #3e2117;
    font-weight: 700;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    box-shadow: 0 8px 20px rgba(242, 138, 34, 0.25);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(242, 138, 34, 0.32);
    filter: brightness(1.03);
}

.checkout-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

.checkout-btn:focus-visible {
    outline: 3px solid rgba(242, 138, 34, 0.35);
    outline-offset: 3px;
}

.checkout-btn:disabled {
    background: #eadfd3;
    color: #9d887a;
    cursor: not-allowed;
    box-shadow: none;
}

.checkout-btn-icon {
    font-size: 20px;
    transition: transform 0.2s ease;
}

.checkout-btn:hover:not(:disabled) .checkout-btn-icon {
    transform: translateX(5px);
}

.checkout-btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

.checkout-btn.is-loading .checkout-btn-icon {
    width: 17px;
    height: 17px;
    font-size: 0;
    border: 2px solid rgba(62, 33, 23, 0.25);
    border-top-color: #3e2117;
    border-radius: 50%;
    animation: checkoutSpin 0.7s linear infinite;
}

.checkout-note {
    margin: 8px 0 0;
    color: #9b7a68;
    font-size: 11px;
    text-align: center;
}

@keyframes checkoutSpin {
    to {
        transform: rotate(360deg);
    }
}

.timeline-step.failed {
    border-color: #d9534f;
    background: #fff0ee;
    color: #9b2f23;
}

.timeline-step.failed .timeline-dot {
    background: #d9534f;
    color: var(--white);
}