/*
  /shop/css/shop.css — The Healing Spot
  Shop-specific styles: catbar, two-column layout, product grid, product detail.
  Requires /css/site.css (tokens) to be loaded first.
*/

/* ── Category bar ──────────────────────────────────────────── */
.catbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.catbar .wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
.catbar ul {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
.catbar ul::-webkit-scrollbar { display: none; }
.catbar li { flex: 0 0 auto; }
.catbar a {
  display: block;
  padding: 14px 20px;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.catbar a:hover { color: var(--dark); }
.catbar a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Two-column shop layout ────────────────────────────────── */
.shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto 64px;
  padding: 32px 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .shop-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px;
  }
}

/* ── Sidebar ───────────────────────────────────────────────── */
.shop-side {
  position: sticky;
  top: 120px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 16px;
}
.side-heading {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 14px;
  letter-spacing: .04em;
}
.catlist {
  margin: 0;
  padding: 0;
  list-style: none;
}
.catlist li { margin: 2px 0; }
.catlist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: .9rem;
  color: var(--dark);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.catlist a:hover {
  background: rgba(92,122,96,.06);
  border-color: var(--line);
}
.catlist a.active {
  background: rgba(92,122,96,.1);
  border-color: rgba(92,122,96,.3);
  color: var(--primary);
  font-weight: 600;
}
@media (max-width: 960px) {
  .shop-side { position: static; }
}

/* ── Results header ─────────────────────────────────────────── */
.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.results-head h1 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 400;
  color: var(--dark);
  margin: 0;
}
.results-count {
  font-size: .88rem;
  color: var(--mid);
  white-space: nowrap;
}
.no-results {
  grid-column: 1 / -1;
  color: var(--mid);
  font-size: .95rem;
  padding: 32px 0;
}

/* ── Product grid ───────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 960px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ── Product card ───────────────────────────────────────────── */
:root {
  --card-radius: 12px;
  --media-gap: 10px;
  --thumb-bg: #eceee8;   /* sage-tinted well — neutral for product shots */
}
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  overflow: hidden;
  padding: var(--media-gap);
  padding-bottom: 0;
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover {
  box-shadow: 0 8px 28px rgba(26,32,24,.1);
  transform: translateY(-2px);
}
.badge-sale, .badge-promo {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  background: var(--accent);
  color: var(--dark);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-promo {
  background: var(--primary);
  color: #fff;
}

/* Thumbnail well */
.product-thumb {
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--thumb-bg);
  border-radius: calc(var(--card-radius) - 4px);
  overflow: hidden;
  margin: 0;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .4s ease;
}
.product-card:hover .product-thumb img { transform: scale(1.04); }

.product-body { padding: 12px 4px 14px; }
.product-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.product-name a { color: var(--dark); text-decoration: none; }
.product-name a:hover { color: var(--primary); }
.product-price { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.price-now { font-weight: 700; font-size: 1rem; color: var(--dark); }
.price-was { font-size: .88rem; color: var(--mid); text-decoration: line-through; }
.product-desc {
  font-size: .84rem;
  color: var(--mid);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ── Pager ──────────────────────────────────────────────────── */
.pager {
  display: flex;
  justify-content: center;
  margin: 40px 0 0;
}
.pager ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .88rem;
  text-decoration: none;
  color: var(--primary);
}
.pager a:hover { background: var(--cream); }
.pager .active {
  background: rgba(92,122,96,.1);
  border-color: rgba(92,122,96,.3);
  color: var(--primary);
  font-weight: 700;
}
.pager .disabled { opacity: .45; color: var(--mid); border-style: dashed; }

/* ═══════════════════════════════════════════════════════════════
   PRODUCT DETAIL PAGE
   ═══════════════════════════════════════════════════════════════ */

.pd-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.pd-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 0 28px;
  font-size: .86rem;
  color: var(--mid);
}
.pd-crumbs a { color: var(--mid); text-decoration: none; }
.pd-crumbs a:hover { color: var(--primary); text-decoration: underline; }

