/* Single product page — CSS-only restyle (no template override, so every
   WooCommerce hook/action stays exactly where WC put it — see standing
   rule in CLAUDE brief). Scoped to body.single-product with explicit
   font-family so it reliably beats Astra's own plain `body{font-family}`
   rule regardless of which stylesheet happens to load last. */

body.single-product {
  font-family: var(--sf-font);
  background: var(--sf-bg);
}

body.single-product .woocommerce-breadcrumb {
  display: none;
}

/* Gallery + summary layout */

body.single-product div.product.type-product {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 860px) {
  body.single-product div.product.type-product {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* Astra's own dynamic customizer CSS ships a `@media (min-width:922px)`
   rule targeting `.ast-woocommerce-container div.product div.images`/
   `div.summary` at width:50%/46% — that selector out-specifies anything
   scoped only to body.single-product, so !important is the only reliable
   way to win here (same justification as the Shop-grid override above). */

body.single-product .woocommerce-product-gallery {
  width: 100% !important;
  float: none !important;
  background: #fff;
  border: 1px solid var(--sf-border);
  border-radius: 12px;
  overflow: hidden;
}

body.single-product .woocommerce-product-gallery__wrapper {
  margin: 0;
}

body.single-product .woocommerce-product-gallery img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Summary column */

body.single-product .summary.entry-summary {
  width: 100% !important;
  max-width: none;
  float: none !important;
}

body.single-product .product_title.entry-title {
  font-family: var(--sf-font);
  font-size: clamp(1.6rem, 2.5vw + 1rem, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--sf-text);
  margin: 0 0 0.75rem;
}

body.single-product .sf-vanity-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

body.single-product .sf-vanity-rating__stars {
  display: flex;
  gap: 0.1rem;
}

body.single-product .sf-star-half {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
}

body.single-product .sf-star-half__bg {
  position: absolute;
  top: 0;
  left: 0;
}

body.single-product .sf-star-half__clip {
  position: absolute;
  top: 0;
  left: 0;
  width: 9px;
  height: 18px;
  overflow: hidden;
  display: block;
}

body.single-product .sf-vanity-rating__text {
  font-size: 0.85rem;
  color: var(--sf-text-muted);
}

body.single-product .summary .price {
  font-family: var(--sf-font);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sf-text);
}

body.single-product .summary .price del {
  color: var(--sf-text-muted);
  font-weight: 400;
  opacity: 0.7;
  margin-right: 0.5rem;
}

body.single-product .summary .price ins {
  text-decoration: none;
}

body.single-product .woocommerce-product-details__short-description {
  margin: 1.25rem 0 1.5rem;
  padding-top: 1.25rem;
  border-top: var(--sf-divider);
  color: var(--sf-text-muted);
  line-height: 1.75;
  font-size: 0.98rem;
}

body.single-product .woocommerce-product-details__short-description p:last-child {
  margin-bottom: 0;
}

/* Variations — color swatches replace the native <select>, which stays in
   the DOM (just visually hidden) so WooCommerce's own variation-form JS
   keeps driving price/image/stock updates and the add-to-cart button
   exactly as it always did. Falls back to the plain dropdown untouched if
   JS doesn't run, since the hiding class is only added by the JS itself. */

body.single-product table.variations {
  width: 100%;
  margin: 1.25rem 0;
}

body.single-product table.variations tr {
  display: block;
}

body.single-product table.variations th.label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sf-text);
  padding: 0 0 0.5rem;
}

body.single-product table.variations td.value {
  display: block;
  padding: 0;
}

body.single-product .sf-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

body.single-product .sf-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--sf-border);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

body.single-product .sf-color-swatch:hover {
  transform: scale(1.08);
}

body.single-product .sf-color-swatch.is-active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sf-text);
}

/* Astra's own woocommerce-grid.min.css ships
   `.woocommerce-js div.product form.cart .variations select{display:inline-block}`
   — 4 classes + 3 elements, out-specifying anything scoped only to
   body.single-product (2 classes + 3 elements) regardless of load order.
   !important is the only reliable way to win here. */
body.single-product table.variations select {
  display: none !important;
}

body.single-product .reset_variations {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--sf-text-muted);
}

/* Add-to-cart form */

body.single-product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

body.single-product .quantity {
  margin: 0;
}

body.single-product .sf-qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--sf-border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

body.single-product .sf-qty__btn {
  width: 2.4rem;
  border: none;
  background: transparent;
  color: var(--sf-text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

body.single-product .sf-qty__btn:hover {
  background: var(--sf-bg);
}

body.single-product .quantity .input-text.qty {
  width: 3rem;
  padding: 0.85rem 0.25rem;
  border: none;
  border-left: 1px solid var(--sf-border);
  border-right: 1px solid var(--sf-border);
  background: #fff;
  color: var(--sf-text);
  font-family: var(--sf-font);
  font-size: 0.95rem;
  text-align: center;
  -moz-appearance: textfield;
}

body.single-product .quantity .input-text.qty::-webkit-outer-spin-button,
body.single-product .quantity .input-text.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body.single-product .single_add_to_cart_button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--sf-font);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--sf-accent);
  color: var(--sf-text-inverse) !important;
  transition: background 0.15s ease;
}

