/* ============================================================
   Kami's Bakery, modern homestead theme
   ============================================================ */

:root {
  /* Palette */
  --cream:        #faf6ee;
  --cream-deep:   #f3ece0;
  --parchment:    #f5efe2;
  --wheat:        #e3c79a;
  --gold:         #c9982f;
  --gold-deep:    #a87c1d;
  --sage:         #7f8c6a;
  --sage-deep:    #5f6b4d;
  --terracotta:   #c2683f;
  --ink:          #33291f;
  --ink-soft:     #5c4f41;
  --line:         #e6dcc8;
  --white:        #fffdf8;
  --shadow:       0 10px 30px -12px rgba(76, 58, 33, 0.28);
  --shadow-sm:    0 4px 14px -8px rgba(76, 58, 33, 0.35);
  --radius:       18px;
  --radius-sm:    11px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(201, 152, 47, 0.06), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(127, 140, 106, 0.08), transparent 40%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

a { color: var(--gold-deep); }

.wrap {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.2) blur(8px);
  background: rgba(250, 246, 238, 0.82);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--wheat), var(--gold));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 22px; height: 22px; }
.nav-cart {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--ink);
  color: var(--white);
  border: 0;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.nav-cart:hover { transform: translateY(-1px); background: #28201a; }
.nav-cart .count {
  background: var(--gold);
  color: var(--ink);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  padding: 0 6px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 78px 0 56px;
  text-align: center;
  position: relative;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--sage-deep);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold-deep);
}
.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 auto 28px;
}
.hero-cta {
  display: inline-flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--wheat); background: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* wheat divider */
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; color: var(--wheat); margin: 8px 0 0;
}
.divider::before, .divider::after {
  content: ""; height: 1px; width: 70px;
  background: linear-gradient(90deg, transparent, var(--wheat));
}
.divider::after { transform: scaleX(-1); }

/* ---------- Section headings ---------- */
.section { padding: 40px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.section-head p { color: var(--ink-soft); max-width: 56ch; margin: 0 auto; }

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .thumb {
  height: 150px;
  background: linear-gradient(150deg, var(--parchment), var(--wheat));
  display: grid; place-items: center;
  color: var(--gold-deep);
  position: relative;
}
.card .thumb svg { width: 64px; height: 64px; opacity: 0.85; }
.card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 1.4rem; margin: 0; }
.card .desc { color: var(--ink-soft); font-size: 0.95rem; margin: 0; flex: 1; }
.card .meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.card .price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.card .price small { font-family: var(--font-body); font-weight: 600; color: var(--ink-soft); font-size: 0.8rem; }
.tag {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 4px 10px; border-radius: 999px;
}
.tag-stock { background: rgba(127,140,106,0.16); color: var(--sage-deep); }
.tag-low    { background: rgba(194,104,63,0.16); color: var(--terracotta); }
.tag-out    { background: rgba(92,79,65,0.12); color: var(--ink-soft); }

/* qty stepper */
.stepper {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--line); border-radius: 999px;
  overflow: hidden; align-self: flex-start;
}
.stepper button {
  width: 38px; height: 38px; border: 0; background: var(--parchment);
  color: var(--ink); font-size: 1.2rem; cursor: pointer; line-height: 1;
  transition: background 0.12s ease;
}
.stepper button:hover:not(:disabled) { background: var(--wheat); }
.stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.stepper .val { min-width: 48px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper-note { font-size: 0.8rem; color: var(--ink-soft); }

.sold-out-card { opacity: 0.72; }
.sold-out-card .thumb { filter: grayscale(0.4); }

/* ---------- Disclosure banner ---------- */
.cottage {
  background: var(--sage-deep);
  color: #f3f1e6;
  border-radius: var(--radius);
  padding: 26px 30px;
  display: flex; gap: 18px; align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.cottage svg { width: 30px; height: 30px; flex: 0 0 auto; color: var(--wheat); margin-top: 2px; }
.cottage h3 { color: var(--white); font-size: 1.2rem; margin-bottom: 4px; }
.cottage p { margin: 0; color: #e8e6d7; font-size: 0.93rem; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 22px; }
.step {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 24px; text-align: center;
}
.step .num {
  width: 42px; height: 42px; margin: 0 auto 12px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--parchment); color: var(--gold-deep);
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
}
.step h4 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 6px; }
.step p { font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 50px; border-top: 1px solid var(--line);
  background: var(--parchment);
}
.footer .wrap { padding: 34px 0; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }
.footer .brand { justify-content: center; margin-bottom: 10px; }
.footer a { color: var(--ink-soft); }

/* ============================================================
   Cart drawer
   ============================================================ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(45,34,22,0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 40;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(440px, 100vw); background: var(--cream);
  box-shadow: -20px 0 50px -20px rgba(45,34,22,0.4);
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 50; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 22px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-head h2 { margin: 0; font-size: 1.5rem; }
.drawer-close {
  border: 0; background: var(--parchment); width: 38px; height: 38px;
  border-radius: 50%; cursor: pointer; font-size: 1.2rem; color: var(--ink);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-foot { padding: 20px 24px; border-top: 1px solid var(--line); background: var(--white); }

.cart-empty { text-align: center; color: var(--ink-soft); padding: 40px 10px; }
.cart-empty svg { width: 54px; height: 54px; opacity: 0.4; margin-bottom: 12px; }

.cart-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.cart-line .ico {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--parchment), var(--wheat));
  display: grid; place-items: center; color: var(--gold-deep);
}
.cart-line .ico svg { width: 26px; height: 26px; }
.cart-line .info { flex: 1; }
.cart-line .info strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.cart-line .info span { font-size: 0.85rem; color: var(--ink-soft); }
.cart-line .line-total { font-weight: 800; font-variant-numeric: tabular-nums; }

.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.cart-total .lbl { color: var(--ink-soft); }
.cart-total .amt { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }

/* form */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 5px; color: var(--ink); }
.field .req { color: var(--terracotta); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.95rem;
  background: var(--white); color: var(--ink); transition: border-color 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 64px; }
.field .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.field.err input, .field.err select { border-color: var(--terracotta); }

.pay-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--parchment); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 16px;
}
.pay-note svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--sage-deep); }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   Toast
   ============================================================ */
.toast-zone {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: center;
  width: min(460px, 92vw);
}
.toast {
  background: var(--ink); color: var(--white);
  border-radius: var(--radius-sm); padding: 16px 20px;
  box-shadow: var(--shadow); display: flex; gap: 13px; align-items: flex-start;
  width: 100%;
  animation: toast-in 0.35s cubic-bezier(.2,.8,.2,1);
}
.toast.leaving { animation: toast-out 0.3s ease forwards; }
.toast .t-ico {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--gold); color: var(--ink);
}
.toast .t-ico svg { width: 20px; height: 20px; }
.toast strong { display: block; font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 2px; }
.toast span { font-size: 0.88rem; color: #e8e2d6; }
.toast.error .t-ico { background: var(--terracotta); color: var(--white); }

@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* loading skeleton */
.skeleton {
  background: linear-gradient(100deg, var(--parchment) 30%, var(--cream-deep) 50%, var(--parchment) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-card { height: 330px; }

@media (max-width: 560px) {
  .hero { padding: 54px 0 40px; }
  .topbar .brand span.full { display: none; }
}