/* ── Two-column grid ────────────────────────────────────────── */
.pd-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: start;
  margin-bottom: 72px;
}
@media (max-width: 960px) {
  .pd-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ── Gallery ────────────────────────────────────────────────── */
.pd-gallery {
  position: relative;
}
.pd-badge-img {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--accent);
  color: var(--dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 5px 12px;
  border-radius: 999px;
  z-index: 2;
}
.pd-gallery-main {
  background: var(--thumb-bg, #eceee8);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  margin-bottom: 12px;
}
.pd-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity .18s ease;
}
.pd-gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pd-thumb {
  width: 80px;
  height: 80px;
  border: 2px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: var(--thumb-bg, #eceee8);
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  flex-shrink: 0;
}
.pd-thumb:hover { border-color: var(--primary); transform: translateY(-1px); }
.pd-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(92,122,96,.18); }
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Buybox ─────────────────────────────────────────────────── */
.pd-buybox { position: sticky; top: 24px; }
.pd-brand {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.pd-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 2.8vw, 2.8rem);
  font-weight: 400;
  color: var(--dark);
  margin: 0 0 12px;
  line-height: 1.08;
  letter-spacing: -.01em;
}
.pd-short {
  font-size: .97rem;
  color: var(--mid);
  line-height: 1.7;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

/* Price */
.pd-price-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.pd-price-now { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; color: var(--dark); }
.pd-price-was { font-size: 1.1rem; color: var(--mid); text-decoration: line-through; }

/* Stock badge */
.pd-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.pd-stock-badge.in  { background: rgba(92,122,96,.1);   color: var(--primary); border: 1px solid rgba(92,122,96,.3); }
.pd-stock-badge.out { background: rgba(180,50,30,.07);  color: #b43220;        border: 1px solid rgba(180,50,30,.2); }

/* Notify Me */
.pd-notify { margin-bottom: 24px; }
.notify-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 12px 0 6px;
}
.notify-form input {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--cream);
  color: var(--dark);
}
.notify-form input:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.notify-note { font-size: .82rem; color: var(--mid); margin: 0; }

/* ── Purchase options ───────────────────────────────────────── */
.pd-offers {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  margin: 0 0 20px;
  box-shadow: 0 2px 12px rgba(26,32,24,.05);
}
.pd-offers-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--mid);
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .82rem;
}
.pd-options { display: grid; gap: 10px; }
.pd-option {
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  transition: border-color .15s;
}
.pd-option.is-active {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(92,122,96,.1);
}
.pd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pd-mode-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  user-select: none;
}
.pd-mode-title { font-weight: 700; font-size: .95rem; color: var(--dark); }
.pd-price { margin-left: auto; text-align: right; font-size: 1rem; }
.pd-price .now { font-weight: 700; color: var(--dark); }
.pd-price .was { color: var(--mid); text-decoration: line-through; margin-left: 6px; font-size: .88rem; }

.pd-freq { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pd-freq label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .84rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fff;
}
.pd-freq label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(92,122,96,.08);
}
.pd-offers input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: transparent;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  transition: border-color .15s;
}
.pd-offers input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary);
  transform: scale(0);
  transition: transform .12s ease;
}
.pd-offers input[type="radio"]:checked { border-color: var(--primary); }
.pd-offers input[type="radio"]:checked::after { transform: scale(1); }

.pd-qty-row { margin-top: 14px; }
.pd-qty { display: flex; align-items: center; gap: 8px; }
.pd-qty label { font-size: .88rem; color: var(--mid); }
.pd-qty input[type="number"] {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--dark);
  font: inherit;
  font-weight: 600;
}
.btn { padding: 13px 20px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; color: var(--dark); font: inherit; font-weight: 700; font-size: .86rem; letter-spacing: .05em; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--cream); }
.btn-primary { background: var(--accent); color: var(--dark); border-color: var(--accent); }
.btn-primary:hover { background: #a87c10; border-color: #a87c10; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* Trust list */
.pd-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.pd-trust li { font-size: .88rem; color: var(--mid); }

/* ── About / description ────────────────────────────────────── */
.pd-sections { margin-bottom: 56px; }
.pd-about {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
@media (max-width: 760px) {
  .pd-about { grid-template-columns: 1fr; gap: 20px; }
}
.pd-about-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--dark);
  margin: 0;
  position: sticky;
  top: 24px;
}
.pd-copy p {
  font-size: 1rem;
  color: var(--mid);
  line-height: 1.78;
  margin: 0 0 20px;
}
.pd-copy p:last-child { margin-bottom: 0; }
.pd-copy strong {
  font-weight: 700;
  color: var(--dark);
}
.pd-copy p + p { border-top: 1px solid var(--line); padding-top: 20px; }

/* ── Related products rail ──────────────────────────────────── */
.pd-related { margin-bottom: 56px; }
.pd-related .pd-section-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--dark);
  margin: 0 0 24px;
}
.related-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
@media (max-width: 760px) {
  .related-rail { grid-template-columns: repeat(2, 1fr); }
}
.related-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.related-card:hover { box-shadow: 0 6px 20px rgba(26,32,24,.1); transform: translateY(-2px); }
.related-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  background: var(--cream);
  padding: 12px;
}
.related-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-name {
  font-size: .9rem;
  font-family: var(--serif);
  font-weight: 500;
  color: var(--dark);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.related-price { font-size: .88rem; font-weight: 700; color: var(--primary); }

/* ── Sticky ATC (mobile) ────────────────────────────────────── */
.sticky-atc {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  padding: 12px 16px;
  background: rgba(26,32,24,.97);
  backdrop-filter: blur(8px);
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
}
.sticky-atc .btn-primary { width: 100%; min-height: 52px; font-size: .95rem; }
@media (max-width: 960px) { .sticky-atc { display: block; } }
/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .notify-form { grid-template-columns: 1fr; }
  .pd-freq { gap: 6px; }
  .pd-freq label { font-size: .8rem; padding: 5px 10px; }
  .related-card { flex: 0 0 150px; }
}
