/* ==========================================================================
   Orgamelt — Design Tokens
   Palette drawn from the brand mark: deep maroon ground, aged-gold type,
   olive-green palm, oxblood date fruit.
   ========================================================================== */

:root {
  --maroon-950: #2b0509;
  --maroon-900: #3d0a10;
  --maroon-800: #4f0f16;
  --maroon-700: #6b1620;
  --gold-300: #ecd48f;
  --gold-400: #d9b968;
  --gold-500: #c39a44;
  --gold-600: #a37e33;
  --olive-600: #6b7a3f;
  --oxblood-500: #7a1f22;
  --ivory-050: #faf6ee;
  --ivory-100: #f3ecdb;
  --ink-900: #221512;
  --line-on-dark: rgba(236, 212, 143, 0.22);
  --line-on-light: rgba(43, 5, 9, 0.12);

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Jost", "Segoe UI", sans-serif;

  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory-050);
  color: var(--ink-900);
  font-family: var(--font-body);
  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; }

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

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 2px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14.5px;
  letter-spacing: 0.03em;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  color: var(--maroon-950);
  font-weight: 500;
}
.btn-gold:hover { background: var(--gold-300); }
.btn-outline-light {
  border-color: var(--line-on-dark);
  color: var(--gold-300);
  background: transparent;
}
.btn-outline-light:hover { border-color: var(--gold-400); background: rgba(236,212,143,0.06); }
.btn-outline-dark {
  border-color: var(--line-on-light);
  color: var(--maroon-900);
}
.btn-outline-dark:hover { border-color: var(--maroon-800); background: rgba(43,5,9,0.04); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- Site header ---------- */
.site-header {
  background: var(--maroon-950);
  color: var(--ivory-100);
  border-bottom: 1px solid var(--line-on-dark);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 25px;
  color: var(--gold-300);
  letter-spacing: 0.02em;
}
.brand .mark { font-size: 21px; line-height: 1; transform: translateY(-1px); }
.brand small {
  display: block;
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--gold-500);
  margin-top: 2px;
}
.main-nav { display: flex; align-items: center; gap: 34px; }
.main-nav a {
  font-size: 14px;
  color: var(--ivory-100);
  opacity: 0.86;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.main-nav a:hover, .main-nav a.active { opacity: 1; border-color: var(--gold-500); }
.header-actions { display: flex; align-items: center; gap: 18px; }
.cart-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-on-dark);
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--gold-300);
}
.cart-pill .count {
  background: var(--gold-400);
  color: var(--maroon-950);
  min-width: 19px;
  height: 19px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.nav-toggle { display: none; background: none; border: none; color: var(--gold-300); font-size: 24px; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(120% 140% at 50% 0%, var(--maroon-800) 0%, var(--maroon-950) 62%);
  color: var(--ivory-100);
  padding: 96px 0 84px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  top: -40px;
  width: 340px;
  height: 340px;
  border: 1px solid var(--line-on-dark);
  border-radius: 50%;
}
.hero::before { left: -160px; }
.hero::after { right: -160px; }
.hero .eyebrow {
  color: var(--gold-500);
  font-size: 13px;
  letter-spacing: 0.28em;
  margin-bottom: 22px;
  position: relative;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  color: var(--ivory-100);
  max-width: 780px;
  margin: 0 auto 22px;
  line-height: 1.08;
  position: relative;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold-300);
}
.hero p.lede {
  max-width: 520px;
  margin: 0 auto 36px;
  color: rgba(243,236,219,0.78);
  font-size: 17px;
  position: relative;
}
.hero .hero-actions { display: flex; gap: 16px; justify-content: center; position: relative; }
.hero-divider {
  width: 1px;
  height: 54px;
  background: linear-gradient(var(--gold-500), transparent);
  margin: 0 auto 30px;
  position: relative;
}

/* ---------- Section shell ---------- */
.section { padding: 84px 0; }
.section-dark { background: var(--maroon-950); color: var(--ivory-100); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 44px;
  gap: 20px;
}
.section-head .eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.24em;
  color: var(--gold-600);
  margin-bottom: 10px;
  display: block;
}
.section-dark .section-head .eyebrow { color: var(--gold-400); }
.section-head h2 { font-size: 36px; margin: 0; }
.section-head p { max-width: 380px; color: rgba(34,21,18,0.62); font-size: 15px; margin: 0; }
.section-dark .section-head p { color: rgba(243,236,219,0.66); }
.section-foot { text-align: center; margin-top: 46px; }

/* ---------- Product grid ---------- */
.grid-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
@media (max-width: 900px) { .grid-products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-products { grid-template-columns: 1fr; } }

