/* ====== Global ====== */
body {
    font-family: 'Poppins', system-ui, sans-serif;
}

/* garis pemisah topbar-navbar */
.garis {
    height: 3px;
    background: #f97316;
    margin: 0;
    border: 0;
}

/* ====== Nav link ====== */
.nav-link {
    color: #64748b;
    padding: .45rem .85rem;
    border-radius: .75rem;
    font-size: .9rem;
    transition: color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

@media (min-width: 640px) {
    .nav-link {
        padding: .55rem 1.1rem;
        font-size: .98rem;
    }
}

.nav-link:hover {
    color: #0f172a;
    background: #fef3c7;
    box-shadow: 0 10px 25px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.nav-link.active {
    color: #0f172a;
    font-weight: 700;
    background: #ffedd5;
    box-shadow: 0 14px 30px rgba(249, 115, 22, .25);
    transform: translateY(-1px);
}

/* ===== NAVBAR LOGO ===== */
.logo-navbar {
    height: 70px;        /* BESAR tapi aman */
    width: auto;
    object-fit: contain;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    display: block;
}


/* Mobile lebih kecil biar proporsional */
@media (max-width: 640px) {
    .logo-navbar {
        height: 70px;
    }
}


/* ====== Generic Buttons ====== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem 1.4rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: .9rem;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #ffffff;
    border: none;
    box-shadow: 0 12px 30px rgba(249, 115, 22, .35);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    white-space: nowrap;
}

.btn-primary:hover {
    filter: brightness(1.02);
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(249, 115, 22, .45);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .6rem 1.4rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: .85rem;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .12);
}

/* ====== Product Card Layout ====== */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .25s ease, box-shadow .25s ease, outline-color .25s ease, background .25s ease;
    outline: 2px solid transparent;
    outline-offset: 0;
    background: #ffffff;
    border-radius: 1.4rem;
    border: 1px solid #e5e7eb;
}

.product-card:hover,
.product-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
    outline-color: rgba(249, 115, 22, .35);
    background: #fffbeb;
}

/* container gambar: rasio 4:3, selalu rapi */
.product-card-image {
    position: relative;
    width: 100%;
    padding-top: 75%;
    border-radius: 1.2rem;
    overflow: hidden;
    background: #f1f5f9;
}

.product-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;        /* ⬅️ INI KUNCINYA */
    display: block;
    transition: transform .35s ease;
}


.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* body card: teks & harga */
.product-card-body {
    margin-top: .75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    gap: .75rem;
}

.product-card-header,
.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

/* ====== Hero Accent ====== */
.hero-accent {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 0% 0%, #fffbeb, #fee2e2);
}

.hero-accent::before {
    content: "";
    position: absolute;
    right: -12%;
    top: -10%;
    width: 60%;
    height: 120%;
    background: linear-gradient(135deg, rgba(249, 115, 22, .12) 0%, rgba(59, 130, 246, .10) 100%);
    transform: rotate(-12deg);
}

/* ====== Page base ====== */
.page {
    background: #f4f5fb;
}

/* Scrollbar kecil */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .45);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ====== Card umum (keranjang, dll) ====== */
.card {
    background: #ffffff;
    border-radius: 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .05);
}

/* ====== Chatbot ====== */
/* ===== CHATBOT POSITION ===== */
#chatbot-root {
    right: 1.5rem;
    transition: bottom .25s ease, opacity .2s ease, transform .2s ease;
}

/* normal state */
.chatbot-normal {
    bottom: 1.5rem;
}

/* ada cart bar */
.chatbot-with-cart {
    bottom: 5.5rem; /* pas di atas cart bar */
}

/* mobile tuning */
@media (max-width: 480px) {
    #chatbot-root {
        right: 0.75rem;
    }

    .chatbot-normal {
        bottom: 1rem;
    }

    .chatbot-with-cart {
        bottom: 6.25rem; /* sedikit lebih tinggi dari cart */
    }
}


