/* East County Deals v1 — mobile-first, light theme.
   Palette is deliberately NOT OVO's brass: deep green + warm cream,
   so the two brands never get mixed up. */
:root {
  --bg: #f4efe3;
  --card: #ffffff;
  --ink: #1c2419;
  --muted: #5c6248;
  --green: #2f5d3a;
  --green-dark: #24492d;
  --green-light: #dce8d8;
  --line: #ddd2b8;
  --red: #a33b2e;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.5;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); }
button { font-family: inherit; cursor: pointer; }
.muted { color: var(--muted); font-size: .92rem; }

/* ---- nav ---- */
.sticky-nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; flex-wrap: wrap;
  padding: .6rem 1rem;
  background: rgba(244, 239, 227, .95);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  color: var(--green); font-weight: bold; text-decoration: none;
  font-size: 1.05rem; letter-spacing: .04em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .35rem;
}
.nav-brand svg { width: 1.15em; height: 1.15em; flex: none; }
.nav-links { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav-links a:hover { color: var(--green); }
.nav-cart {
  background: var(--green); color: #fff; border: none;
  border-radius: 999px; padding: .5rem 1rem; font-size: .95rem;
  min-height: 44px;
}
.nav-cart:hover { background: var(--green-dark); }

/* ---- hero ---- */
.hero { text-align: center; padding: 1.5rem 1rem 1rem; }
.hero h1 { font-size: 2rem; color: var(--green); letter-spacing: .02em; }
.hero-tagline { font-size: 1.15rem; font-style: italic; margin-top: .25rem; }
.hero-sub { max-width: 640px; margin: .6rem auto 0; color: var(--muted); }
.info-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem;
  margin: 1rem auto 0; max-width: 900px;
  background: var(--green-light); border-radius: var(--radius);
  padding: .7rem 1rem; font-size: .95rem; font-weight: bold; color: var(--green-dark);
}

/* ---- layout ---- */
.shop-main { max-width: 1100px; margin: 0 auto; padding: 0 1rem 2rem; }
.cat-filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin: 1rem 0; justify-content: center;
}
.cat-filters button {
  border: 2px solid var(--green); background: transparent; color: var(--green);
  border-radius: 999px; padding: .45rem 1rem; font-size: .95rem; min-height: 44px;
}
.cat-filters button.active, .cat-filters button:hover {
  background: var(--green); color: #fff;
}

/* ---- grid + cards ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.05rem; line-height: 1.3; }
.card-cat { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-condition, .card-tested { font-size: .9rem; color: var(--muted); margin-top: .25rem; }
.price { font-size: 1.3rem; font-weight: bold; color: var(--green); margin-top: .4rem; }
.pickup-note { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
/* Buttons pin to the bottom of every card so rows line up even when
   titles and descriptions are different lengths. */
.card-actions {
  margin-top: auto; padding-top: .75rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.btn-primary, .btn-ghost {
  display: inline-block; text-align: center; text-decoration: none;
  border-radius: 10px; padding: .65rem 1rem; font-size: 1rem; min-height: 44px;
  line-height: 1.25;
}
.btn-primary { background: var(--green); color: #fff; border: 2px solid var(--green); font-weight: bold; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-ghost:hover { background: var(--green-light); }
.card.sold { opacity: .62; }
.card.sold img { filter: grayscale(60%); }
.sold-pill {
  display: inline-block; background: var(--red); color: #fff; font-weight: bold;
  border-radius: 6px; padding: .15rem .6rem; font-size: .85rem; margin-top: .4rem;
}
.reserved-pill {
  display: inline-block; background: #8a6d1b; color: #fff; font-weight: bold;
  border-radius: 6px; padding: .15rem .6rem; font-size: .85rem; margin-top: .4rem;
}
.empty-note { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---- how it works / footer ---- */
.how { margin-top: 2.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.how h2 { color: var(--green); margin-bottom: .5rem; }
.how ol { padding-left: 1.25rem; }
.how li { margin: .5rem 0; }
.disclosure { color: var(--muted); font-size: .9rem; margin-top: 1rem; }
footer { text-align: center; padding: 1.5rem 1rem 2.5rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---- lightbox / drawer ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .55);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 1rem;
}
.lightbox.hidden { display: none; }
.lightbox-inner {
  position: relative; background: var(--card); border-radius: var(--radius);
  max-width: 640px; width: 100%; margin: auto 0; padding: 1.25rem 1.25rem 1.5rem;
}
.lightbox-inner > button[aria-label="Close"] {
  position: absolute; top: .5rem; right: .5rem; width: 44px; height: 44px;
  border-radius: 50%; border: 2px solid var(--line); background: #fff;
  font-size: 1.4rem; line-height: 1; z-index: 2;
}
.lightbox-inner img { border-radius: 8px; width: 100%; }
.lightbox-inner h3 { margin-top: .75rem; font-size: 1.25rem; }
.lb-line { margin-top: .3rem; }
#lb-notes { margin-top: .5rem; color: var(--muted); }
.cart-total { font-weight: bold; font-size: 1.15rem; margin-top: .75rem; }
.cart-row {
  display: flex; gap: .75rem; align-items: center;
  border-bottom: 1px solid var(--line); padding: .6rem 0;
}
.cart-row img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cart-row .cart-row-info { flex: 1; min-width: 0; }
.cart-row .cart-row-info strong { display: block; }
.cart-remove {
  border: 2px solid var(--red); color: var(--red); background: transparent;
  border-radius: 8px; padding: .3rem .7rem; min-height: 44px; min-width: 44px;
}

/* ---- sticky cart bar ---- */
#cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--green-light); border-top: 2px solid var(--green);
  padding: .75rem 1rem; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap;
}
#cart-bar-text { font-weight: bold; color: var(--green-dark); }

/* ---- checkout ---- */
.checkout-wrap { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 2rem; }
.checkout-wrap h1 { color: var(--green); }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem; }
.form-card label { display: block; font-weight: bold; margin: 1rem 0 .3rem; }
.form-card input[type="text"], .form-card input[type="tel"], .form-card input[type="email"] {
  width: 100%; padding: .7rem; border: 2px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; min-height: 44px;
}
.pay-choices { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.pay-choices label {
  display: flex; gap: .6rem; align-items: flex-start; font-weight: normal;
  border: 2px solid var(--line); border-radius: 10px; padding: .7rem .9rem; min-height: 44px;
}
.pay-choices input { margin-top: .25rem; width: 20px; height: 20px; flex-shrink: 0; }
.form-msg { margin-top: 1rem; font-weight: bold; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: var(--green); }
.order-summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.order-summary-total { display: flex; justify-content: space-between; font-weight: bold; font-size: 1.15rem; padding-top: .6rem; }

/* ---- small phones ---- */
@media (max-width: 560px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-tagline { font-size: 1.05rem; }
  .nav-links a { display: none; }
  .nav-brand { font-size: .95rem; }
  .grid { grid-template-columns: 1fr; }
  .info-bar { font-size: .88rem; }
  .lightbox { padding: .5rem; }
  .cat-filters button { font-size: .9rem; padding: .45rem .8rem; }
}
