/* Single product (PDP) — ported from app/src/pages/ProductDetail.module.css */

.slg-pdp {
  padding-block: var(--space-6) var(--space-9);
}
.slg-pdp__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}
.slg-pdp__visual-col {
  position: sticky;
  top: 96px;
}
/*
 * Gallery thumbnail strip — only rendered (slg_product_gallery_thumbnails,
 * inc/template-tags.php) when a product has more than one image, so
 * single-image products keep the exact approved layout untouched.
 */
.slg-pdp__gallery {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}
.slg-pdp__gallery-thumb {
  width: 52px;
  height: 64px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  background: var(--surface-card);
  border: var(--border-w) solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-snap), box-shadow var(--dur-fast) var(--ease-snap);
}
.slg-pdp__gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slg-pdp__gallery-thumb:hover {
  border-color: var(--ink-950);
}
.slg-pdp__gallery-thumb.is-active {
  border-color: var(--ink-950);
  box-shadow: var(--shadow-tag);
}
.slg-pdp__info-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.slg-pdp__collection {
  color: var(--text-muted);
}
.slg-pdp__title {
  font-size: var(--text-display-3);
  margin: 0;
}
.slg-pdp__secondary {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: var(--text-body-lg);
  margin: 0;
}
.slg-pdp__price-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}
.slg-pdp__sold-out-note {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 14px;
}
.slg-pdp__size-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.slg-pdp__size-label {
  color: var(--text-muted);
}
.slg-pdp__add-btn {
  width: 100%;
  margin-top: var(--space-2);
}
.slg-pdp__find-size {
  margin: 0;
}
.slg-pdp__find-size-link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-label-sm);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  text-decoration: underline;
  color: var(--text-muted);
}
.slg-pdp__find-size-link:hover {
  color: var(--ink-950);
}

/*
 * Accordion — replaces the old horizontal tabs. Each item is a button +
 * collapsible panel (slg_render_accordion_item(), inc/template-tags.php);
 * assets/js/main.js toggles `hidden` + aria-expanded and animates height.
 */
.slg-pdp__accordion {
  margin-top: var(--space-6);
  border-top: var(--border-w) solid var(--border-default);
}
.slg-accordion-item {
  border-bottom: var(--border-w) solid var(--border-default);
}
.slg-accordion-heading {
  margin: 0;
}
.slg-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding-block: var(--space-4);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--text-label);
  color: var(--text-primary);
}
.slg-accordion-trigger::after {
  content: '+';
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease-snap);
}
.slg-accordion-trigger[aria-expanded="true"]::after {
  content: '\2212'; /* minus sign */
}
.slg-accordion-trigger:focus-visible {
  outline: 2px solid var(--ink-950);
  outline-offset: 2px;
}
.slg-accordion-panel {
  overflow: hidden;
  transition: height var(--dur-fast) var(--ease-snap);
}
.slg-accordion-panel__inner {
  padding-bottom: var(--space-4);
  font-family: var(--font-body);
  color: var(--text-muted);
  line-height: var(--lh-body);
}
.slg-accordion-panel__inner p {
  margin: 0 0 var(--space-3);
}
.slg-accordion-panel__inner p:last-child {
  margin-bottom: 0;
}
.slg-pdp__pending-note {
  font-style: italic;
}

/*
 * Size chart — hairline row dividers + alternating tint instead of a
 * bordered grid, per the brief.
 */
.slg-size-chart__note {
  font-size: var(--text-body-sm);
  margin: 0 0 var(--space-3);
}
.slg-size-chart {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
}
.slg-size-chart th,
.slg-size-chart td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-w) solid var(--border-default);
}
.slg-size-chart thead th {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--text-label-sm);
  font-weight: 400;
}
.slg-size-chart tbody tr:nth-child(even) {
  background: var(--surface-card);
}
.slg-size-chart tbody th {
  font-weight: 700;
  color: var(--text-primary);
}
.slg-pdp__related {
  margin-top: var(--space-9);
}
.slg-pdp__related-heading {
  font-size: var(--text-display-4);
  margin-bottom: var(--space-5);
}
.slg-pdp__related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
.slg-pdp__back-row {
  margin-top: var(--space-7);
}
.slg-pdp__back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--text-muted);
}

@media (max-width: 1023px) {
  .slg-pdp__grid {
    grid-template-columns: 1fr;
  }
  .slg-pdp__visual-col {
    position: static;
  }
  .slg-pdp__related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  /*
   * A wrapped grid of thumbs competes with the hero for width on narrow
   * screens; a single scrollable row keeps the hero full-width and the
   * thumbs reachable by swipe, same pattern as the native WC gallery.
   */
  .slg-pdp__gallery {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .slg-pdp__gallery::-webkit-scrollbar {
    display: none;
  }
  .slg-pdp__gallery-thumb {
    width: 48px;
    height: 60px;
  }
}
@media (max-width: 479px) {
  .slg-pdp__related-grid {
    grid-template-columns: 1fr;
  }
}

/*
 * Native WooCommerce variation form, restyled to match
 * app/src/pages/ProductDetail.module.css .sizeBlock/.sizeLabel — the
 * select stays in the DOM (visually-hidden once
 * assets/js/variation-swatches.js builds swatch buttons for it) so the
 * form remains fully functional with JS disabled or before enhancement
 * runs.
 */
.slg-pdp .variations_form.cart,
.slg-pdp form.cart:not(.variations_form) {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-w) solid var(--border-default);
}
.slg-pdp table.variations {
  width: 100%;
  border: none;
  margin: 0;
}
.slg-pdp .variations tbody,
.slg-pdp .variations tr {
  display: block;
}
.slg-pdp .variations tr + tr {
  margin-top: var(--space-3);
}
.slg-pdp .variations td,
.slg-pdp .variations th {
  padding: 0;
  border: none;
  display: block;
}
.slg-pdp .variations td.label label {
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  font-size: var(--text-label);
  color: var(--text-muted);
}
.slg-pdp .reset_variations {
  display: inline-block;
  margin-top: var(--space-1);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
/*
 * The selected variation's price is synced into #slg-pdp-price instead
 * (assets/js/variation-swatches.js, found_variation/reset_data) so there
 * is one visible price, not two — this native block still renders (and
 * still holds the real data WooCommerce computed) but stays off-screen.
 */
.slg-pdp .woocommerce-variation-price {
  display: none;
}
.slg-pdp .woocommerce-variation-availability {
  font-family: var(--font-mono);
}
.slg-pdp .woocommerce-variation {
  margin-bottom: var(--space-3);
}
/*
 * Quantity + Add to cart are the final decision in the purchasing flow —
 * grouping them on one row (qty fixed-width, button filling the rest)
 * separates "choose options" from "commit" more clearly than WooCommerce's
 * default stacked markup.
 */
.slg-pdp .woocommerce-variation-add-to-cart,
.slg-pdp form.cart:not(.variations_form) {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: var(--space-3);
}
.slg-pdp .quantity {
  flex: 0 0 auto;
}
.slg-pdp .quantity .qty {
  height: 100%;
  min-width: 64px;
}
.slg-pdp .single_add_to_cart_button {
  flex: 1 1 auto;
  width: 100%;
}
