/* ============================================================
   socalsteve.com/store: Steve's Store
   Tokens borrowed in shape from bwe/css/styles.css, own palette.
   ============================================================ */

:root {
  --bg:          #fbfaf7;
  --surface:     #ffffff;
  --surface-alt: #f2efe8;
  --ink:         #1f1e1b;
  --muted:       #6b6459;
  --border:      #e3ded2;
  --brand:       #1f5f52;
  --brand-dk:    #164439;
  --accent:      #d4622a;
  --accent-dk:   #b04a18;
  --max-w:       1140px;
  --radius:      14px;
  --shadow:      0 2px 10px rgba(31, 30, 27, .08);
  --shadow-lg:   0 18px 44px rgba(31, 30, 27, .20);
  --body:        -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 76px; scroll-behavior: smooth; }
body { font-family: var(--body); font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; }
img { max-width: 100%; display: block; }
button { font: inherit; }
.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.15rem; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.15rem; height: 60px;
  background: rgba(251, 250, 247, .96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-brand { display: flex; align-items: center; gap: .5rem; color: var(--brand); font-weight: 800; font-size: 1rem; text-decoration: none; }
.nav-tag { font-size: 1.15rem; }
.nav-links { display: flex; align-items: center; gap: .9rem; }
.nav-home { color: var(--brand); font-size: .85rem; font-weight: 700; text-decoration: none; }
.nav-home:hover { text-decoration: underline; }
.nav-cta { background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; padding: .5rem 1rem; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.nav-cta:hover { background: var(--accent-dk); }

/* ---------- Hero ---------- */
.hero { background: var(--surface-alt); border-bottom: 1px solid var(--border); padding: 2.75rem 0 2.25rem; }
.hero-grid { display: grid; gap: 1.5rem; align-items: center; }
.hero-collage { display: grid; gap: 6px; width: 100%; max-width: 360px; height: 240px; justify-self: center; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface-alt); }
.hero-collage img { width: 100%; height: 100%; object-fit: cover; }
.hero-collage img:first-child { grid-row: span 2; }
.hero-collage:empty { display: none; }
@media (min-width: 760px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, .65fr); } .hero-collage { justify-self: end; } }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--accent); margin-bottom: .55rem; }
.hero h1 { font-size: clamp(1.8rem, 6vw, 2.75rem); color: var(--brand-dk); }
.hero-sub { margin-top: .8rem; font-size: 1.02rem; color: var(--muted); max-width: 46rem; }
.hero-loc { margin-top: 1.1rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; font-size: .93rem; max-width: 46rem; }

/* ---------- Groups + list ---------- */
main { padding: 2.25rem 0 3rem; }
.loading { color: var(--muted); padding: 2rem 0; }
.list-wrap { max-width: 1280px; margin: 0 auto; }
/* ---------- Category nav ---------- */
.cat-nav { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 auto 1.1rem; }
.cat-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 700; color: var(--brand); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .35rem .85rem; text-decoration: none; }
.cat-pill:hover { border-color: var(--brand); background: var(--surface-alt); }
.cat-pill.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-count { font-size: .75rem; font-weight: 600; opacity: .75; }
.cat-pill.on .cat-count { opacity: .85; }

.all-listings { font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }
.group { margin-bottom: 2.25rem; }
.group-title { font-size: 1.1rem; color: var(--brand-dk); margin-bottom: .85rem; padding-bottom: .45rem; border-bottom: 2px solid var(--border); }
/* 1 column under 600px, 2 to 959px, 3 to 1199px, 4 at 1200px and up. */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Listing card (portrait: square photo on top, text under) ---------- */
.card {
  display: flex; flex-direction: column; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer; font: inherit; color: inherit;
  text-decoration: none;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(31, 30, 27, .12); }
.card:active { transform: scale(.995); }
.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card-media { position: relative; flex: 0 0 auto; width: 100%; background: var(--surface-alt); }
/* The square lives on the img: as a flex item the wrapper takes its height from
   content, which lets a portrait photo override a wrapper aspect-ratio. */
