/* ============================================================
   Product detail page — 2026 brand refresh
   Markup and JS hooks unchanged (pd-*, #pdMainImg, #pdThumbs,
   #pdChoices, #pdAddBtn, #pdModal, #pdLightbox …)
   Shared .panel styles live in main.css.
   ============================================================ */

.pd {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 920px) {
  .pd { grid-template-columns: 1fr; gap: 18px; }
}

/* ============================================================
   Media panel (left)
   ============================================================ */

.pd-mediaInner {
  position: relative;
  background-color: #16402A;
  background-image: url("../../images/home/topo_light.166295d536e6.png");
  background-size: 1000px auto;
  padding: 20px;
}

.pd-imgWrap {
  width: 100%;
}

.pd-img {
  width: 100%;
  height: 480px;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  background: #FFFFFF;
  cursor: zoom-in;
}

.pd-fallback {
  height: 480px;
  display: grid;
  place-items: center;
  color: #E7E1C9;
  font-weight: 700;
}

@media (max-width: 520px) {
  .pd-img,
  .pd-fallback { height: 340px; }
}

/* Badges */
.pd-badges {
  position: absolute;
  top: 30px;
  left: 30px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 2;
}

.pd-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: #FCF5E0;
  color: #16402A;
}

.pd-badge--stock {
  background: #F5C442;
  color: #16402A;
}

.pd-badge--oos {
  background: #70281A;
  color: #FCF5E0;
}

/* Thumbnail strip */
.pd-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.pd-thumb {
  width: 72px;
  height: 72px;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #FFFFFF;
  opacity: .75;
  transition: opacity .15s ease, border-color .15s ease;
}

.pd-thumb:hover {
  opacity: 1;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-thumb--active {
  opacity: 1;
  border-color: #F5C442;
}

/* ============================================================
   Info panel (right)
   ============================================================ */

.pd-infoInner {
  padding: 26px 26px 28px;
}

.pd-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 12px;
}

.pd-crumbs a {
  color: var(--brand);
}

.pd-crumbs a:hover {
  color: var(--brand-2);
  text-decoration: underline;
}

.pd-title {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
}

.pd-desc {
  color: #3A4A40;
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 18px;
}

.pd-priceBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface-2);
  margin: 6px 0 20px;
}

.pd-price {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
  color: var(--brand-2);
}

.pd-priceNote {
  color: var(--muted);
  font-size: .9rem;
  max-width: 28ch;
}

/* ============================================================
   Variation choices
   ============================================================ */

.pd-form {
  display: grid;
  gap: 14px;
}

.pd-h3 {
  margin: 0;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.pd-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.pd-choice {
  border: 1.5px solid #DCD4BC;
  border-radius: 16px;
  background: #FFFFFF;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  user-select: none;
  position: relative;
}

.pd-choice:hover {
  border-color: var(--brand);
}

.pd-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pd-choice:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.pd-choice--selected {
  border-color: var(--brand-2);
  background: rgba(46, 110, 62, .06);
  box-shadow: inset 0 0 0 1.5px var(--brand-2);
}

.pd-choice--disabled {
  opacity: .5;
  cursor: not-allowed;
}

.pd-choice--disabled:hover {
  border-color: #DCD4BC;
}

.pd-choiceTitle {
  font-weight: 700;
}

.pd-choiceMeta {
  color: var(--muted);
  font-size: .86rem;
  margin-top: 4px;
}

.pd-choiceRight {
  text-align: right;
  white-space: nowrap;
}

.pd-choicePrice {
  font-weight: 800;
  color: var(--brand-2);
}

.pd-choiceStock {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   Buy row
   ============================================================ */

.pd-divider {
  height: 1px;
  background: #EFE9D6;
  margin: 4px 0;
}

.pd-buyRow {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: end;
}

@media (max-width: 520px) {
  .pd-buyRow { grid-template-columns: 1fr; }
}

.pd-qty label {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.pd-qty input[type="number"] {
  margin-bottom: 0;
  min-height: 56px;
  text-align: center;
  font-weight: 700;
}

.pd-qty .help-text {
  min-height: 1.2em;
}

.pd-addBtn {
  width: 100%;
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--gold);
  color: var(--brand-2);
  align-self: start;
  margin-top: 22px;
}

.pd-addBtn:hover {
  background: #FFD45E;
  color: var(--brand-2);
}

@media (max-width: 520px) {
  .pd-addBtn { margin-top: 0; }
}

.pd-unavailable {
  color: #B42318;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(180, 35, 24, .08);
}

.pd-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-2);
  color: #E7E1C9;
  font-size: .92rem;
}