.chatbot-bubble {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.4rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: .78rem;
    background: linear-gradient(135deg, #4f46e5, #f97316);
    color: #ffffff;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .35);
}

.chatbot-bubble span:first-child {
    font-size: 1rem;
}

.chatbot-messages {
    max-height: 22rem;
    overflow-y: auto;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .7);
    border-radius: 999px;
}

/* ====== Payment toggle ====== */
#payment-toggle {
    background: #ffffff;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
}

.pay-btn {
    border-radius: 9999px;
    padding: .45rem 1rem;
    font-weight: 500;
    font-size: .8rem;
    background: #f9fafb;
    color: #64748b;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}

.pay-btn:hover {
    background: #f3f4f6;
}

.pay-btn--active {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
    box-shadow: 0 12px 28px rgba(22, 163, 74, .35);
    transform: translateY(-1px);
}

/* ====== Modal background blur ====== */
#qty-modal {
    backdrop-filter: blur(4px);
}

/* ====== Footer ====== */
footer {
    color: #6b7280;
}

/* ====== Fix chatbot input & placeholder ====== */
#chatbot-input {
    color: #111827 !important;
}

#chatbot-input::placeholder {
    color: #6b7280 !important;
    opacity: 1;
}

/* =========================
   DARK THEME (toggle via html.dark)
   ========================= */
html.dark {
    color-scheme: dark;
}

html.dark body.page {
    background: #0b1220 !important;
    color: #e5e7eb !important;
}

html.dark header.sticky {
    background: rgba(15, 23, 42, .85) !important;
    border-bottom-color: rgba(148, 163, 184, .18) !important;
}

html.dark #main-nav {
    background: transparent !important;
}

html.dark .nav-link {
    color: #94a3b8;
}

html.dark .nav-link:hover {
    color: #e2e8f0;
    background: rgba(30, 41, 59, .85);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .35);
}

html.dark .nav-link.active {
    color: #fff;
    background: rgba(249, 115, 22, .18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
}

html.dark .hero-accent {
    background: radial-gradient(circle at 0% 0%, #0b1220, #111827);
}

html.dark .hero-accent::before {
    background: linear-gradient(135deg, rgba(249, 115, 22, .14) 0%, rgba(124, 58, 237, .12) 100%);
}

html.dark .card {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

html.dark .product-card {
    background: #0f172a;
    border-color: rgba(148, 163, 184, .18);
}

html.dark .product-card:hover,
html.dark .product-card:focus-within {
    background: linear-gradient(
        180deg,
        rgba(249,115,22,.12),
        rgba(15,23,42,.95)
    );

    outline-color: rgba(249, 115, 22, .95);

    box-shadow:
        0 0 0 1px rgba(249,115,22,.55),
        0 0 25px rgba(249,115,22,.45),
        0 18px 45px rgba(0,0,0,.65);

    transform: translateY(-6px);
}


html.dark .product-card-image {
    background: #0b1220;
}

html.dark .text-slate-900 {
    color: #f8fafc !important;
}

html.dark .text-slate-800 {
    color: #f1f5f9 !important;
}

html.dark .text-slate-700 {
    color: #e2e8f0 !important;
}

html.dark .text-slate-600 {
    color: #cbd5e1 !important;
}

html.dark .text-slate-500 {
    color: #94a3b8 !important;
}

html.dark .text-slate-400 {
    color: #94a3b8 !important;
}

html.dark .bg-white {
    background-color: #0f172a !important;
}

html.dark .bg-slate-50 {
    background-color: rgba(15, 23, 42, .55) !important;
}

html.dark .border-slate-200 {
    border-color: rgba(148, 163, 184, .18) !important;
}

html.dark input,
html.dark textarea,
html.dark select {
    background: #0b1220 !important;
    border-color: rgba(148, 163, 184, .22) !important;
    color: #e5e7eb !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

html.dark .btn-secondary {
    background: #0b1220;
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, .22);
}

html.dark .btn-secondary:hover {
    background: #111827;
}

html.dark #cart-items> :not([hidden])~ :not([hidden]) {
    border-top-color: rgba(148, 163, 184, .16) !important;
}

html.dark #qty-modal>div {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .18) !important;
}

html.dark #payment-toggle {
    background: #0b1220;
    border-color: rgba(148, 163, 184, .18);
}