.card-product {
  background: var(--ivory-050);
  border: 1px solid var(--line-on-light);
  display: flex;
  flex-direction: column;
}
.card-media {
  aspect-ratio: 1 / 1;
  background: linear-gradient(155deg, var(--maroon-800), var(--maroon-950));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .glyph { font-size: 56px; opacity: 0.92; }
.card-media .tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--gold-400);
  color: var(--maroon-950);
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 5px 11px;
}
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body .cat { font-size: 11.5px; letter-spacing: 0.14em; color: var(--gold-600); }
.card-body h3 { font-size: 21px; margin: 0; }
.card-body p.desc { font-size: 13.8px; color: rgba(34,21,18,0.62); margin: 0; flex: 1; }
.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.price { font-family: var(--font-display); font-size: 22px; color: var(--maroon-800); }
.price .unit { font-family: var(--font-body); font-size: 11.5px; color: rgba(34,21,18,0.5); margin-left: 4px; }
.qty-add { display: flex; align-items: center; gap: 10px; }
.qty-stepper { display: flex; align-items: center; border: 1px solid var(--line-on-light); }
.qty-stepper button { background: none; border: none; width: 30px; height: 34px; font-size: 15px; }
.qty-stepper span { min-width: 26px; text-align: center; font-size: 14px; }

/* ---------- About / story split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 34px; } }
.split .art {
  aspect-ratio: 4/5;
  background: radial-gradient(120% 120% at 30% 10%, var(--maroon-700), var(--maroon-950));
  border: 1px solid var(--line-on-dark);
  display: flex; align-items: center; justify-content: center;
}
.split .art span { font-size: 90px; }
.split .kicker { color: var(--gold-600); font-size: 12.5px; letter-spacing: 0.22em; display:block; margin-bottom: 14px; }
.split h2 { font-size: 34px; }
.split p { color: rgba(34,21,18,0.68); font-size: 15.5px; margin-bottom: 16px; }
.value-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.value-list li { display: flex; gap: 12px; font-size: 14.5px; align-items: flex-start; }
.value-list .dot { color: var(--gold-600); font-size: 18px; line-height: 1.2; }

/* ---------- Trust strip ---------- */
.strip {
  border-top: 1px solid var(--line-on-light);
  border-bottom: 1px solid var(--line-on-light);
  padding: 34px 0;
}
.strip .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.strip .item { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--maroon-900); }
.strip .item .num { font-family: var(--font-display); font-size: 26px; color: var(--gold-600); }