/* ============================================================
   Product details sections (desktop — under the image)
   ============================================================ */

.product-extra__inner {
  max-width: none;
  margin: 0;
}

.product-section {
  margin-bottom: 28px;
}

.product-section:last-child {
  margin-bottom: 0;
}

.product-section h2 {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--brand-2);
}

.product-section p:not([class]) {
  max-width: 720px;
  line-height: 1.7;
  color: #3A4A40;
  margin: 0;
}

.pd-extraDesktop {
  display: block;
  padding: 26px 24px 28px;
  border-top: 1px solid #EFE9D6;
}

@media (max-width: 768px) {
  .pd-extraDesktop { display: none; }
}

/* ============================================================
   Mobile accordion
   ============================================================ */

.pd-accordionMobile {
  display: none;
  margin-top: 22px;
  border-top: 1px solid #E5DEC8;
}

@media (max-width: 768px) {
  .pd-accordionMobile { display: block; }
}

.pd-accItem {
  border-bottom: 1px solid #E5DEC8;
}

.pd-accItem summary {
  cursor: pointer;
  min-height: 52px;
  padding: 14px 0;
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--brand-2);
}

.pd-accItem summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand);
  transition: transform .2s ease;
}

.pd-accItem[open] summary::after {
  transform: rotate(45deg);
}

.pd-accItem summary::-webkit-details-marker { display: none; }

.pd-accBody {
  padding: 0 0 18px;
  font-size: .97rem;
  color: #3A4A40;
  line-height: 1.7;
}

/* ============================================================
   Testimonials
   ============================================================ */

.testimonials {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.testimonial {
  margin: 0;
  background: var(--surface-2);
  border: 0;
  padding: 18px 20px;
  border-radius: 16px;
}

.testimonial__quote {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--text);
}

.testimonial__author {
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
}

/* ============================================================
   Add-to-cart modal
   ============================================================ */

.pd-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-modal[hidden] { display: none; }

.pd-modalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 46, 30, .6);
}

.pd-modalBox {
  position: relative;
  background: #FFFFFF;
  border-radius: 24px;
  padding: 36px 28px 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.pd-modalIcon {
  width: 56px;
  height: 56px;
  background: var(--gold);
  color: var(--brand-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 auto 16px;
}

.pd-modalTitle {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 2rem;
  line-height: 1;
  color: var(--brand-2);
  margin: 0 0 10px;
}

.pd-modalMsg {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: .97rem;
}

.pd-modalBtns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Toast (kept for backward compat — hidden by default)
   ============================================================ */

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 0;
  background: var(--brand-2);
  color: var(--cream);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
  display: none;
  z-index: 50;
}

.toast.show { display: block; }

.toast .small {
  color: #E7E1C9;
  font-size: .9rem;
}

.toast.error {
  background: #70281A;
}

/* ============================================================
   Image lightbox (built by product.js)
   ============================================================ */

#pdLightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pdLightbox[hidden] { display: none; }

#pdLightboxBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 20, .9);
}

#pdLightboxInner {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#pdLightboxImg {
  max-width: 92vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
  background: #FFFFFF;
}

#pdLightboxClose {
  position: absolute;
  top: -18px;
  right: -18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--brand-2);
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  z-index: 2;
}

#pdLightboxClose:hover {
  background: #FFD45E;
}