html.dark .pay-btn {
    background: rgba(30, 41, 59, .7);
    color: #cbd5e1;
}

html.dark .pay-btn:hover {
    background: rgba(30, 41, 59, .95);
}

html.dark #chatbot-panel {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, .18) !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55) !important;
}

html.dark #chatbot-panel .bg-slate-50 {
    background: rgba(15, 23, 42, .65) !important;
}

html.dark #chatbot-panel .border-slate-200 {
    border-color: rgba(148, 163, 184, .18) !important;
}

html.dark #chatbot-panel .chatbot-messages .bg-white {
    background: rgba(30, 41, 59, .85) !important;
    border-color: rgba(148, 163, 184, .18) !important;
}

html.dark #chatbot-input {
    background: #0b1220 !important;
    color: #e5e7eb !important;
}

html.dark #chatbot-input::placeholder {
    color: #94a3b8 !important;
}

html.dark ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .35);
}

/* =========================
   CHATBOT SUGGEST FIX (LIGHT MODE)
   ========================= */

/* Wrapper */
#chatbot-panel .chatbot-suggest {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e5e7eb !important;
    font-weight: 500;
}

/* Hover */
#chatbot-panel .chatbot-suggest:hover {
    background: #f8fafc !important;
    border-color: #c7d2fe !important;
    color: #1e3a8a !important;
}

/* Focus / active */
#chatbot-panel .chatbot-suggest:active {
    transform: translateY(1px);
}

/* =========================
   DARK MODE – tetap konsisten
   ========================= */
html.dark #chatbot-panel .chatbot-suggest {
    background: rgba(30, 41, 59, .85) !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, .22) !important;
}

html.dark #chatbot-panel .chatbot-suggest:hover {
    background: rgba(30, 41, 59, 1) !important;
    color: #ffffff !important;
}

/* =========================
   CART ITEM (CLEAN & MODERN)
   ========================= */

.cart-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
}

.cart-item-left {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 0;
}

