/* ============================================================
   STHERB — Product Detail Redesign (cream/gold/earth tone)
   Scoped to template-product-redesign.php only.
   Loads after homepage-redesign.css (shared chrome + product
   cards); this file adds the product-detail layout only.
   ============================================================ */

/* ---------- Breadcrumb strip ---------- */
.pd-breadcrumb-strip {
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.sr-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.sr-breadcrumb a:hover { color: var(--accent); }
.sr-breadcrumb-sep { opacity: 0.55; }
.sr-breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- Two-column layout ---------- */
.pd-main { padding: 46px 0 0; }
.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

/* ---------- Gallery ---------- */
.pd-main-media {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
}
.pd-main-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pd-main-media .sr-product-tag {
  position: absolute;
  top: 18px;
  left: 18px;
}
.pd-thumbs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.pd-thumb {
  width: 76px;
  height: 76px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 7px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pd-thumb:hover { border-color: var(--muted); }
.pd-thumb.sr-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* ---------- Details column ---------- */
.pd-details { min-width: 0; }
.pd-cat {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.pd-title {
  font-size: 42px;
  line-height: 1.08;
  margin: 0 0 14px;
}
.pd-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.sr-rating-count { font-size: 13px; color: var(--muted); }
.pd-rating-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pd-rating-link:hover { color: var(--accent); }
.pd-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: #2E7D46;
}
.pd-stock::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.pd-stock-low { color: #B76E00; }
.pd-stock-out { color: #B00020; }
.pd-rating-divider { color: var(--border); }

/* Price — deliberately large & high-contrast (see stherb-ux-priorities) */
.pd-price {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  margin: 6px 0 16px;
  line-height: 1.1;
}
.pd-price del {
  font-size: 22px;
  color: var(--muted);
  font-weight: 500;
  margin-right: 10px;
}
.pd-price ins {
  text-decoration: none;
  color: var(--accent);
}
.pd-short {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 24px;
}
.pd-short p { margin: 0 0 10px; }

/* ---------- Buy row ---------- */
.pd-buy-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 12px;
}
.pd-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  flex-shrink: 0;
}
.pd-qty button {
  width: 44px;
  height: 52px;
  border: 0;
  background: transparent;
  font-size: 19px;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.14s ease;
}
.pd-qty button:hover { color: var(--accent); }
.pd-qty-val {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.stherb-redesign-home .pd-add-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 15px 30px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.stherb-redesign-home .pd-add-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.stherb-redesign-home .pd-add-btn.loading { opacity: 0.6; pointer-events: none; }
/* SVG heart (a \2661 text glyph came from a fallback font and rendered
   tilted; Astra's global button padding also pushed it off-centre). */
.stherb-redesign-home .pd-wishlist {
  width: 52px;
  height: 52px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pd-wishlist svg {
  width: 20px;
  height: 20px;
  display: block;
}
.stherb-redesign-home .pd-wishlist:hover { color: #C0392B; border-color: #C0392B; background: var(--surface); }
.stherb-redesign-home .pd-wishlist.sr-active {
  color: #C0392B;
  border-color: #C0392B;
  transform: scale(1.05);
}
.pd-wishlist.sr-active svg { fill: currentColor; }
.stherb-redesign-home .pd-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #1DA851;
  color: #fff;
  border-radius: 999px;
  padding: 15px 30px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background 0.16s ease, transform 0.16s ease;
  margin-bottom: 22px;
}
.stherb-redesign-home .pd-whatsapp:hover {
  background: #178A43;
  transform: translateY(-1px);
  color: #fff;
}
.pd-whatsapp svg { width: 19px; height: 19px; flex-shrink: 0; }

/* The drawer already opens on add — WooCommerce's injected "View cart"
   link would be redundant next to the button. */
.pd-buy-row .added_to_cart { display: none; }

/* View-options fallback for variable products */
.stherb-redesign-home .pd-view-options {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 15px 30px;
  font-size: 14.5px;
  font-weight: 800;
}
.stherb-redesign-home .pd-view-options:hover { background: var(--accent); }
.pd-options-note {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 18px;
}

/* ---------- WooCommerce notices (added-to-cart after variation submit) ---------- */
.pd-notices:empty { display: none; }
.pd-notices .woocommerce-message,
.pd-notices .woocommerce-info,
.pd-notices .woocommerce-error {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--ink);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pd-notices .woocommerce-error { border-left-color: #B00020; }
.stherb-redesign-home .pd-notices a.button,
.stherb-redesign-home .pd-notices .wc-forward {
  order: 2;
  margin-left: auto;
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: 8px 16px !important;
  font-size: 12.5px !important;
  font-weight: 700;
}

/* ---------- Variable products: native WooCommerce variations form ---------- */
.pd-variations { margin-bottom: 22px; }
.pd-variations table.variations {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 8px;
}
.pd-variations table.variations th,
.pd-variations table.variations td {
  text-align: left;
  padding: 7px 0;
  border: 0;
}
.pd-variations table.variations th.label {
  width: 32%;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.pd-variations select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 340px;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23221E18' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 13px;
  border-radius: 999px;
  padding: 11px 38px 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.pd-variations .reset_variations {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pd-variations .woocommerce-variation-price {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  margin: 8px 0 14px;
}
.pd-variations .woocommerce-variation-price del { font-size: 19px; color: var(--muted); font-weight: 500; margin-right: 8px; }
.pd-variations .woocommerce-variation-price ins { text-decoration: none; color: var(--accent); }
.pd-variations .woocommerce-variation-availability { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pd-variations .woocommerce-variation-add-to-cart {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}
/* Full-width rows injected into the flex row by other plugins (Tiered Price
   Table's bulk table, Woo's .clear) must not steal width from the button. */
.pd-variations .woocommerce-variation-add-to-cart .clear,
.pd-variations .woocommerce-variation-add-to-cart [class*="tpt__"] {
  flex: 0 0 100%;
}
.pd-variations form.cart .quantity {
  display: flex;
  width: auto;
  float: none;
  margin: 0;
}
.pd-variations input.qty {
  width: 86px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 13px 8px 13px 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
/* Astra's `.woocommerce div.product form.cart .button` rules outrank plain
   class selectors on real product pages, hence the heavier selectors and
   !important on the visual props. */
.stherb-redesign-home .pd-variations form.cart button.single_add_to_cart_button {
  flex: 1 !important;
  width: auto !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--primary) !important;
  color: #fff !important;
  padding: 15px 30px !important;
  font-size: 14.5px !important;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2 !important;
  min-height: 52px;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}
.stherb-redesign-home .pd-variations form.cart button.single_add_to_cart_button:hover {
  background: var(--accent) !important;
  transform: translateY(-1px);
}
.stherb-redesign-home .pd-variations form.cart button.single_add_to_cart_button.disabled,
.stherb-redesign-home .pd-variations form.cart button.wc-variation-selection-needed {
  opacity: 0.45;
  cursor: not-allowed;
}

/* CartFlows Variation Swatches (cfvsw-*) chips */
.pd-variations .cfvsw-swatches-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stherb-redesign-home .pd-variations .cfvsw-swatches-option {
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  background: var(--surface);
  padding: 9px 20px !important;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  box-shadow: none !important;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.stherb-redesign-home .pd-variations .cfvsw-swatches-option:hover {
  border-color: var(--accent) !important;
}
.stherb-redesign-home .pd-variations .cfvsw-swatches-option.cfvsw-selected-swatch {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

/* ---------- Trust row ---------- */
.pd-trust {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
  margin-bottom: 18px;
}
.pd-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.pd-trust-item::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 800;
}

/* ---------- SKU / Category / Tags ---------- */
.pd-meta { font-size: 13px; color: var(--muted); }
.pd-meta > div { margin-bottom: 6px; }
.pd-meta strong {
  color: var(--ink);
  font-weight: 700;
  margin-right: 6px;
}
.pd-meta a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.pd-meta a:hover { color: var(--accent); }

/* ---------- Tabs ---------- */
.pd-tabs { margin-top: 64px; }
.pd-tabs-nav {
  display: flex;
  gap: 30px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.pd-tabs-nav::-webkit-scrollbar { display: none; }
.stherb-redesign-home .pd-tab-btn {
  border: 0;
  background: transparent;
  padding: 14px 2px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.14s ease;
}
.stherb-redesign-home .pd-tab-btn:hover { color: var(--ink); }
.stherb-redesign-home .pd-tab-btn.sr-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.pd-tab-panel { display: none; padding: 34px 0 8px; }
.pd-tab-panel.sr-active { display: block; }

/* Description content is authored per-product in WooCommerce with its own
   inline colors (old teal/red branding) — re-skin it to the redesign theme
   without touching the stored content. */
.pd-desc { max-width: 880px; font-size: 15.5px; line-height: 1.75; color: var(--ink); }
.pd-desc h2, .pd-desc h3 {
  font-family: 'Cormorant', Georgia, serif;
  color: var(--ink) !important;
  margin: 6px 0 14px;
}
.pd-desc h2 { font-size: 30px; }
.pd-desc h3 { font-size: 24px; }
.pd-desc hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}
.pd-desc ul { margin: 0 0 14px; padding-left: 20px; }
.pd-desc li { margin-bottom: 8px; }
.pd-desc a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pd-desc p[style] { color: var(--muted) !important; }

/* ---------- Additional information ---------- */
.pd-info-table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.pd-info-table th,
.pd-info-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.pd-info-table th {
  width: 40%;
  font-weight: 700;
  color: var(--ink);
  background: var(--soft);
}
.pd-info-table td { color: var(--muted); }

/* ---------- Reviews ---------- */
.pd-reviews-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.pd-reviews-avg {
  font-family: 'Cormorant', Georgia, serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}
.pd-reviews-meta { font-size: 13px; color: var(--muted); }
.pd-review-list {
  display: grid;
  gap: 16px;
  max-width: 760px;
}
.pd-review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
}
.pd-review-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.pd-review-author { font-weight: 800; font-size: 14.5px; }
.pd-review-date { font-size: 12.5px; color: var(--muted); }
.pd-review-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}
.pd-reviews-empty { color: var(--muted); font-size: 14.5px; }

/* ---------- Toast ---------- */
.pd-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(34,30,24,0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 210;
}
.pd-toast.sr-show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- You May Also Like ---------- */
.pd-related { padding: 74px 0 92px; }
.pd-related .sr-section-head { margin-bottom: 34px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pd-main { padding-top: 26px; }
  .pd-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .pd-title { font-size: 32px; }
  .pd-price { font-size: 32px; }
  .pd-tabs { margin-top: 44px; }
  .pd-related { padding: 50px 0 64px; }
}
@media (max-width: 640px) {
  .pd-main-media { padding: 18px; }
  .pd-thumb { width: 64px; height: 64px; }
  .pd-trust { flex-direction: column; gap: 10px; }
  .pd-tabs-nav { gap: 20px; }
  .pd-desc ul[style] { columns: 1 !important; }
  .pd-related .sr-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 430px) {
  .pd-buy-row { flex-wrap: wrap; }
  .pd-qty { order: 1; }
  .pd-wishlist { order: 2; }
  .stherb-redesign-home .pd-add-btn { order: 3; flex-basis: 100%; }
}
