/*
 * Build A Shelf Child — product.css
 * ----------------------------------------------------------------------------
 * Product detail page (upper): 2-column sticky layout, image gallery, info
 * panel (badges / title / rating / price), the dimension configurator (pill
 * buttons, finish swatches, quantity stepper), CTA stack, 2x2 trust grid, and
 * the quick-specs block.
 *
 * Companion to product-tabs.css (tabbed specs / reviews / related products);
 * split to keep each file under the 500-line cap. Both are enqueued by
 * functions.php.
 *
 * Source of truth: design/mockups/buildashelf-product-page_3.html
 * All colors/fonts reference :root tokens declared in style.css.
 * Selectors are .bas-* scoped to apply to WooCommerce/Elementor markup
 * without overriding The7 product templates globally.
 * ========================================================================== */

/* ==========================================================================
   PAGE TOP SPACING — trim The7's global 70px #main padding on product pages
   The7's custom.css sets #main { padding-top: 70px } site-wide; combined with
   the product container's own 40px top padding that reads as too much gap
   below the site header. Scope a tighter value to single-product pages only.
   ========================================================================== */

body.single-product #main {
  padding-top: 30px;
}

/* ==========================================================================
   PRODUCT LAYOUT — 2-col grid: sticky gallery (1fr) + 440px info panel
   ========================================================================== */

.bas-product-layout {
  max-width:             1200px;
  margin:                0 auto;
  padding:               40px 48px;
  display:               grid;
  grid-template-columns: 1fr 440px;
  gap:                   56px;
  align-items:           start;
}

/* Elementor renders this layout as a "full width" e-grid container, which
   applies .e-con-full (max-width: 100%) plus a zeroed --padding from the
   container's own padding control. Both override the plain .bas-product-layout
   class above, so the layout stretches edge-to-edge with no side padding and
   reads as misaligned against the full-width header. The .e-con-qualified
   selectors below match Elementor's specificity and win on source order:
   restore the mockup's 1200px centered content box and 40px/48px padding, and
   (separately) collapse the e-grid's forced 2-row template — the widget's
   "Rows" control leaves a full empty second row of dead space otherwise. */
.bas-product-layout.e-grid,
.bas-product-layout.e-con.e-grid {
  max-width:             1200px;
  margin:                0 auto;
  padding:               40px 48px;
  grid-template-rows:    auto;
  grid-template-columns: 1fr 440px;
  grid-auto-rows:        auto;
  align-items:           start;
  gap:                   56px;
}

/* ==========================================================================
   IMAGE GALLERY — main image sticks below the sticky nav (66px + offset)
   ========================================================================== */

.bas-gallery {
  position: sticky;
  top:      84px;
}

.bas-gallery__main {
  background:      var(--linen);
  border:          0.5px solid var(--linen-dark);
  border-radius:   14px;
  aspect-ratio:    1;
  display:         flex;
  align-items:     center;
  justify-content: center;
  overflow:        hidden;
  margin-bottom:   12px;
}

.bas-gallery__thumbs {
  display:               grid;
  grid-template-columns: repeat(4, 1fr);
  gap:                   8px;
}

.bas-gallery__thumb {
  background:      var(--linen);
  border:          1.5px solid transparent;
  border-radius:   8px;
  aspect-ratio:    1;
  display:         flex;
  align-items:     center;
  justify-content: center;
  overflow:        hidden;
  cursor:          pointer;
  transition:      border-color 0.15s ease;
}
.bas-gallery__thumb:hover      { border-color: var(--linen-dark); }
.bas-gallery__thumb.is-active  { border-color: var(--ink); }

/* ==========================================================================
   PRODUCT INFO — badges, title, subtitle, rating, price
   ========================================================================== */

.bas-product-info { padding-top: 4px; }

.bas-product-info__badges {
  display:       flex;
  flex-wrap:     wrap;
  gap:           8px;
  margin-bottom: 16px;
}

