/* ═══════════════════════════════════════════════════
   GLOBAL BASE — dipindah dari inline <style> di head.php (19 Sep 2026)
   Sebelumnya ditulis inline di <head> tiap halaman, jadi browser
   download ulang teks yang sama persis tiap kali user pindah halaman
   (Home -> Shop -> Produk -> dst) karena inline HTML gak bisa di-cache
   lintas halaman. Sekarang jadi file terpisah -> ke-cache browser,
   cuma didownload sekali di kunjungan pertama.
   ═══════════════════════════════════════════════════ */

:root {
  /* Warna utama */
  --clr-forest: #1b4332; /* hijau tua — brand */
  --clr-sage: #52796f; /* hijau medium */
  --clr-mint: #d8f3dc; /* hijau muda */
  --clr-cream: #faf8f4; /* background utama */
  --clr-warm: #f4f1ea; /* background section alt */
  --clr-sand: #e8e0d0; /* border/divider */
  --clr-ink: #1a1a1a; /* teks utama */
  --clr-muted: #6b7280; /* teks sekunder */
  --clr-gold: #b5924c; /* aksen premium */

  /* Tipografi — full sans-serif, tanpa dekorasi (kebijakan 24 Jul 2026)
       --font-display : dominan. Dipakai untuk heading, harga, tombol, label,
                         UI singkat — apa pun yang bukan paragraf panjang.
       --font-body    : teks panjang. Dipakai untuk deskripsi produk, isi
                         artikel, kebijakan, dan blok teks yang perlu
                         dicerna lama supaya tetap nyaman dibaca. */
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  /* Spacing */
  --section-py: 7rem;
  --container-px: 2rem;

  /* Transisi */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.2s;
  --dur-mid: 0.4s;
  --dur-slow: 0.7s;
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  overscroll-behavior-x: none;
  position: relative;
  width: 100%;
  max-width: 100vw;
}
.page-content {
  overflow-x: hidden;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════
   TIPOGRAFI GLOBAL
   ═══════════════════════════════════════════════════ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--clr-ink);
}

/* Display — untuk hero dan section headline besar.
   NOTE: nama class "display-serif" dipertahankan apa adanya supaya tidak
   perlu cari-ganti di semua view yang sudah pakai class ini — tapi
   font-nya sudah bukan serif lagi (lihat --font-display di atas). */
.display-serif {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Eyebrow — label kecil di atas heading */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-sage);
}

/* ═══════════════════════════════════════════════════
   ICON SVG INLINE — pengganti Bootstrap Icons font
   Dipakai oleh helper icon() di app/Helpers/icon_helper.php
   ═══════════════════════════════════════════════════ */
.bi-icon {
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   TOMBOL GLOBAL
   ═══════════════════════════════════════════════════ */
.btn-primary-aw {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  background: var(--clr-forest);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.btn-primary-aw:hover {
  background: var(--clr-sage);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-aw {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: transparent;
  color: var(--clr-forest);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--clr-forest);
  border-radius: 0;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.btn-outline-aw:hover {
  background: var(--clr-forest);
  color: #fff;
}

/* Bootstrap override untuk btn-cart */
.btn-cart {
  background-color: var(--clr-forest);
  border-color: var(--clr-forest);
  color: #fff;
  border-radius: 0;
}
.btn-cart:hover {
  background-color: var(--clr-sage);
  border-color: var(--clr-sage);
  color: #fff;
}

/* ═══════════════════════════════════════════════════
   DIVIDER — garis dekoratif tipis
   ═══════════════════════════════════════════════════ */
.divider-line {
  width: 40px;
  height: 1px;
  background: var(--clr-gold);
  margin: 1.25rem auto;
}
.divider-line.left {
  margin-left: 0;
}

/* ═══════════════════════════════════════════════════
   SCROLL REVEAL — animasi masuk viewport
   ═══════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 {
  transition-delay: 0.1s;
}
.reveal-delay-2 {
  transition-delay: 0.2s;
}
.reveal-delay-3 {
  transition-delay: 0.3s;
}
.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* ═══════════════════════════════════════════════════
   CART DRAWER
   ═══════════════════════════════════════════════════ */
#cartOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s var(--ease-out),
    visibility 0.3s var(--ease-out);
}
#cartOverlay.show {
  opacity: 1;
  visibility: visible;
}

#cartDrawer {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease-out);
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.1);
  will-change: transform;
}
#cartDrawer.open {
  transform: translateX(0);
}

