/* ============================================================
   flo. Coffee Roastery — DESIGN SYSTEM
   ------------------------------------------------------------
   Minimalis murni:
   - Background  : #FFFFFF
   - Teks        : #000000
   - Aksen       : netral #F4F1EC (krem lembut untuk bidang)
   - Tipografi   : Fraunces (serif artisanal) + Inter (sans modern)
   - Whitespace  : sangat lega
   ============================================================ */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --cream: #f4f1ec;
  --cream-deep: #ebe6de;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --headline: "Poppins", "Inter", -apple-system, sans-serif;
  --subheadline: "Lato", "Inter", -apple-system, sans-serif;
  --radius: 2px;
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* PENTING: atribut [hidden] harus selalu menang, meski ada rule
   lain yang set display (mis. .form-group { display: flex }).
   Tanpa ini, elemen dengan hidden tetap terlihat! */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--headline);
  font-weight: 500;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
  margin-bottom: 20px;
}

.section-desc { color: var(--muted); max-width: 560px; font-size: 15px; }

/* ═══════════ HEADER ═══════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub {
  font-family: "Aileron", var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav { display: flex; gap: 32px; }
.site-nav a { font-size: 14px; color: var(--muted); transition: color .2s; }
.site-nav a:hover { color: var(--ink); }

.cart-btn {
  position: relative;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ═══════════ HERO ═══════════ */
.hero { padding: 72px 0 96px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}

.hero-title {
  font-family: var(--headline);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.18;
  margin-bottom: 24px;
}
.hero-title em { font-style: italic; }

.hero-desc {
  font-family: var(--subheadline);
  color: var(--muted);
  font-size: 16px;
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-media img { border-radius: var(--radius); }

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  transition: all .2s;
  text-align: center;
}
.btn-dark { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-dark:hover { background: #222; }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-outline { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--ink); }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ═══════════ COLLECTION ═══════════ */
.collection { padding: 96px 0; border-top: 1px solid var(--line); }

.section-head { margin-bottom: 56px; }
.section-head .section-desc { margin-top: 0; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 48px 32px;
}

/* ─── Product Card ─── */
.product-card {
  display: flex;
  flex-direction: column;
  animation: fadeUp .5s ease both;
}

.product-media {
  position: relative;
  background: var(--cream);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  margin-bottom: 20px;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.product-card:hover .product-media img { transform: scale(1.04); }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fff;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

/* Badge stok */
.stok-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255,255,255,0.95);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  color: var(--ink);
}
.stok-low { background: #fff8e6; color: #8a6100; }
.stok-habis { background: #f8d7da; color: #b00020; }

.pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
  border-color: var(--line);
  background: #f7f7f7;
  color: #999;
}
.pill:disabled:hover { border-color: var(--line); }

.product-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--muted);
}
.product-add:disabled::after { display: none; }

.product-body { padding: 4px 2px; }

.product-name {
  font-family: var(--headline);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.25;
  margin-bottom: 4px;
}
.product-region { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; margin-bottom: 12px; }

.product-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.note-chip {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

/* Opsi kemasan (pill) */
.field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 8px;
}

.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  border-radius: 999px;
  transition: all .18s;
  color: var(--ink);
}
.pill:hover { border-color: var(--ink); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Select gilingan */
.select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6b6b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select:focus { outline: 1px solid var(--ink); }

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.product-price { font-family: var(--headline); font-size: 19px; font-weight: 500; }
.product-add { background: none; border: none; font-size: 13px; font-weight: 500; letter-spacing: 0.02em; padding: 8px 0; position: relative; }
.product-add::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.product-add:hover::after { transform: scaleX(1); }

/* ═══════════ ABOUT ═══════════ */
.about { padding: 96px 0; background: var(--cream); }
.about-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 64px;
  align-items: center;
}
.about-text p { color: var(--muted); margin-bottom: 20px; max-width: 520px; }
.about-list { list-style: none; margin-top: 24px; }
.about-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  color: #333;
}
.about-list li strong { color: var(--ink); font-weight: 600; }
.about-list li:last-child { border-bottom: none; }

.stamp-box {
  border: 1px solid var(--ink);
  padding: 56px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  background: #fff;
}
.stamp-name { font-family: var(--serif); font-size: 44px; }
.stamp-line { font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; }
.stamp-sub { font-size: 12.5px; color: var(--muted); font-style: italic; font-family: var(--serif); line-height: 1.6; }