/* Pill badges — variant colors keyed off the design tokens. */
.bas-pill-badge {
  font-family:    var(--font-mono);
  font-size:      9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding:        4px 10px;
  border-radius:  20px;
}
.bas-pill-badge--usa   { background: #FAF0EE;          color: var(--rust);    border: 0.5px solid #E8C8C0; }
.bas-pill-badge--stock { background: var(--sage-light); color: #2E5038;       border: 0.5px solid #C0D4C4; }
.bas-pill-badge--nsf   { background: var(--linen);      color: var(--ink-mid); border: 0.5px solid var(--linen-dark); }

.bas-product-info__title {
  font-family:    var(--font-display);
  font-size:      32px;
  font-weight:    400;
  letter-spacing: -0.5px;
  line-height:    1.2;
  color:          var(--ink);
  margin-bottom:  10px;
}

.bas-product-info__subtitle {
  font-family:    var(--font-mono);
  font-size:      11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color:          var(--warm-mid);
  margin-bottom:  20px;
}

.bas-rating-row {
  display:       flex;
  align-items:   center;
  gap:           8px;
  margin-bottom: 24px;
}
.bas-rating-row__stars {
  color:          var(--terra);
  font-size:      14px;
  letter-spacing: 1px;
}
.bas-rating-row__count {
  font-family:    var(--font-mono);
  font-size:      11px;
  letter-spacing: 0.5px;
  color:          var(--warm-mid);
}
.bas-rating-row__count a {
  color:         var(--rust);
  border-bottom: 1px solid var(--blush);
}

.bas-price-row {
  display:       flex;
  align-items:   baseline;
  gap:           12px;
  margin-bottom: 8px;
}
.bas-price-row__current {
  font-family:    var(--font-display);
  font-size:      36px;
  letter-spacing: -1px;
  color:          var(--ink);
}
.bas-price-row__compare {
  font-family:     var(--font-body);
  font-weight:     300;
  font-size:       18px;
  color:           var(--warm-mid);
  text-decoration: line-through;
}
.bas-price-row__save {
  font-family:    var(--font-mono);
  font-size:      10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color:          var(--sage);
  background:     var(--sage-light);
  padding:        3px 8px;
  border-radius:  4px;
}
.bas-price-note {
  font-size:     12px;
  color:         var(--warm-mid);
  margin-bottom: 28px;
}

/* ==========================================================================
   CONFIGURATOR — dimension pills, finish swatches, quantity stepper
   ========================================================================== */

.bas-config { margin-bottom: 24px; }

/* Mono section label with the live-selected value rendered in DM Sans. */
.bas-config__label {
  font-family:     var(--font-mono);
  font-size:       10px;
  letter-spacing:  2px;
  text-transform:  uppercase;
  color:           var(--warm-mid);
  margin-bottom:   10px;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}
.bas-config__value {
  font-family:    var(--font-body);
  font-size:      13px;
  font-weight:    500;
  letter-spacing: 0;
  text-transform: none;
  color:          var(--ink);
}

.bas-config__options {
  display:   flex;
  flex-wrap: wrap;
  gap:       8px;
}

/* Pill button — mono dimension option; selected = ink fill / cream text. */
.bas-pill {
  font-family:    var(--font-mono);
  font-size:      11px;
  letter-spacing: 0.5px;
  padding:        8px 16px;
  border:         1px solid var(--linen-dark);
  border-radius:  6px;
  background:     var(--white);
  color:          var(--ink-mid);
  cursor:         pointer;
  transition:     background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bas-pill:hover {
  border-color: var(--chrome);
  background:   var(--linen);
}
.bas-pill.is-active {
  background:   var(--ink);
  border-color: var(--ink);
  color:        var(--cream);
}
.bas-pill.is-disabled {
  opacity: 0.35;
  cursor:  not-allowed;
}

/* Finish swatch chip — color circle + label; selected = ink border + bold. */
.bas-swatch {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       9px 14px;
  border:        1px solid var(--linen-dark);
  border-radius: 8px;
  background:    var(--white);
  font-family:   var(--font-body);
  font-size:     13px;
  color:         var(--ink-mid);
  cursor:        pointer;
  transition:    border-color 0.15s ease, color 0.15s ease;
}
.bas-swatch:hover { border-color: var(--chrome); }
.bas-swatch.is-active {
  border-color: var(--ink);
  color:        var(--ink);
  font-weight:  500;
}
.bas-swatch__chip {
  width:         18px;
  height:        18px;
  border-radius: 50%;
  border:        0.5px solid rgba(0, 0, 0, 0.1);
  flex-shrink:   0;
}

/* Quantity stepper — joined +/- controls around a mono value. */
.bas-qty-stepper {
  display:       flex;
  align-items:   center;
  width:         fit-content;
  border:        1px solid var(--linen-dark);
  border-radius: 8px;
  overflow:      hidden;
}
.bas-qty-stepper__btn {
  width:           40px;
  height:          40px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      var(--linen);
  border:          none;
  font-size:       18px;
  color:           var(--ink-mid);
  cursor:          pointer;
  transition:      background-color 0.15s ease;
}
.bas-qty-stepper__btn:hover { background: var(--linen-dark); }
.bas-qty-stepper__value {
  width:           48px;
  height:          40px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-family:     var(--font-mono);
  font-size:       14px;
  color:           var(--ink);
  border-left:     0.5px solid var(--linen-dark);
  border-right:    0.5px solid var(--linen-dark);
}

/* ==========================================================================
   CTA STACK — full-width Add to cart / Buy it now / Request a quote
   Uses the shared .bas-btn system from style.css with a full-width modifier.
   ========================================================================== */

.bas-cta-stack {
  display:        flex;
  flex-direction: column;
  gap:            10px;
  margin-bottom:  20px;
}
.bas-cta-stack .bas-btn { width: 100%; }

/* WooCommerce / Elementor add-to-cart widget — the core "Add to cart" button
   ships with The7/Elementor defaults (accent-gradient bg, Roboto, 1px radius).
   Restyle it to the brand primary CTA: rust fill, DM Sans 500, 8px radius.
   background-image is reset because The7's .accent-gradient body class paints
   the button via a gradient rather than background-color. */
.bas-cta-stack .elementor-add-to-cart,
.bas-cta-stack form.cart {
  width: 100%;
}
.bas-cta-stack .single_add_to_cart_button,
.bas-cta-stack button.single_add_to_cart_button,
.bas-cta-stack .elementor-add-to-cart .button.alt {
  display:          inline-flex;
  align-items:      center;
  justify-content:  center;
  width:            100%;
  font-family:      var(--font-body);
  font-size:        15px;
  font-weight:      500;
  letter-spacing:   0;
  text-transform:   none;
  line-height:      1.2;
  padding:          12px 24px;
  border:           1px solid var(--rust);
  border-radius:    8px;
  background-color: var(--rust);
  background-image: none;
  color:            #ffffff;
  box-shadow:       none;
  transition:       background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bas-cta-stack .single_add_to_cart_button:hover,
.bas-cta-stack button.single_add_to_cart_button:hover,
.bas-cta-stack .elementor-add-to-cart .button.alt:hover {
  background-color: var(--rust-soft);
  background-image: none;
  border-color:     var(--rust-soft);
  color:            #ffffff;
}

/* ==========================================================================
   TRUST GRID — 2x2 icon + copy blocks below the CTA stack
   ========================================================================== */

.bas-trust-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   10px;
  margin-bottom:         24px;
}

.bas-trust-grid__item {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       10px 12px;
  background:    var(--linen);
  border:        0.5px solid var(--linen-dark);
  border-radius: 8px;
}
.bas-trust-grid__icon {
  font-size:   16px;
  flex-shrink: 0;
}
.bas-trust-grid__text {
  font-size:   12px;
  color:       var(--ink-mid);
  line-height: 1.3;
}
.bas-trust-grid__text strong {
  display:     block;
  font-weight: 500;
  font-size:   12px;
  color:       var(--ink);
}

/* ==========================================================================
   QUICK SPECS — linen block, 2-col key/value list
   ========================================================================== */

.bas-specs-block {
  background:    var(--linen);
  border:        0.5px solid var(--linen-dark);
  border-radius: 10px;
  padding:       18px 20px;
  margin-bottom: 24px;
}

.bas-specs-block__title {
  font-family:    var(--font-mono);
  font-size:      9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color:          var(--warm-mid);
  margin-bottom:  12px;
}

.bas-specs-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   8px 16px;
}

.bas-spec-item {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         6px 0;
  border-bottom:   0.5px solid var(--linen-dark);
  font-size:       13px;
}
.bas-spec-item__key {
  color:     var(--warm-mid);
  font-size: 12px;
}
.bas-spec-item__val {
  font-family: var(--font-mono);
  font-size:   12px;
  font-weight: 500;
  color:       var(--ink);
}

/* ==========================================================================
   RESPONSIVE — product layout / gallery / info / configurator / trust / specs
   Mockups ship desktop-only; breakpoints below are authored for this theme.
   Tabs / reviews / related-product breakpoints live in product-tabs.css.
   ========================================================================== */

@media (max-width: 1024px) {
  .bas-product-layout,
  .bas-product-layout.e-grid,
  .bas-product-layout.e-con.e-grid { padding: 32px; gap: 40px; }
}

@media (max-width: 768px) {
  .bas-product-layout,
  .bas-product-layout.e-grid,
  .bas-product-layout.e-con.e-grid {
    grid-template-columns: 1fr;
    grid-template-rows:    auto;
    padding:               24px 20px;
    gap:                   32px;
  }
  .bas-gallery             { position: static; top: auto; }
  .bas-product-info__title { font-size: 27px; }
}

@media (max-width: 480px) {
  .bas-trust-grid { grid-template-columns: 1fr; }
  .bas-specs-grid { grid-template-columns: 1fr; }
}