#cartDrawer .drawer-header {
  border-bottom: 2px solid #d4af6a;
}

@media (max-width: 480px) {
  #cartDrawer {
    width: 100%;
    max-width: 100vw;
  }
  .drawer-header {
    padding-left: 18px;
    padding-right: 18px;
  }
  .drawer-body {
    padding: 16px 18px;
  }
  .cart-item-img-placeholder {
    width: 68px;
    height: 68px;
  }
  .qty-btn {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .drawer-close {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
}

.drawer-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--clr-sand);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
}
.drawer-body {
  flex: 1;
  min-height: 0; /* WAJIB: tanpa ini flexbox bisa gagal nyusut & drawer-footer ke-dorong keluar layar */
  overflow-y: auto;
  padding: 20px 24px;
}
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--clr-sand);
  flex-shrink: 0;
  background: #fff;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.cart-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--clr-sand);
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item-img-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  background: var(--clr-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #adb5bd;
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  margin: -8px -8px 0 0;
  align-self: flex-start;
  transition: color 0.2s;
}
.cart-item-remove:hover {
  color: #dc3545;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--clr-sand);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--dur-fast);
}
.qty-btn:hover {
  background: var(--clr-warm);
}
.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--clr-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background var(--dur-fast);
}
.drawer-close:hover {
  background: var(--clr-sand);
}

@media (prefers-reduced-motion: reduce) {
  #cartOverlay,
  #cartDrawer {
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════
   MODAL LOGIN
   ═══════════════════════════════════════════════════ */
.modal-content {
  border-radius: 0;
  border: none;
}
.btn-login-modal {
  background-color: var(--clr-forest);
  border-color: var(--clr-forest);
  color: #fff;
  border-radius: 0;
}
.btn-login-modal:hover {
  background-color: var(--clr-sage);
  border-color: var(--clr-sage);
  color: #fff;
}

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */
.toast-notif {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  right: 28px;
  z-index: 9999;
  min-width: 260px;
}

@media (max-width: 900px) {
  /* Digeser ke atas dikit di mobile biar gak numpuk sama bottom nav */
  .toast-notif {
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    left: 16px;
    min-width: 0;
  }
}

/* ═══════════════════════════════════════════════════
   SEARCH INPUT
   ═══════════════════════════════════════════════════ */
#navSearchInput::placeholder {
  color: rgba(255, 255, 255, 0.65) !important;
}
#navSearchInput {
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════ */
.footer-link {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color var(--dur-fast);
}
.footer-link:hover {
  color: #fff;
}

.footer-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════
   RECOMMENDATION CARDS (drawer)
   ═══════════════════════════════════════════════════ */
.rec-card {
  border: 1px solid var(--clr-sand);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--dur-fast),
    box-shadow var(--dur-fast);
}
.rec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.rec-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.rec-card .rec-body {
  padding: 6px 8px 8px;
}
.rec-card .rec-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}
.rec-card .rec-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-forest);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════
   FORM ELEMENTS GLOBAL
   ══════════════════════════════════════════════════ */
.form-control:focus,
.form-select:focus {
  border-color: var(--clr-sage);
  box-shadow: 0 0 0 3px rgba(82, 121, 111, 0.12);
}

/* Cegah auto-zoom Safari iOS di SEMUA form-control/form-select global
   (Bootstrap default sebenarnya sudah 16px/1rem, tapi dikunci eksplisit
   di sini khusus mobile untuk jaga-jaga ada override di halaman lain). */
@media (max-width: 900px) {
  .form-control,
  .form-select,
  textarea.form-control {
    font-size: 16px;
  }
}

/* ═══════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════ */
.text-forest {
  color: var(--clr-forest);
}
.text-sage {
  color: var(--clr-sage);
}
.text-gold {
  color: var(--clr-gold);
}
.bg-cream {
  background-color: var(--clr-cream);
}
.bg-warm {
  background-color: var(--clr-warm);
}
.bg-forest {
  background-color: var(--clr-forest);
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