/* ═══════════ CONTACT ═══════════ */
.contact { padding: 96px 0; }
.contact-inner { max-width: 720px; }
.contact-card p { color: var(--muted); margin-bottom: 28px; }
.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-links a {
  font-size: 15px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  transition: border-color .2s;
  width: fit-content;
}
.contact-links a:hover { border-color: var(--ink); }

/* ═══════════ FOOTER ═══════════ */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

/* ═══════════ MODAL / CHECKOUT ═══════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 640px;
  border-radius: 4px;
  animation: slideUp .3s ease both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-family: var(--headline); font-size: 22px; font-weight: 500; }
.modal-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 28px; }

/* Cart item */
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius); background: var(--cream); }
.cart-item-name { font-family: var(--headline); font-size: 16px; font-weight: 500; }
.cart-item-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cart-item-right { text-align: right; }
.cart-item-price { font-size: 14.5px; font-weight: 600; font-family: var(--headline); }
.qty-control { display: flex; align-items: center; gap: 10px; margin-top: 8px; justify-content: flex-end; }
.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 50%;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { border-color: var(--ink); }

.cart-summary { padding: 20px 0; border-bottom: 1px solid var(--line); }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: var(--muted); }
.sum-row.total { color: var(--ink); font-weight: 600; font-size: 16px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; letter-spacing: 0.06em; color: var(--ink); font-weight: 500; }
.form-group label .req { color: #b00020; }
.form-group input, .form-group select, .form-group textarea {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 1px solid var(--ink);
}
.form-group input:disabled, .form-group select:disabled { background: #f7f7f7; color: #aaa; }
.form-group .hint { font-size: 11.5px; color: var(--muted); }
.conn-badge {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.conn-live { background: #e8f5e9; color: #1b7a2e; }
.conn-offline { background: #fff3e0; color: #a85d00; }

/* Steps indicator */
.steps { display: flex; gap: 8px; margin-bottom: 28px; }
.step {
  flex: 1;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.step.active { color: var(--ink); border-color: var(--ink); font-weight: 600; }

/* Shipping result */
.shipping-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  font-size: 14px;
}
.shipping-result .ship-courier { font-weight: 600; }
.shipping-result .ship-cost { font-family: var(--headline); font-size: 18px; font-weight: 500; margin-top: 4px; }
.shipping-loading { font-size: 13px; color: var(--muted); margin-top: 12px; }
.shipping-loading .spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.ship-warning {
  background: #fff8e6;
  border: 1px solid #f0d98c;
  color: #7a5c00;
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  line-height: 1.5;
}
.ship-warning code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }

.ship-result-title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 10px;
}

.ship-options { display: flex; flex-direction: column; gap: 8px; }
.ship-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.ship-option:hover { border-color: #aaa; }
.ship-option.selected { border-color: var(--ink); background: #fafafa; }
.ship-option input { margin-top: 3px; accent-color: var(--ink); }
.ship-option-body { flex: 1; }
.ship-option-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ship-option-head strong { font-size: 14px; font-weight: 600; }
.ship-option-cost { font-family: var(--headline); font-size: 16px; font-weight: 500; white-space: nowrap; }
.ship-option-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Autocomplete destination */
.autocomplete { position: relative; }
.ac-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-top: none;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
}
.ac-item:first-of-type { border-top: 1px solid var(--line); }
.ac-item:hover { background: var(--cream); }
.ac-item strong { font-weight: 600; color: var(--ink); }
.ac-item span { color: var(--muted); font-size: 12px; }
.ac-loading { color: var(--muted); font-style: italic; cursor: default; }
.ac-loading:hover { background: #fff; }
.ac-empty { color: #b00020; font-size: 12.5px; cursor: default; }
.ac-empty:hover { background: #fff; }

/* ═══════════ PAYMENT (QRIS) ═══════════ */
.payment-wrap { text-align: center; }
.payment-amount { font-family: var(--headline); font-size: 34px; font-weight: 500; margin: 8px 0 4px; }
.payment-code {
  font-size: 13px;
  color: var(--muted);
  background: var(--cream);
  padding: 8px 16px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 20px;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
}
.qris-box {
  width: 240px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  padding: 14px;
  background: #fff;
}
.qris-box img { width: 100%; }
.qris-note { font-size: 13px; color: var(--muted); max-width: 420px; margin: 0 auto 8px; line-height: 1.65; }
.qris-note strong { color: var(--ink); }
.payment-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ═══════════ TOAST ═══════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 200;
  animation: fadeUp .3s ease both;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}
.toast[hidden] { display: none; }

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
  .hero-inner, .about-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 48px 0 64px; }
  .hero-media { order: -1; }
  .site-nav { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .collection, .about, .contact { padding: 64px 0; }
}