body.single-product .single_add_to_cart_button.button:hover {
  background: var(--sf-accent-hover);
}

body.single-product .sf-buy-now-button {
  background: transparent;
  color: var(--sf-text) !important;
  border-color: var(--sf-text);
}

body.single-product .sf-buy-now-button:hover {
  background: var(--sf-text);
  color: var(--sf-text-inverse) !important;
}

body.single-product .sf-buy-now-button.disabled,
body.single-product .sf-buy-now-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.single-product .sf-pdp-accordion {
  margin: 1.5rem 0 0;
  border-top: var(--sf-divider);
}

body.single-product .sf-pdp-accordion__item {
  border-bottom: var(--sf-divider);
}

body.single-product .sf-pdp-accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 0;
  border: none;
  background: none;
  font-family: var(--sf-font);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--sf-text);
  text-align: left;
  cursor: pointer;
}

body.single-product .sf-pdp-accordion__chevron {
  flex: 0 0 auto;
  color: var(--sf-text-muted);
  transition: transform 0.2s ease;
}

body.single-product .sf-pdp-accordion__header[aria-expanded="true"] .sf-pdp-accordion__chevron {
  transform: rotate(180deg);
}

body.single-product .sf-pdp-accordion__panel {
  padding: 0 0 1rem;
}

body.single-product .sf-pdp-accordion__panel[hidden] {
  display: none;
}

body.single-product .sf-pdp-accordion__panel p {
  margin: 0;
  color: var(--sf-text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

body.single-product .product_meta {
  display: none;
}

body.single-product .stock {
  font-size: 0.85rem;
  font-weight: 600;
}

body.single-product .stock.in-stock {
  color: #1e9e5a;
}

body.single-product .stock.out-of-stock {
  color: #dc3545;
}

body.single-product .sf-viewers {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--sf-text-muted);
}

body.single-product .sf-viewers__icon {
  display: inline-flex;
  color: var(--sf-text-muted);
}

body.single-product .sf-viewers__icon svg {
  display: block;
}

body.single-product #sf-viewers-count {
  font-weight: 600;
  color: var(--sf-text);
}

/* Comparison table + text-review carousel — sit in row 2 of the grid,
   beside the Description/Additional-info/Reviews tabs (see the
   .woocommerce-tabs rule above), inside the .sf-pdp-side wrapper. */

body.single-product .sf-pdp-side {
  min-width: 0;
}

body.single-product .sf-pdp-reviews {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: var(--sf-divider);
}

body.single-product .sf-pdp-comparison h3,
body.single-product .sf-pdp-reviews h3,
body.single-product .sf-pdp-how-to-use h3 {
  font-family: var(--sf-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sf-text);
  margin: 0 0 0.5rem;
}

/* How to Use — same heading treatment as the homepage's version, but the
   gif itself stays compact (capped width) since this is a narrow sidebar
   column, not a full-width homepage section. */

body.single-product .sf-pdp-how-to-use {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: var(--sf-divider);
}

body.single-product .sf-pdp-how-to-use__squiggle {
  display: block;
  width: 90px;
  height: 0.8rem;
  color: var(--sf-text);
  margin: 0 0 1.25rem;
}

body.single-product .sf-pdp-how-to-use img {
  display: block;
  width: 100%;
  max-width: 280px;
  border-radius: 10px;
  border: 1px solid var(--sf-border);
}

body.single-product .sf-pdp-comparison__table-wrap {
  overflow-x: auto;
}

body.single-product .sf-pdp-comparison__table {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

body.single-product .sf-pdp-comparison__table th,
body.single-product .sf-pdp-comparison__table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--sf-border);
  text-align: left;
  color: var(--sf-text-muted);
}

body.single-product .sf-pdp-comparison__table th {
  color: var(--sf-text);
  font-weight: 600;
}

body.single-product .sf-pdp-comparison__table th:not(:first-child),
body.single-product .sf-pdp-comparison__table td:not(:first-child) {
  text-align: center;
}

body.single-product .sf-pdp-comparison__table .sf-tick {
  display: inline-block;
  vertical-align: middle;
}

/* Review carousel — same structure/behavior as the homepage's carousel
   (dots, prev/next arrows, 3.5s auto-advance, [hidden] slide toggling),
   ported here since this page never loads homepage.css/js. */

body.single-product .sf-testimonial-shot-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.single-product .sf-testimonial-track {
  flex: 1;
  min-width: 0;
  min-height: 220px;
  display: flex;
  align-items: center;
}

body.single-product .sf-shot-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--sf-text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

body.single-product .sf-shot-arrow:hover {
  color: var(--sf-text);
}

body.single-product .sf-pdp-review {
  margin: 0;
}

body.single-product .sf-pdp-review[hidden] {
  display: none;
}

body.single-product .sf-pdp-review .sf-stars {
  display: flex;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}