/* ---------- Footer ---------- */
.site-footer { background: var(--maroon-950); color: rgba(243,236,219,0.72); padding: 62px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 40px; margin-bottom: 46px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: var(--gold-300); font-size: 13px; letter-spacing: 0.12em; font-family: var(--font-body); margin-bottom: 16px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 13.8px; }
.footer-grid ul a:hover { color: var(--gold-300); }
.footer-brand .brand { color: var(--gold-300); margin-bottom: 12px; }
.footer-brand p { font-size: 13.8px; max-width: 260px; color: rgba(243,236,219,0.6); }
.footer-bottom {
  border-top: 1px solid var(--line-on-dark);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: rgba(243,236,219,0.5);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Generic page header (Shop / Cart / Checkout / Admin) ---------- */
.page-head {
  background: var(--maroon-950);
  color: var(--ivory-100);
  padding: 54px 0 46px;
  text-align: center;
}
.page-head .eyebrow { color: var(--gold-500); font-size: 12.5px; letter-spacing: 0.24em; display:block; margin-bottom: 12px; }
.page-head h1 { font-size: 40px; margin: 0; color: var(--ivory-100); }

/* ---------- Shop filters ---------- */
.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.filter-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-pills button {
  background: none;
  border: 1px solid var(--line-on-light);
  padding: 8px 18px;
  font-size: 13px;
  color: var(--maroon-900);
}
.filter-pills button.active { background: var(--maroon-950); color: var(--gold-300); border-color: var(--maroon-950); }
.result-count { font-size: 13px; color: rgba(34,21,18,0.55); }

/* ---------- Cart page ---------- */
.cart-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 46px; align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-lines { border-top: 1px solid var(--line-on-light); }
.cart-line {
  display: grid;
  grid-template-columns: 84px 1fr auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-on-light);
}
.cart-line .thumb {
  width: 84px; height: 84px;
  background: linear-gradient(155deg, var(--maroon-800), var(--maroon-950));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.cart-line h4 { margin: 0 0 4px; font-size: 17px; }
.cart-line .cat { font-size: 12px; color: rgba(34,21,18,0.5); }
.cart-line .remove { font-size: 12.5px; color: var(--oxblood-500); background: none; border: none; padding: 0; margin-top: 6px; }
.summary-card {
  border: 1px solid var(--line-on-light);
  padding: 28px;
  background: var(--ivory-050);
}
.summary-card h3 { font-size: 19px; margin-bottom: 18px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14.5px; padding: 9px 0; }
.summary-row.total { border-top: 1px solid var(--line-on-light); margin-top: 8px; padding-top: 16px; font-size: 17px; font-family: var(--font-display); }
.empty-state { text-align: center; padding: 70px 0; color: rgba(34,21,18,0.55); }
.empty-state .glyph { font-size: 48px; display: block; margin-bottom: 16px; }

/* ---------- Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 46px; align-items: start; }
@media (max-width: 860px) { .checkout-layout { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; margin-bottom: 7px; color: var(--maroon-900); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-on-light);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  background: #fff;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.pay-options { display: grid; gap: 10px; margin-bottom: 22px; }
.pay-option {
  border: 1px solid var(--line-on-light);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.pay-option input { width: auto; }
.order-review { border: 1px solid var(--line-on-light); padding: 24px; }
.order-review .li { display: flex; justify-content: space-between; font-size: 13.8px; padding: 8px 0; border-bottom: 1px dashed var(--line-on-light); }

/* ---------- Admin ---------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 78px); }
@media (max-width: 780px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side { background: var(--maroon-950); color: var(--ivory-100); padding: 30px 20px; }
.admin-side .grp-label { font-size: 11px; letter-spacing: 0.14em; color: var(--gold-600); margin: 20px 0 10px; }
.admin-side a { display: block; padding: 10px 12px; font-size: 14px; border-left: 2px solid transparent; opacity: 0.82; }
.admin-side a.active, .admin-side a:hover { opacity: 1; border-color: var(--gold-400); background: rgba(236,212,143,0.06); }
.admin-main { padding: 36px 40px; background: var(--ivory-100); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.admin-header h1 { font-size: 26px; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 32px; }
@media (max-width: 780px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.stat-card { background: #fff; border: 1px solid var(--line-on-light); padding: 20px; }
.stat-card .label { font-size: 12px; color: rgba(34,21,18,0.55); margin-bottom: 8px; }
.stat-card .value { font-family: var(--font-display); font-size: 30px; color: var(--maroon-900); }
.stat-card .value.gold { color: var(--gold-600); }
.panel { background: #fff; border: 1px solid var(--line-on-light); margin-bottom: 26px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-on-light); }
.panel-head h3 { margin: 0; font-size: 17px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 11.5px; letter-spacing: 0.06em; color: rgba(34,21,18,0.5); padding: 12px 22px; border-bottom: 1px solid var(--line-on-light); }
table.data td { padding: 14px 22px; font-size: 13.8px; border-bottom: 1px solid var(--line-on-light); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 4px 11px; font-size: 11.5px; border-radius: 2px; }
.badge-pending { background: rgba(195,154,68,0.16); color: var(--gold-600); }
.badge-progress { background: rgba(107,122,63,0.18); color: var(--olive-600); }
.badge-complete { background: rgba(107,122,63,0.28); color: #3c4a1c; }
.badge-cancelled { background: rgba(122,31,34,0.14); color: var(--oxblood-500); }
.row-actions { display: flex; gap: 8px; }
.row-actions select, .row-actions button, .row-actions a {
  font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--line-on-light); background: #fff;
}
.icon-btn { background: none; border: none; font-size: 15px; padding: 4px 6px; }
.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--maroon-950); }
.admin-login-card { background: var(--ivory-050); padding: 44px; width: 360px; text-align: center; }
.admin-login-card .brand { justify-content: center; color: var(--maroon-900); margin-bottom: 6px; }
.admin-login-card p { font-size: 13px; color: rgba(34,21,18,0.55); margin-bottom: 26px; }
.form-modal-backdrop {
  position: fixed; inset: 0; background: rgba(43,5,9,0.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 60px 20px; overflow-y: auto; z-index: 60;
}
.form-modal-backdrop.open { display: flex; }
.form-modal {
  background: #fff; width: 100%; max-width: 520px; padding: 30px;
}
.form-modal h3 { margin-bottom: 20px; }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.toast {
  position: fixed; bottom: 26px; right: 26px; background: var(--maroon-950); color: var(--gold-300);
  padding: 14px 22px; font-size: 13.5px; border: 1px solid var(--line-on-dark);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 80;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ---------- Editable content hooks (Phase-1 self-editing) ---------- */
[data-editable] { outline: 1px dashed transparent; transition: outline-color 0.15s; }
body.edit-mode [data-editable] { outline-color: rgba(195,154,68,0.5); cursor: text; }
body.edit-mode [data-editable]:hover { outline-color: var(--gold-500); background: rgba(236,212,143,0.08); }
.edit-mode-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--maroon-950); color: var(--gold-300);
  padding: 12px 24px; display: none; align-items: center; justify-content: space-between; z-index: 70;
  font-size: 13.5px; border-top: 1px solid var(--line-on-dark);
}
.edit-mode-bar.show { display: flex; }

.mobile-nav {
  display: none; flex-direction: column; background: var(--maroon-950); border-top: 1px solid var(--line-on-dark);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 14px 28px; color: var(--ivory-100); border-bottom: 1px solid var(--line-on-dark); font-size: 14.5px; }
