/* ============================================================
   The Thirsty Nomad — Ecommerce Design System
   Brand palette & rules from BRAND_RULES.md
   ============================================================ */

:root {
  /* Brand palette */
  --green:        #0b6b5d;
  --green-dark:   #095448;
  --green-deep:   #073f37;
  --ink:          #182523;
  --teal:         #5bc0c9;
  --blue:         #1d6f98;
  --lime:         #b8d45a;
  --paper:        #f7faf7;
  --border:       #d7e5df;
  --white:        #ffffff;
  --muted:        #5c6b67;
  --muted-2:      #7c8a86;
  --danger:       #b3402f;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Radius & shadow */
  --r:    8px;
  --r-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(24,37,35,.06), 0 1px 3px rgba(24,37,35,.08);
  --shadow:    0 4px 14px rgba(24,37,35,.08);
  --shadow-lg: 0 12px 34px rgba(24,37,35,.14);

  --maxw: 1200px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.18rem; }
p  { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 64px 0; }
.section--tight { padding: 44px 0; }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink); color: #e8efec; }
.section--ink h2, .section--ink h3 { color: #fff; }
.center { text-align: center; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.center .lead { margin-left: auto; margin-right: auto; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .76rem;
  font-weight: 700; color: var(--green); margin-bottom: .7rem;
}
.section--ink .eyebrow { color: var(--teal); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font); font-weight: 600; font-size: .98rem;
  padding: 13px 22px; border-radius: var(--r); border: 1.5px solid transparent;
  cursor: pointer; transition: .15s ease; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); color: #fff; }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--lime:hover { background: #a8c84a; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--green); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--green); background: var(--paper); color: var(--green); }
.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color:#fff; }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 28px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60; background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar {
  background: var(--green-deep); color: #d8ece6; font-size: .82rem;
  text-align: center; padding: 7px 12px; letter-spacing: .02em;
}
.topbar strong { color: var(--lime); }
.nav { display: flex; align-items: center; gap: 22px; padding: 14px 0; }
.nav__logo img { height: 46px; width: auto; }
.nav__links { display: flex; gap: 26px; margin-left: 14px; }
.nav__links a {
  color: var(--ink); font-weight: 600; font-size: .96rem; padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.nav__links a:hover { color: var(--green); text-decoration: none; border-bottom-color: var(--lime); }
.nav__spacer { flex: 1; }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; background: none; border: none; cursor: pointer; padding: 8px;
  color: var(--ink); border-radius: var(--r-sm); display: inline-flex;
}
.icon-btn:hover { background: var(--paper); }
.cart-count {
  position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--green); color: #fff; font-size: .68rem; font-weight: 700;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.nav__toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

@media (max-width: 860px) {
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    flex-direction: column; gap: 0; margin: 0; padding: 8px 0;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 22px; border-bottom: 1px solid var(--paper); }
  .nav__toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #f4faf8 0%, #eef6f4 55%, #e7f2ef 100%);
  position: relative; overflow: hidden;
}
.hero__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
  padding: 70px 0;
}
.hero h1 { margin-bottom: .35em; }
.hero__sub { font-size: 1.15rem; color: var(--muted); margin-bottom: 1.6rem; max-width: 52ch; }
.hero__media {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow-lg); display: flex; align-items: center; justify-content: center;
}
.hero__media img { max-height: 420px; width: auto; object-fit: contain; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 28px; padding: 44px 0; }
  .hero__media { order: -1; }
  .hero__media img { max-height: 300px; }
}

/* ---------- Trust strip ---------- */
.trust {
  background: var(--ink); color: #cfe0db;
}
.trust__row {
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center;
  padding: 16px 0; font-size: .86rem; font-weight: 500;
}
.trust__row span { display: inline-flex; align-items: center; gap: 8px; }
.trust__row .dot { color: var(--lime); }

