/* ─────────────────────────────────────────────────────────────
   Sagebrush & Sunshine — storefront additions (cart, grids, forms)
   Layers on top of site.css and reuses its tokens.
   ───────────────────────────────────────────────────────────── */

/* ── Flash messages ─────────────────────────────────────────── */
.flash {
  padding: .9rem 2rem;
  font-size: .95rem;
  text-align: center;
  border-bottom: 1px solid rgba(122,158,126,.25);
}
.flash-ok    { background: var(--sage-lt); color: var(--sage-dk); }
.flash-error { background: #f6dcd0; color: #8c3f1d; }

/* ── Header cart ────────────────────────────────────────────── */
.nav-cart { display: inline-flex; align-items: center; gap: .4rem; }
.cart-bubble {
  display: inline-grid; place-items: center;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem;
  background: var(--sun); color: var(--ink);
  border-radius: 999px; font-size: .78rem; font-weight: 700;
}

/* ── Page heads ─────────────────────────────────────────────── */
.page-head {
  padding: 4rem 2rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--sand), var(--cream));
}
.page-head .section-title { margin-bottom: .5rem; }
.page-head .section-intro { margin: 0 auto; max-width: 46rem; }

/* ── Category chips ─────────────────────────────────────────── */
.shop-body { padding: 2rem 2rem 5rem; }
.cat-filter {
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: center; margin-bottom: 2.5rem;
}
.chip {
  padding: .45rem 1.1rem;
  border: 1px solid var(--sage-lt);
  border-radius: 999px;
  font-size: .9rem; font-weight: 600;
  color: var(--sage-dk);
  background: var(--white);
  transition: background .2s, color .2s;
}
.chip:hover { background: var(--sage-lt); }
.chip-on { background: var(--sage-dk); color: var(--white); border-color: var(--sage-dk); }

/* ── Product grid ───────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.prod-card {
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.prod-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--sand);
  overflow: hidden;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-noimg {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 2rem; color: var(--sage-lt);
  background: var(--sand);
}
.prod-noimg.big { aspect-ratio: 1/1; font-size: 4rem; }
.prod-flag {
  position: absolute; top: .75rem; left: .75rem;
  background: var(--sun); color: var(--ink);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .6rem;
}
.prod-flag-out { background: var(--ink-soft); color: var(--white); }
.prod-flag-mto { background: var(--sage-lt); color: var(--sage-dk); }
.prod-body { padding: 1.1rem 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .4rem; }
.prod-name { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.3; }
.prod-desc { font-size: .9rem; color: var(--ink-soft); line-height: 1.5; }
.prod-price { font-weight: 600; color: var(--sage-dk); margin-top: auto; }
.prod-was { color: var(--ink-soft); text-decoration: line-through; font-weight: 400; margin-left: .4rem; font-size: .9em; }

/* ── Empty states ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; max-width: 34rem; margin: 0 auto; }
.empty-mark { font-size: 2.5rem; color: var(--sage-lt); }
.empty-state h3 { font-family: var(--font-display); font-size: 1.6rem; margin: .5rem 0; }
.empty-state p { color: var(--ink-soft); margin-bottom: 1.5rem; }

/* ── Product page ───────────────────────────────────────────── */
.product-page {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; padding: 3rem 2rem 4rem;
  max-width: 1200px; margin: 0 auto;
}
.pg-main { background: var(--sand); box-shadow: var(--shadow); aspect-ratio: 1/1; overflow: hidden; }
.pg-main img { width: 100%; height: 100%; object-fit: cover; }
.pg-thumbs { display: flex; gap: .6rem; margin-top: .75rem; flex-wrap: wrap; }
.pg-thumb {
  width: 68px; height: 68px; padding: 0;
  border: 2px solid transparent; background: none; cursor: pointer;
}
.pg-thumb.on { border-color: var(--sage); }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; }

.back-link { font-size: .9rem; color: var(--sage-dk); }
.product-title { font-family: var(--font-display); font-size: 2.4rem; line-height: 1.15; margin: .75rem 0 .5rem; }
.product-price { font-size: 1.5rem; color: var(--sage-dk); font-weight: 600; margin-bottom: 1rem; }
.product-short { color: var(--ink-soft); margin-bottom: 1.25rem; }
.product-desc { margin-top: 2rem; color: var(--ink-soft); line-height: 1.75; }
.product-assure { list-style: none; margin-top: 2rem; font-size: .9rem; color: var(--ink-soft); }
.product-assure li { margin-bottom: .35rem; }
.product-assure a { color: var(--sage-dk); text-decoration: underline; }