.cart-thumb {
    width: 56px;
    height: 56px;
    border-radius: .75rem;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.cart-info {
    min-width: 0;
}

.cart-name {
    font-size: .9rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
}

.cart-variant {
    font-size: .7rem;
    color: #64748b;
}

.cart-qty-price {
    font-size: .7rem;
    color: #64748b;
    margin-top: .15rem;
}

.cart-item-right {
    text-align: right;
    flex-shrink: 0;
}

.cart-subtotal {
    font-size: .85rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: .35rem;
}

/* ===== DELETE BUTTON (RED BOX) ===== */
.cart-remove-btn {
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: .6rem;
    padding: .25rem .6rem;
    font-size: .7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

.cart-remove-btn:hover {
    background: #b91c1c;
    box-shadow: 0 6px 16px rgba(220, 38, 38, .35);
}

.cart-remove-btn:active {
    transform: translateY(1px);
}

/* ===== DARK MODE ===== */
html.dark .cart-name,
html.dark .cart-subtotal {
    color: #f8fafc;
}

html.dark .cart-variant,
html.dark .cart-qty-price {
    color: #94a3b8;
}

html.dark .cart-thumb {
    background: #0b1220;
}

html.dark .cart-remove-btn {
    background: #ef4444;
}

html.dark .cart-remove-btn:hover {
    background: #dc2626;
}

/* ===== QTY CONTROL (DRAWER) ===== */
.cart-qty-control {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .35rem;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border-radius: .5rem;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.qty-btn:hover {
    background: #e2e8f0;
}

.qty-value {
    min-width: 18px;
    text-align: center;
    font-size: .8rem;
    font-weight: 600;
}

/* DARK MODE */
html.dark .qty-btn {
    background: rgba(30,41,59,.8);
    border-color: rgba(148,163,184,.25);
    color: #fff;
}

/* =========================
   CHECKOUT DARK MODE FIX
   ========================= */

/* ===== Page base ===== */
html.dark body {
    background: radial-gradient(circle at 30% 0%, #0b1220, #020617) !important;
}

/* ===== Header ===== */
html.dark header {
    background: rgba(2, 6, 23, 0.85) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148,163,184,.12);
}

/* ===== Card (Checkout Sections) ===== */
html.dark .card {
    background: linear-gradient(
        180deg,
        rgba(15,23,42,.92),
        rgba(2,6,23,.92)
    ) !important;
    border: 1px solid rgba(148,163,184,.12);
    box-shadow: 0 25px 60px rgba(0,0,0,.6);
}

/* ===== Section titles ===== */
html.dark h2,
html.dark h3 {
    color: #f8fafc;
}

/* ===== Cart item divider ===== */
html.dark .cart-item {
    border-bottom: 1px solid rgba(148,163,184,.15) !important;
}

/* ===== Cart text ===== */
html.dark .cart-item .font-semibold {
    color: #f8fafc;
}

html.dark .cart-item .text-slate-500 {
    color: #94a3b8 !important;
}

/* ===== Cart thumbnail ===== */
html.dark .cart-thumb {
    background: #020617;
    box-shadow: inset 0 0 0 1px rgba(148,163,184,.12);
}

/* ===== Qty buttons ===== */
html.dark .qty-btn {
    background: rgba(30,41,59,.75);
    border-color: rgba(148,163,184,.25);
    color: #f8fafc;
}

html.dark .qty-btn:hover {
    background: rgba(30,41,59,1);
}

/* ===== Remove button ===== */
html.dark .remove-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 20px rgba(239,68,68,.35);
}

/* ===== TOTAL BAR ===== */
html.dark .bg-orange-50 {
    background: linear-gradient(
        135deg,
        rgba(249,115,22,.18),
        rgba(249,115,22,.08)
    ) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(249,115,22,.35);
}

/* ===== Badge item count ===== */
html.dark #item-count {
    background: rgba(249,115,22,.18) !important;
    color: #fdba74 !important;
}

/* ===== Recommendation cards ===== */
html.dark button.bg-white {
    background: rgba(15,23,42,.9) !important;
    border-color: rgba(148,163,184,.18);
}

html.dark button.bg-white:hover {
    background: rgba(30,41,59,.9) !important;
}

/* ===== Form inputs ===== */
html.dark input,
html.dark textarea {
    background: #020617 !important;
    border-color: rgba(148,163,184,.25) !important;
    color: #f8fafc !important;
}

html.dark input:focus,
html.dark textarea:focus {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 2px rgba(249,115,22,.35);
}

/* ===== Form alert ===== */
html.dark #form-alert {
    background: rgba(127,29,29,.25) !important;
    border-color: rgba(239,68,68,.45) !important;
    color: #fecaca !important;
}

/* ===== WhatsApp button ===== */
html.dark .btn-primary {
    box-shadow: 0 20px 45px rgba(249,115,22,.45);
}

/* ===== Scrollbar ===== */
html.dark ::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.25);
}

/* ===============================
   FIX CHATBOT MOBILE (CANNOT CLOSE)
   =============================== */

/* Batasi tinggi chatbot di mobile */
@media (max-width: 480px) {
  #chatbot-panel {
    max-height: calc(80vh - 6.5rem);
  }
}

/* Header chatbot selalu terlihat (tombol ❌ aman) */
#chatbot-panel > div:first-child {
  position: sticky;
  top: 0;
  z-index: 10;
}


/* ===============================
   FADE IN ON SCROLL (GLOBAL)
   =============================== */


.fade-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform;
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