#pdLightboxCaption {
  color: #FFFFFF;
  font-size: .9rem;
  text-align: center;
  max-width: 520px;
  background: rgba(0, 0, 0, .5);
  border-radius: 20px;
  padding: 6px 14px;
  margin: 0;
  flex-shrink: 0;
}

#pdLightboxCaption[hidden] { display: none; }

/* ============================================================
   Rich text from the admin (description, details, ingredients)
   Building blocks: .pd-lead  .pd-chips  .pd-checks  .pd-specs
                    .pd-callout  .pd-steps  .pd-note-inline
   ============================================================ */

.pd-rich > :first-child { margin-top: 0; }
.pd-rich > :last-child { margin-bottom: 0; }

.pd-rich p {
  margin: 0 0 12px;
  line-height: 1.65;
  color: #3A4A40;
}

.pd-rich h3 {
  margin: 22px 0 10px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.pd-rich strong { color: var(--text); }

.pd-rich a {
  color: var(--brand-2);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Opening line */
.pd-rich .pd-lead {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

/* Pill tags */
.pd-rich .pd-chips {
  list-style: none;
  margin: 16px 0 4px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-rich .pd-chips li {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-2);
}

.pd-rich .pd-chips li.is-gold {
  background: var(--gold);
}

/* Check list */
.pd-rich .pd-checks {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.pd-rich .pd-checks li {
  position: relative;
  padding-left: 30px;
  line-height: 1.55;
  color: #3A4A40;
}

.pd-rich .pd-checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold) no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316402A' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

/* Spec table */
.pd-rich .pd-specs {
  margin: 0 0 18px;
  border: 1px solid #E5DEC8;
  border-radius: 16px;
  overflow: hidden;
}

.pd-rich .pd-specs div {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #F1ECDC;
}

.pd-rich .pd-specs div:nth-child(odd) { background: #FCFAF3; }
.pd-rich .pd-specs div:last-child { border-bottom: 0; }

.pd-rich .pd-specs dt {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.pd-rich .pd-specs dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

/* Callout box (how to use) */
.pd-rich .pd-callout {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background-color: var(--brand-2);
  background-image: url("../../images/home/topo_light.166295d536e6.png");
  background-size: 900px auto;
  color: #E7E1C9;
}

.pd-rich .pd-callout h3 {
  margin: 0 0 12px;
  color: var(--gold);
}

.pd-rich .pd-callout p { color: #E7E1C9; }
.pd-rich .pd-callout strong { color: var(--cream); }

/* Numbered steps (works inside or outside a callout) */
.pd-rich .pd-steps {
  list-style: none;
  counter-reset: pdstep;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.pd-rich .pd-steps li {
  counter-increment: pdstep;
  position: relative;
  padding-left: 40px;
  min-height: 28px;
  line-height: 1.5;
}

.pd-rich .pd-steps li::before {
  content: counter(pdstep);
  position: absolute;
  left: 0;
  top: -1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--brand-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: .95rem;
}

/* Small print */
.pd-rich .pd-note-inline {
  font-size: .88rem;
  color: var(--muted);
}

/* ============================================================
   Rich product copy (.pdx-*)
   Used inside the Description / Details fields in the Django admin.
   ============================================================ */

.pd-rich .pdx-hook {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--brand-2);
}

.pd-desc.pd-rich p {
  font-size: 1.04rem;
  line-height: 1.65;
}

.pdx-ticks {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.pdx-ticks li {
  position: relative;
  padding-left: 30px;
  font-weight: 600;
  color: var(--text);
}

.pdx-ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(46, 110, 62, .12) no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E6E3E' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

.pdx-specs {
  margin: 18px 0 0;
  border-top: 1px solid #E5DEC8;
}

.pdx-specs > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #E5DEC8;
}

.pdx-specs dt {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.pdx-specs dd {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 520px) {
  .pd-rich .pdx-hook { font-size: 1.15rem; }
  .pdx-specs > div { grid-template-columns: 92px minmax(0, 1fr); }
}