.stock-note {
  display: inline-block; font-size: .85rem; font-weight: 600;
  padding: .35rem .8rem; background: var(--sage-lt); color: var(--sage-dk);
  margin-bottom: 1.25rem;
}
.stock-low { background: var(--sun-lt); color: var(--ink); }
.stock-out { background: #f6dcd0; color: #8c3f1d; }

.add-form { display: flex; flex-direction: column; gap: 1rem; max-width: 22rem; }
.opt-row { display: flex; flex-direction: column; gap: .35rem; }
.qty-field { max-width: 6rem; }
.btn-add { width: 100%; padding: 1rem; font-size: 1.05rem; }
.btn-add[disabled] { opacity: .5; cursor: not-allowed; }

.related { padding: 3rem 2rem 5rem; background: var(--sand); }
.related .product-grid { margin-top: 2rem; }

/* ── Shared form fields ─────────────────────────────────────── */
.field-label {
  font-size: .85rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-soft);
  display: block; margin-bottom: .4rem;
}
.field {
  width: 100%; padding: .75rem 1rem;
  border: 1.5px solid #e0d4c4; border-radius: 2px;
  font-family: var(--font-body); font-size: 1rem;
  background: var(--cream); color: var(--ink);
  outline: none; transition: border-color .2s;
}
.field:focus { border-color: var(--sage); }
textarea.field { resize: vertical; }
.btn-sun {
  background: var(--sun); color: var(--ink); border: none;
  padding: .9rem 1.6rem; border-radius: 2px;
  font-family: var(--font-body); font-size: 1rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; transition: background .2s;
}
.btn-sun:hover { background: var(--sun-lt); }

.contact-section {
  background: var(--sand);
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: start;
}
.contact-card { background: var(--white); padding: 2.5rem; box-shadow: var(--shadow); }

/* ── Cart ───────────────────────────────────────────────────── */
.cart-body { padding: 2rem 2rem 5rem; }
.cart-grid {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 3rem; max-width: 1100px; margin: 0 auto;
  align-items: start;
}
.cart-line {
  display: grid;
  grid-template-columns: 96px 1fr 6rem 6rem;
  gap: 1.25rem; align-items: center;
  background: var(--white); padding: 1rem;
  box-shadow: var(--shadow); margin-bottom: 1rem;
}
.cl-thumb { width: 96px; height: 96px; background: var(--sand); overflow: hidden; display: block; }
.cl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cl-name { font-family: var(--font-display); font-size: 1.1rem; }
.cl-opts { font-size: .85rem; color: var(--ink-soft); }
.cl-unit { font-size: .85rem; color: var(--ink-soft); }
.cl-remove button {
  background: none; border: none; padding: 0; margin-top: .35rem;
  font-family: var(--font-body); font-size: .82rem; color: var(--terra);
  text-decoration: underline; cursor: pointer;
}
.cl-total { text-align: right; font-weight: 600; color: var(--sage-dk); }

.cart-summary { background: var(--white); padding: 2rem; box-shadow: var(--shadow); position: sticky; top: 6rem; }
.cart-summary h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 1.25rem; color: var(--sage-dk); }
.cs-row { display: flex; justify-content: space-between; padding: .45rem 0; font-size: .95rem; }
.cs-total {
  border-top: 1px solid #e8dcc8; margin-top: .6rem; padding-top: .9rem;
  font-size: 1.15rem; font-weight: 700; color: var(--ink);
}
.btn-checkout { width: 100%; margin-top: 1.25rem; padding: 1rem; }
.cs-note { font-size: .8rem; color: var(--ink-soft); margin-top: .85rem; line-height: 1.5; }
.cs-keep { display: inline-block; margin-top: 1rem; font-size: .9rem; color: var(--sage-dk); }

/* ── Thank you ──────────────────────────────────────────────── */
.thankyou { text-align: center; padding: 2rem 2rem 6rem; max-width: 40rem; margin: 0 auto; }
.ty-lead { font-size: 1.2rem; margin-bottom: 2rem; }
.ty-card { background: var(--white); box-shadow: var(--shadow); padding: 1.5rem; text-align: left; }
.ty-line { display: flex; justify-content: space-between; padding: .4rem 0; }
.ty-total { border-top: 1px solid #e8dcc8; margin-top: .5rem; padding-top: .75rem; font-weight: 700; }
.ty-note { color: var(--ink-soft); margin: 1.5rem 0 2rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .product-page { grid-template-columns: 1fr; gap: 2rem; }
  .cart-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .contact-section { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
  .cart-line { grid-template-columns: 72px 1fr; grid-template-areas: 'thumb info' 'qty total'; }
  .cl-thumb { grid-area: thumb; width: 72px; height: 72px; }
  .cl-info { grid-area: info; }
  .cl-qty { grid-area: qty; }
  .cl-total { grid-area: total; }
  .page-head { padding: 3rem 1.25rem 1.5rem; }
  .shop-body, .cart-body { padding: 1.5rem 1.25rem 4rem; }
  .product-page { padding: 2rem 1.25rem 3rem; }
}