body.single-product .sf-pdp-review p {
  color: var(--sf-text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0.5rem 0;
}

body.single-product .sf-pdp-review cite {
  display: block;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sf-text);
}

body.single-product .sf-testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

body.single-product .sf-testimonial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--sf-border);
  padding: 0;
  cursor: pointer;
}

body.single-product .sf-testimonial-dot.is-active {
  background: var(--sf-text);
}

/* Tabs (Description / Additional info / Reviews) — now a grid item inside
   div.product.type-product's 2-column auto-flow grid, sitting in row 2
   alongside .sf-pdp-side (comparison table + reviews), so no max-width/
   padding of its own is needed any more — the grid container already
   supplies both. */

body.single-product .woocommerce-tabs {
  min-width: 0;
}

body.single-product ul.tabs.wc-tabs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 0 0 2rem;
  padding: 0 0 0.75rem;
  border-bottom: var(--sf-divider);
}

@media (max-width: 480px) {
  body.single-product ul.tabs.wc-tabs {
    gap: 0.6rem 1.1rem;
  }
  body.single-product ul.tabs.wc-tabs li a {
    font-size: 0.85rem;
  }
}

body.single-product ul.tabs.wc-tabs li {
  margin: 0;
}

body.single-product ul.tabs.wc-tabs li a {
  color: var(--sf-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

body.single-product ul.tabs.wc-tabs li.active a {
  color: var(--sf-text);
}

body.single-product .woocommerce-Tabs-panel {
  max-width: 720px;
  color: var(--sf-text-muted);
  line-height: 1.75;
}

body.single-product .woocommerce-Tabs-panel h2 {
  font-family: var(--sf-font);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sf-text);
  margin: 0 0 1rem;
}

/* Native Reviews tab — hide the per-review date. The dash separator
   (" – ") between author name and date is hidden too, otherwise it's
   left dangling after the author name with nothing after it. */
body.single-product .woocommerce-review__dash,
body.single-product .woocommerce-review__published-date {
  display: none;
}

body.single-product .woocommerce-product-attributes.shop_attributes {
  width: 100%;
  border-collapse: collapse;
}

body.single-product .woocommerce-product-attributes.shop_attributes th,
body.single-product .woocommerce-product-attributes.shop_attributes td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--sf-border);
  text-align: left;
  font-size: 0.92rem;
}

body.single-product .woocommerce-product-attributes-item__label {
  font-weight: 600;
  color: var(--sf-text);
  width: 40%;
}

body.single-product .woocommerce-product-attributes-item__value a {
  color: var(--sf-text);
  text-decoration: underline;
}

/* Related products — reuses the same .woocommerce ul.products grid rules
   already defined globally in style.css for the Shop archive, just adds
   a heading treatment here. */

body.single-product .related.products,
body.single-product .upsells.products {
  grid-column: 1 / -1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 6vw, 5rem);
}

body.single-product .related.products > h2 {
  text-align: center;
  font-family: var(--sf-font);
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  font-weight: 700;
  margin-bottom: 2rem;
}

/* Why Use Slimline — full-width row spanning both grid columns, same
   technique as .related.products/.upsells.products above. Ported the
   .sf-section-title/.sf-squiggle base classes here too (not just the
   .sf-why-use-specific rules) since this page never loads homepage.css,
   and the render function (shared with the homepage, functions.php) emits
   the exact same markup/classes on both pages. */

body.single-product .sf-section-title {
  text-align: center;
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  margin-bottom: 2rem;
}

body.single-product .sf-section-title--underline {
  position: relative;
  font-size: clamp(2.25rem, 4vw + 1rem, 3.25rem);
  padding-bottom: 0.6rem;
  margin-bottom: 2.4rem;
}

body.single-product .sf-squiggle {
  position: absolute;
  left: 50%;
  bottom: -0.2rem;
  transform: translateX(-50%);
  width: 65%;
  min-width: 120px;
  height: 0.9rem;
  color: var(--sf-text);
}

body.single-product .sf-squiggle--wide {
  width: 90%;
}

body.single-product .sf-why-use {
  grid-column: 1 / -1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 6vw, 5rem);
}

body.single-product .sf-why-use__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 760px) {
  body.single-product .sf-why-use__grid {
    grid-template-columns: minmax(0, 380px) minmax(0, 600px);
    justify-content: center;
    gap: 2.5rem;
  }
}

body.single-product .sf-why-use__media img {
  display: block;
  width: 100%;
  border-radius: 12px;
}

body.single-product .sf-why-use__list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

body.single-product .sf-why-use__item h3 {
  font-family: var(--sf-font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sf-text);
  margin: 0 0 0.4rem;
}

body.single-product .sf-why-use__item p {
  color: var(--sf-text-muted);
  line-height: 1.7;
  margin: 0;
}

/* Before/After comparison graphic — same full-width-row technique as
   .sf-why-use/.related.products above. */
body.single-product .sf-pdp-before-after {
  grid-column: 1 / -1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem clamp(3rem, 6vw, 5rem);
  text-align: center;
}

body.single-product .sf-pdp-before-after img {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 12px;
}