/* ---------- Section heading ---------- */
.sec-head { max-width: 64ch; margin: 0 auto 40px; text-align: center; }
.sec-head .lead { margin-top: .4rem; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--4 { grid-template-columns: repeat(2,1fr); } .grid--3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.benefit__icon {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: flex;
  align-items: center; justify-content: center; background: #e9f4f0; color: var(--green);
  margin-bottom: 14px;
}
.benefit h3 { margin-bottom: .35em; }
.benefit p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Product card ---------- */
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column; transition: .18s ease;
  box-shadow: var(--shadow-sm);
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.product-card__media {
  background: var(--paper); aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  padding: 18px; position: relative; border-bottom: 1px solid var(--border);
}
.product-card__media img { max-height: 100%; width: auto; object-fit: contain; }
.product-card a.product-card__media:hover { text-decoration: none; }
.badge {
  position: absolute; top: 12px; left: 12px; background: var(--lime); color: var(--ink);
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 9px; border-radius: 999px;
}
.badge--sold { background: #e7ded0; color: #6b5a3c; }
.product-card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.product-card__cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 700; margin-bottom: 6px; }
.product-card__title { font-size: 1.04rem; font-weight: 700; margin: 0 0 6px; }
.product-card__title a { color: var(--ink); }
.product-card__title a:hover { color: var(--green); text-decoration: none; }
.product-card__desc { font-size: .9rem; color: var(--muted); margin: 0 0 14px; flex: 1; }
.product-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.price small { font-size: .78rem; font-weight: 600; color: var(--muted-2); }
.price__was { text-decoration: line-through; color: var(--muted-2); font-size: .9rem; font-weight: 600; margin-right: 6px; }

/* ---------- Section banner (category) ---------- */
.cat-banner {
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px;
  background: linear-gradient(160deg,#0b6b5d 0%, #073f37 100%); color: #eafaf4;
  border-radius: var(--r); overflow: hidden; padding: 0;
}
.cat-banner__text { padding: 48px; }
.cat-banner__text h2 { color: #fff; }
.cat-banner__text .lead { color: #c7e7df; }
.cat-banner__media { align-self: stretch; min-height: 280px; background-size: cover; background-position: center; }
@media (max-width: 820px){ .cat-banner { grid-template-columns: 1fr; } .cat-banner__text { padding: 32px; } .cat-banner__media { min-height: 200px; } }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split--rev .split__media { order: 2; }
.split__media img, .split__media { border-radius: var(--r); }
.split__media img { box-shadow: var(--shadow); border: 1px solid var(--border); }
@media (max-width: 820px){ .split { grid-template-columns: 1fr; gap: 28px; } .split--rev .split__media { order: 0; } }

/* ---------- Stage list (filtration) ---------- */
.stages { display: grid; gap: 14px; }
.stage {
  display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px 20px;
}
.stage__no {
  width: 44px; height: 44px; border-radius: 999px; background: var(--green); color: #fff;
  font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.stage h4 { margin: 2px 0 4px; font-size: 1.02rem; }
.stage p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- Proof / caution ---------- */
.note {
  background: #fff8ec; border: 1px solid #f0e0bd; border-left: 4px solid var(--lime);
  border-radius: var(--r-sm); padding: 14px 18px; font-size: .9rem; color: #6b5a3c;
}

/* ---------- FAQ ---------- */
.faq { max-width: 800px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 12px;
  background: #fff; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--green); font-weight: 400; }
.faq details[open] summary::after { content: "\2013"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .faq__a { padding: 14px 20px 18px; color: var(--muted); }
.faq .faq__a p:last-child { margin-bottom: 0; }

/* ---------- Email capture ---------- */
.capture {
  background: linear-gradient(160deg,#0b6b5d,#073f37); color: #eafaf4; border-radius: var(--r);
  padding: 44px; text-align: center;
}
.capture h2 { color: #fff; }
.capture form { display: flex; gap: 10px; max-width: 480px; margin: 18px auto 0; }
.capture input[type=email], .field input, .field textarea, .field select {
  flex: 1; font-family: var(--font); font-size: 1rem; padding: 13px 16px;
  border-radius: var(--r); border: 1.5px solid var(--border); background: #fff; color: var(--ink);
}
.capture input::placeholder { color: var(--muted-2); }
.capture .fineprint { font-size: .82rem; color: #bfe2d9; margin-top: 12px; }
@media (max-width:560px){ .capture form { flex-direction: column; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; display: block; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; }
.field textarea { min-height: 120px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:560px){ .field-row { grid-template-columns: 1fr; } }
.form-msg { padding: 12px 16px; border-radius: var(--r-sm); font-size: .92rem; margin-top: 8px; display: none; }
.form-msg.ok { display: block; background: #e7f4ee; color: var(--green-dark); border: 1px solid #bfe0d2; }
.form-msg.err { display: block; background: #fbeae7; color: var(--danger); border: 1px solid #f0c9c1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #b9c8c3; font-size: .92rem; }
.footer__grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 40px;
}
.footer__grid h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer__grid a { color: #b9c8c3; display: block; padding: 4px 0; }
.footer__grid a:hover { color: var(--lime); text-decoration: none; }
.footer__brand img { height: 44px; margin-bottom: 14px; filter: brightness(0) invert(1); opacity: .92; }
.footer__brand p { max-width: 34ch; color: #9fb1ac; }
.footer__bottom {
  border-top: 1px solid #2c3a37; padding: 18px 0; display: flex; flex-wrap: wrap;
  gap: 8px 18px; align-items: center; justify-content: space-between; font-size: .82rem; color: #8ea29c;
}
@media (max-width: 820px){ .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Cart drawer ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(24,37,35,.45); z-index: 90;
  opacity: 0; visibility: hidden; transition: .2s;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw;
  background: #fff; z-index: 95; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer__head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer__head h3 { margin: 0; }
.drawer__close { background: none; border: none; cursor: pointer; font-size: 1.5rem; line-height: 1; color: var(--muted); padding: 4px 8px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 12px 22px; }
.drawer__foot { border-top: 1px solid var(--border); padding: 20px 22px; }
.drawer__foot .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.drawer__foot .row .price { font-size: 1.3rem; }
.cart-empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Cart line item */
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--paper); align-items: center; }
.cart-line__img { width: 64px; height: 64px; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; padding: 6px; }
.cart-line__img img { max-height: 100%; width: auto; }
.cart-line__title { font-weight: 600; font-size: .92rem; margin: 0 0 4px; }
.cart-line__title a { color: var(--ink); }
.cart-line__meta { font-size: .85rem; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; margin-top: 6px; }
.qty button { background: var(--paper); border: none; width: 28px; height: 28px; cursor: pointer; font-size: 1rem; color: var(--ink); }
.qty button:hover { background: #e9f4f0; }
.qty span { min-width: 32px; text-align: center; font-size: .9rem; font-weight: 600; }
.cart-line__remove { background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0; margin-top: 6px; }
.cart-line__price { font-weight: 700; white-space: nowrap; }

/* ---------- Product detail page ---------- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.pdp__gallery { position: sticky; top: 110px; }
.pdp__main-img { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r); padding: 28px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1/1; }
.pdp__main-img img { max-height: 100%; object-fit: contain; }
.pdp__price { font-size: 1.9rem; font-weight: 800; margin: 6px 0 4px; }
.pdp__buy { display: flex; gap: 12px; align-items: center; margin: 22px 0; }
.pdp__features { list-style: none; padding: 0; margin: 22px 0; }
.pdp__features li { padding: 9px 0 9px 30px; position: relative; border-bottom: 1px solid var(--paper); color: var(--ink); }
.pdp__features li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: .94rem; }
.specs th { width: 38%; color: var(--muted); font-weight: 600; background: var(--paper); }
@media (max-width: 820px){ .pdp { grid-template-columns: 1fr; gap: 28px; } .pdp__gallery { position: static; } }

/* ---------- Cart / checkout page ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; align-items: start; }
@media (max-width: 860px){ .checkout-grid { grid-template-columns: 1fr; } }
.summary { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r); padding: 24px; position: sticky; top: 110px; }
.summary .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .95rem; }
.summary .row--total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; font-size: 1.15rem; font-weight: 800; }
.cart-table-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--border); align-items: center; }
.cart-table-line__img { width: 84px; height: 84px; background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; padding: 8px; }
.cart-table-line__img img { max-height: 100%; }

.badge-pill { display: inline-block; background: #e9f4f0; color: var(--green-dark); font-size: .76rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; margin-bottom: 12px; }

/* utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hide { display: none !important; }
.text-sm { font-size: .9rem; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
