/* =========================================================
   Product page  (scoped with .pd-)
   Brand: green #2D4F2B · cream #FFF1CA · amber #FFB823 · paper #F9F5F0
   ========================================================= */
:root {
  --pd-green: #2D4F2B;
  --pd-green-700: #233e22;
  --pd-green-50: #eef3ec;
  --pd-cream: #FFF1CA;
  --pd-amber: #FFB823;
  --pd-paper: #F9F5F0;
  --pd-card: #ffffff;
  --pd-ink: #1d231c;
  --pd-body: #3b4239;
  --pd-muted: #6b7368;
  --pd-line: #e6e1d8;
  --pd-red: #b42318;
  --pd-radius: 16px;
  --pd-radius-sm: 10px;
  --pd-shadow: 0 1px 2px rgba(29,35,28,.05), 0 8px 24px -12px rgba(29,35,28,.18);
  --pd-shadow-lg: 0 2px 4px rgba(29,35,28,.06), 0 18px 40px -16px rgba(29,35,28,.28);
}

.pd-wrap { background: var(--pd-paper); color: var(--pd-body); padding-bottom: 64px; }
.pd-wrap section { padding: 0; background: transparent; }
.pd-wrap img { max-width: 100%; }
.pd-container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Breadcrumb ---------- */
.pd-crumbs { background: #fff; border-bottom: 1px solid var(--pd-line); }
.pd-crumbs ol {
  list-style: none; margin: 0; padding: 12px 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: .875rem; color: var(--pd-muted);
}
.pd-crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.pd-crumbs li + li::before {
  content: "\203A"; color: #a9b0a5; font-size: 1.05rem; line-height: 1;
}
.pd-crumbs a { color: var(--pd-green); text-decoration: none; font-weight: 500; }
.pd-crumbs a:hover { text-decoration: underline; }
.pd-crumbs [aria-current="page"] {
  color: var(--pd-ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw;
}

/* ---------- Hero grid ---------- */
.pd-hero { padding: 28px 0 40px !important; }
.pd-grid {
  display: grid; gap: 32px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

/* Gallery */
.pd-gallery { position: sticky; top: 24px; }
.pd-stage {
  position: relative; background: #fff; border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius); box-shadow: var(--pd-shadow);
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 24px;
}
.pd-stage img { width: 100%; height: 100%; object-fit: contain; }
.pd-flag {
  position: absolute; top: 14px; left: 14px;
  background: var(--pd-red); color: #fff; font-size: .75rem; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; letter-spacing: .02em;
}
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pd-thumb {
  flex: 0 0 auto; width: 72px; height: 72px; padding: 4px;
  background: #fff; border: 2px solid var(--pd-line); border-radius: var(--pd-radius-sm);
  cursor: pointer; transition: border-color .15s ease;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb:hover { border-color: #b9c4b5; }
.pd-thumb.is-active { border-color: var(--pd-green); }
.pd-thumb:focus-visible { outline: 3px solid var(--pd-amber); outline-offset: 2px; }

/* Buy box */
.pd-buy {
  background: #fff; border: 1px solid var(--pd-line); border-radius: var(--pd-radius);
  box-shadow: var(--pd-shadow); padding: 28px;
}
.pd-eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 10px; font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--pd-green);
}
.pd-eyebrow .dot { color: var(--pd-amber); }
.pd-title {
  color: var(--pd-ink); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.4rem); line-height: 1.15; margin: 0 0 8px;
}
.pd-maker { margin: 0 0 12px; font-size: .9rem; color: var(--pd-muted); }
.pd-maker strong { color: var(--pd-body); font-weight: 600; }
.pd-stock {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px;
  font-size: .875rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.pd-stock.in { background: var(--pd-green-50); color: var(--pd-green); }
.pd-stock.out { background: #fdecea; color: var(--pd-red); }
.pd-lead { font-size: 1rem; line-height: 1.7; margin: 0 0 22px; color: var(--pd-body); }

/* Pack options */
.pd-options { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.pd-options legend {
  float: none; width: auto; font-size: .95rem; font-weight: 700; color: var(--pd-ink);
  margin: 0 0 10px; padding: 0;
}
.pd-option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pd-option { position: relative; margin: 0; cursor: pointer; }
.pd-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pd-option-box {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 10px 12px; height: 100%;
  border: 2px solid var(--pd-line); border-radius: 12px; background: #fff; text-align: center;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.pd-option:hover .pd-option-box { border-color: #b9c4b5; }
.pd-option input:checked + .pd-option-box {
  border-color: var(--pd-green); background: var(--pd-green-50);
  box-shadow: 0 0 0 3px rgba(45,79,43,.12);
}
.pd-option input:focus-visible + .pd-option-box { outline: 3px solid var(--pd-amber); outline-offset: 2px; }
.pd-option-name { font-weight: 700; color: var(--pd-ink); font-size: .95rem; }
.pd-option-price { font-weight: 700; color: var(--pd-green); font-size: 1.1rem; }
.pd-option-unit { font-size: .75rem; color: var(--pd-muted); }
.pd-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--pd-amber); color: var(--pd-ink); white-space: nowrap;
  font-size: .65rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}

/* Price + CTA */
.pd-price-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 0; margin-bottom: 16px; border-top: 1px dashed var(--pd-line); border-bottom: 1px dashed var(--pd-line);
}
.pd-price-label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-muted); }
.pd-price { font-size: 2rem; font-weight: 800; color: var(--pd-ink); line-height: 1.1; letter-spacing: -.02em; }
.pd-price small { font-size: .9rem; font-weight: 600; color: var(--pd-muted); letter-spacing: 0; }
.pd-unit { font-size: .9rem; font-weight: 600; color: var(--pd-green); background: var(--pd-green-50); padding: 4px 10px; border-radius: 999px; }
.pd-unit:empty { display: none; }

.pd-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; padding: 14px 20px; border: 0; border-radius: 12px;
  font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.pd-btn-primary { background: var(--pd-green); color: #fff; box-shadow: 0 6px 16px -8px rgba(45,79,43,.6); }
.pd-btn-primary:hover { background: var(--pd-green-700); color: #fff; }
.pd-btn-primary:active { transform: translateY(1px); }
.pd-btn:focus-visible { outline: 3px solid var(--pd-amber); outline-offset: 2px; }
.pd-btn-disabled { background: #e7e4de; color: var(--pd-muted); cursor: not-allowed; }
.pd-incart { margin: 10px 0 0; font-size: .875rem; color: var(--pd-green); text-align: center; }
.pd-incart a, .pd-link { color: var(--pd-green); font-weight: 600; }
.pd-form > .pd-link { display: block; text-align: center; margin-top: 10px; }

/* Trust list */
.pd-trust { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.pd-trust li { display: flex; align-items: center; gap: 12px; font-size: .875rem; color: var(--pd-muted); }
.pd-trust img { flex: 0 0 auto; width: 36px; height: 36px; padding: 6px; background: var(--pd-paper); border-radius: 10px; }
.pd-trust strong { display: block; color: var(--pd-ink); font-size: .9rem; }
.pd-trust a { color: var(--pd-green); }

/* ---------- In-page tabs ---------- */
.pd-tabs {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(8px);
  border-top: 1px solid var(--pd-line); border-bottom: 1px solid var(--pd-line);
}
.pd-tabs .pd-container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pd-tabs .pd-container::-webkit-scrollbar { display: none; }
.pd-tabs a {
  flex: 0 0 auto; padding: 14px 14px; font-size: .9rem; font-weight: 600;
  color: var(--pd-muted); text-decoration: none; border-bottom: 3px solid transparent;
}
.pd-tabs a:hover { color: var(--pd-green); border-bottom-color: var(--pd-amber); }

/* ---------- Body sections ---------- */
.pd-body { padding-top: 32px; }
.pd-section { margin-bottom: 40px; scroll-margin-top: 72px; }
.pd-h2 {
  color: var(--pd-ink); font-weight: 700; letter-spacing: -.01em;
  font-size: clamp(1.35rem, 1.1rem + .9vw, 1.75rem); margin: 0 0 18px;
}
.pd-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pd-section-head .pd-link { text-decoration: none; font-size: .95rem; }

/* Specs */
.pd-specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0;
}
.pd-specs > div {
  background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; padding: 14px 16px;
}
.pd-specs dt {
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pd-muted); margin-bottom: 4px; display: flex; align-items: center; gap: 8px;
}
.pd-specs dt i { color: var(--pd-green); width: 16px; text-align: center; }
.pd-specs dd { margin: 0; font-weight: 600; color: var(--pd-ink); font-size: 1rem; }

/* TOC */
.pd-toc {
  background: #fff; border: 1px solid var(--pd-line); border-left: 4px solid var(--pd-amber);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 24px;
}
.pd-toc summary { font-weight: 700; color: var(--pd-ink); cursor: pointer; }
.pd-toc ol { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.pd-toc a { color: var(--pd-green); text-decoration: none; font-size: .95rem; }
.pd-toc a:hover { text-decoration: underline; }

/* Long description (CKEditor HTML) */
.pd-prose {
  background: #fff; border: 1px solid var(--pd-line); border-radius: var(--pd-radius);
  padding: clamp(20px, 3vw, 40px); font-size: 1.0625rem; line-height: 1.75; color: var(--pd-body);
  overflow-wrap: anywhere;
}
.pd-prose span[style] { font-size: inherit !important; }
.pd-prose > *:first-child { margin-top: 0; }
.pd-prose h2, .pd-prose h3, .pd-prose h4 { color: var(--pd-ink); line-height: 1.25; scroll-margin-top: 72px; }
.pd-prose h2 { font-size: clamp(1.3rem, 1.05rem + .8vw, 1.65rem); font-weight: 700; margin: 2em 0 .6em; padding-top: .2em; }
.pd-prose h3 { font-size: 1.2rem; font-weight: 700; margin: 1.6em 0 .5em; }
.pd-prose h4 { font-size: 1.05rem; font-weight: 700; margin: 1.4em 0 .4em; }
.pd-prose p { margin: 0 0 1em; }
.pd-prose ul, .pd-prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.pd-prose li { margin-bottom: .4em; }
.pd-prose ul li::marker { color: var(--pd-green); }
.pd-prose a { color: var(--pd-green); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pd-prose strong { color: var(--pd-ink); }
.pd-prose img { height: auto; border-radius: 12px; }
.pd-prose blockquote {
  margin: 1.5em 0; padding: 14px 18px; background: var(--pd-green-50);
  border-left: 4px solid var(--pd-green); border-radius: 0 12px 12px 0;
}
.pd-table { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--pd-line); border-radius: 12px; }
.pd-table table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 480px; }
.pd-table th, .pd-table td { padding: 10px 14px; border-bottom: 1px solid var(--pd-line); text-align: left; vertical-align: top; }
.pd-table th { background: var(--pd-green-50); color: var(--pd-ink); font-weight: 700; }
.pd-table tr:last-child td { border-bottom: 0; }

/* FAQ */
.pd-faq { display: grid; gap: 10px; }
.pd-faq details {
  background: #fff; border: 1px solid var(--pd-line); border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pd-faq details[open] { border-color: #c9d4c5; box-shadow: var(--pd-shadow); }
.pd-faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--pd-ink); font-size: 1rem;
}
.pd-faq summary::-webkit-details-marker { display: none; }
.pd-faq summary i {
  flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--pd-green-50); color: var(--pd-green); font-size: .8rem;
  transition: transform .2s ease, background .2s ease;
}
.pd-faq details[open] summary i { transform: rotate(45deg); background: var(--pd-green); color: #fff; }
.pd-faq summary:focus-visible { outline: 3px solid var(--pd-amber); outline-offset: 2px; border-radius: 12px; }
.pd-faq-a { padding: 0 20px 18px; line-height: 1.7; }
.pd-faq-a p:last-child { margin-bottom: 0; }

/* Note */
.pd-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--pd-cream); border-radius: 12px; padding: 14px 16px;
  font-size: .875rem; color: var(--pd-body); margin: 0 0 40px;
}
.pd-note i { color: #9a6b00; margin-top: 3px; }

/* Related products */
.pd-related { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pd-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--pd-line);
  border-radius: var(--pd-radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pd-card:hover { transform: translateY(-3px); box-shadow: var(--pd-shadow-lg); color: inherit; }
.pd-card:focus-visible { outline: 3px solid var(--pd-amber); outline-offset: 2px; }
.pd-card-img { aspect-ratio: 1 / 1; background: #fff; padding: 16px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--pd-line); }
.pd-card-img img { width: 100%; height: 100%; object-fit: contain; }
.pd-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.pd-card-title { font-weight: 700; color: var(--pd-ink); line-height: 1.3; }
.pd-card-price { font-size: .9rem; color: var(--pd-muted); }
.pd-card-price strong { color: var(--pd-green); font-size: 1.05rem; }
.pd-card-cta { margin-top: auto; padding-top: 6px; font-size: .875rem; font-weight: 700; color: var(--pd-green); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .pd-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pd-gallery { position: static; }
  .pd-stage { max-width: 520px; margin: 0 auto; }
  .pd-thumbs { justify-content: center; }
  .pd-related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .pd-hero { padding: 16px 0 28px !important; }
  .pd-buy { padding: 20px 16px; border-radius: 14px; }
  .pd-stage { padding: 16px; border-radius: 14px; }
  .pd-option-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pd-option-box { padding: 14px 4px 10px; }
  .pd-option-name { font-size: .85rem; }
  .pd-option-price { font-size: 1rem; }
  .pd-option-unit { font-size: .7rem; }
  .pd-badge { font-size: .58rem; padding: 2px 6px; }
  .pd-price { font-size: 1.7rem; }
  .pd-specs { grid-template-columns: minmax(0, 1fr); }
  .pd-prose { font-size: 1rem; padding: 18px 16px; }
  .pd-faq summary { padding: 14px 16px; font-size: .95rem; }
  .pd-faq-a { padding: 0 16px 16px; }
  .pd-related { gap: 10px; }
  .pd-card-body { padding: 10px 12px 12px; }
  .pd-card-title { font-size: .9rem; }
  .pd-crumbs [aria-current="page"] { max-width: 48vw; }
  .pd-wrap { padding-bottom: 88px; } /* room above the fixed bottom nav */
}

@media (prefers-reduced-motion: reduce) {
  .pd-wrap * { transition: none !important; }
}