.card-media img { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; }
.card-media .no-photo { aspect-ratio: 1 / 1; height: auto; }
.no-photo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; text-align: center; padding: .4rem; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; padding: .7rem .8rem .8rem; }
.card-title { font-size: .97rem; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.price { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.card-meta { font-size: .8rem; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .45rem; }
.pill { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; padding: .16rem .55rem; }

/* ---------- Detail view ---------- */
.detail-wrap { max-width: 720px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; background: none; border: none; padding: 0; margin-bottom: 1rem; color: var(--brand); font-size: .9rem; font-weight: 700; cursor: pointer; text-decoration: none; }
.back-link:hover { color: var(--brand-dk); text-decoration: underline; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.detail-stage { position: relative; background: var(--surface-alt); }
.detail-stage img { width: 100%; max-height: 460px; object-fit: contain; cursor: zoom-in; }
.stage-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .9); border: 1px solid var(--border); color: var(--ink); font-size: 1.4rem; line-height: 1; padding: .25rem .65rem; border-radius: 999px; cursor: pointer; }
.stage-prev { left: .6rem; }
.stage-next { right: .6rem; }
.stage-count { position: absolute; right: .6rem; bottom: .6rem; background: rgba(31, 30, 27, .78); color: #fff; font-size: .74rem; font-weight: 600; padding: .18rem .5rem; border-radius: 999px; }
.detail-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; padding: .75rem 1.1rem 0; }
.detail-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; opacity: .65; }
.detail-thumbs img.on, .detail-thumbs img:hover { opacity: 1; border-color: var(--brand); }
.detail-body { padding: 1.1rem 1.1rem 1.35rem; display: flex; flex-direction: column; gap: .55rem; }
.detail-body h1 { font-size: 1.45rem; }
.detail-price { font-size: 1.7rem; font-weight: 800; color: var(--brand); }
.detail-meta { font-size: .85rem; color: var(--muted); }
.full-desc { white-space: pre-line; font-size: .95rem; color: var(--ink); }
.detail-actions { margin-top: .5rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.is-hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 999px; padding: .55rem 1.05rem; font-size: .88rem; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: var(--surface); color: var(--brand); border-color: var(--border); text-decoration: none; display: inline-block; }
.btn-ghost:hover { background: var(--surface-alt); }

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-dk); color: #fff; padding: 2.5rem 0 2rem; }
.site-footer h2 { font-size: 1.15rem; margin-bottom: .65rem; }
.foot-blurb { font-size: .95rem; max-width: 46rem; }
.foot-fine { margin-top: .9rem; font-size: .86rem; color: rgba(255, 255, 255, .72); max-width: 46rem; }
.foot-copy { margin-top: 1.5rem; font-size: .8rem; color: rgba(255, 255, 255, .55); }

/* ---------- Modal ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(31, 30, 27, .6); padding: 1rem; overflow-y: auto; }
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; margin: auto; padding: 1.35rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.modal-head h2 { font-size: 1.2rem; color: var(--brand-dk); }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.ask-item-line { display: none; font-size: .88rem; color: var(--muted); background: var(--surface-alt); border-radius: 8px; padding: .5rem .7rem; margin-bottom: .9rem; }
.field { margin-bottom: .85rem; display: flex; flex-direction: column; gap: .3rem; }
.field label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.field input, .field textarea { font: inherit; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-success { background: #e7f2ee; border: 1px solid var(--brand); color: var(--brand-dk); border-radius: 9px; padding: .65rem .8rem; font-size: .9rem; margin-bottom: .8rem; }
.modal-actions { display: flex; gap: .6rem; }

/* ---------- Lightbox (never upscales) ---------- */
.lightbox { display: none; position: fixed; inset: 0; z-index: 95; background: rgba(15, 15, 14, .92); align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { width: auto; height: auto; max-width: 90vw; max-height: 90vh; border-radius: 6px; }
.lightbox-close { position: absolute; top: 1rem; right: 1.15rem; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .12); border: none; color: #fff; font-size: 2rem; line-height: 1; padding: .35rem .8rem; border-radius: 8px; cursor: pointer; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-count { position: absolute; bottom: 1.2rem; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .8); font-size: .82rem; }
