/* BE-CLONE — Single Product
   Gate C: Above-the-fold layout (60/40 Shopify-like)
   Evidence: /evidence/shopify/screens/single-abovefold-1440.png
   ========================================= */

/* ── Isolate from Blocksy/Woo product layout ── */
.be-single-wrap {
  display: block;
  width: 100%;
}

.be-single-wrap .be-product {
  display: block;
  float: none;
  width: 100%;
  max-width: 100%;
}

.be-single-wrap div.images,
.be-single-wrap div.summary {
  float: none;
  width: 100%;
}

/* ── Above-the-fold Grid (60/40) ── */
.be-product__grid {
  display: grid;
  grid-template-columns: 60% 1fr;
  column-gap: 48px;
  align-items: start;
  padding-top: 24px;
  padding-bottom: 48px;
}

.be-product__media {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
}

.be-product__summary {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding-top: 8px;
}

/* ── BE Product Gallery (C3.1) ── */
.be-product-gallery {
  width: 100%;
  position: relative;
}

.be-product-gallery__main {
  background: #f6f6f6;
  overflow: hidden;
  position: relative;
  aspect-ratio: 3 / 4;
}

.be-product-gallery__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: opacity 150ms ease;
}

/* Arrows */
.be-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.be-gallery-arrow svg {
  width: 18px;
  height: 18px;
  stroke: #333;
  fill: none;
  stroke-width: 2;
}

.be-gallery-arrow--prev { left: 16px; }
.be-gallery-arrow--next { right: 16px; }

.be-product-gallery__main:hover .be-gallery-arrow {
  opacity: 1;
}

.be-gallery-arrow:hover {
  background: #f5f5f5;
}

/* Thumbs */
.be-product-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.be-product-gallery__thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f6f6f6;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color var(--dur-fast) var(--ease),
              opacity var(--dur-fast) var(--ease);
  opacity: 0.6;
}

.be-product-gallery__thumb:hover {
  opacity: 1;
}

.be-product-gallery__thumb.is-active {
  border-color: #000;
  opacity: 1;
}

/* ── Breadcrumb ── */
.be-product__summary .woocommerce-breadcrumb {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.be-product__summary .woocommerce-breadcrumb a {
  color: var(--color-text-light);
  text-decoration: none;
}

.be-product__summary .woocommerce-breadcrumb a:hover {
  color: var(--color-text);
}

/* ── Title (Shopify: ~28px, weight 600) ── */
.be-product .product_title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--ls-heading);
  text-transform: var(--caps-heading);
  line-height: 1.1;
  color: var(--color-heading);
  margin: 0 0 10px;
}

/* ── Price (compact) ── */
.be-product p.price,
.be-product .price {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  margin: 0 0 16px;
}

.be-product .price del {
  opacity: 0.6;
  margin-right: 6px;
}

.be-product .price ins {
  text-decoration: none;
  color: var(--color-sale);
}

/* ── Add to Cart form ── */
.be-product__summary .cart {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.be-product__summary .cart .quantity {
  width: 80px;
}

.be-product__summary .cart .quantity input.qty {
  width: 100%;
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
}

.be-product__summary .cart .single_add_to_cart_button {
  flex: 1;
  min-height: 52px;
  font-weight: var(--font-weight-medium);
}

/* ── Sold Out / CTA Buttons ── */
.be-btn--full {
  display: block;
  width: 100%;
  padding: 16px 24px;
  min-height: 52px;
  font-family: var(--font-button);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.96px;
  text-transform: var(--caps-button);
  text-align: center;
  border: none;
  border-radius: var(--radius-btn, 10px);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.be-btn--primary {
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
}

.be-btn--primary:hover {
  opacity: 0.85;
}

.be-btn--soldout {
  background: #e8e8e8;
  color: var(--color-text-light);
  cursor: not-allowed;
  margin-bottom: 24px;
}

/* ── Product Form: Selects, Inputs, Labels (Shopify HulkApps parity) ── */
.be-product__summary select,
.be-product__summary .variations select,
.be-product__summary input[type="text"],
.be-product__summary input[type="number"],
.be-product__summary textarea {
  width: 100%;
  border: 1px solid #dadada;
  border-radius: var(--radius, 8px);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text);
  background: #fff;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 42px;
  box-shadow: none;
}

/* Native selects can clip text with some webfonts; use stable control metrics. */
.be-product__summary select,
.be-product__summary .variations select,
.be-product__summary .wapf-field-group select {
  min-height: 52px;
  height: 52px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.be-product__summary select:focus,
.be-product__summary input:focus,
.be-product__summary textarea:focus {
  border-color: var(--color-accent);
  outline: none;
}

.be-product__summary label,
.be-product__summary .variations .label,
.be-product__summary .variations label {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  line-height: 25px;
  color: var(--color-text);
  display: block;
  margin-bottom: 6px;
}

.be-product__summary .variations {
  margin-bottom: 16px;
}

.be-product__summary .variations tr {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.be-product__summary .variations td {
  padding: 0;
}

.be-product__summary .variations th.label {
  padding: 0;
  text-align: left;
}

.be-product__summary .variations .reset_variations {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-light);
  text-decoration: underline;
  margin-top: 4px;
  display: inline-block;
}

/* ── Variable product: single_variation_wrap ── */
.be-product__summary .single_variation_wrap {
  margin-top: 16px;
}

.be-product__summary .single_variation_wrap .woocommerce-variation-price {
  margin-bottom: 12px;
}

.be-product__summary .single_variation_wrap .woocommerce-variation-add-to-cart {
  display: flex;
  gap: 12px;
  align-items: center;
}

.be-product__summary .single_variation_wrap .woocommerce-variation-add-to-cart .quantity {
  width: 80px;
}

.be-product__summary .single_variation_wrap .woocommerce-variation-add-to-cart .quantity input.qty {
  width: 100%;
  text-align: center;
  padding: 12px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 8px);
  font-family: var(--font-body);
  font-size: 14px;
}

.be-product__summary .single_variation_wrap .single_add_to_cart_button {
  flex: 1;
  min-height: 52px;
  font-weight: var(--font-weight-medium);
  background: var(--color-btn-bg);
  color: var(--color-btn-text);
  border: none;
  border-radius: var(--radius-btn, 10px);
  font-family: var(--font-button);
  font-size: 13px;
  letter-spacing: 0.96px;
  text-transform: var(--caps-button);
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease);
}

.be-product__summary .single_variation_wrap .single_add_to_cart_button:hover {
  opacity: 0.85;
}

.be-product__summary .single_variation_wrap .single_add_to_cart_button:disabled {
  background: #e8e8e8;
  color: var(--color-text-light);
  cursor: not-allowed;
}

/* ── APF (Advanced Product Fields) add-ons styling ── */
.be-product__summary .wapf-field-group {
  margin-bottom: 16px;
}

.be-product__summary .wapf-field-group .wapf-field-label {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  line-height: 25px;
  color: var(--color-text);
  margin-bottom: 6px;
}

.be-product__summary .wapf-field-group select {
  width: 100%;
  border: 1px solid #dadada;
  border-radius: var(--radius, 8px);
  padding: 0 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  min-height: 52px;
}

.be-product__summary .wapf-field-group input[type="text"] {
  width: 100%;
  border: 1px solid #dadada;
  border-radius: var(--radius, 8px);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 42px;
}

/* ── APF totals ── */
.be-product__summary .wapf-product-totals {
  margin: 16px 0;
  font-family: var(--font-body);
  font-size: 14px;
  border-top: 1px solid #e6e6e6;
  padding-top: 12px;
}

@media (max-width: 768px) {
  .be-product__summary .single_variation_wrap .woocommerce-variation-add-to-cart {
    flex-direction: column;
  }

  .be-product__summary .single_variation_wrap .woocommerce-variation-add-to-cart .quantity {
    width: 100%;
  }
}

/* ── Short Description / Excerpt ── */
.be-product__excerpt {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  margin-top: 24px;
}

.be-product__excerpt p:first-child {
  font-weight: var(--font-weight-bold);
  font-size: 16px;
  margin-bottom: 8px;
}

.be-product__excerpt p {
  margin: 0 0 12px;
}

/* ── Hide unwanted Woo elements ── */
.be-product .product_meta,
.be-product .posted_in,
.be-product .tagged_as,
.be-product .woocommerce-product-rating {
  display: none;
}

/* Sale flash inside media */
.be-product__media .onsale {
  display: none;
}

/* ── Gallery mobile: arrows always visible, smaller ── */
@media (max-width: 768px) {
  .be-gallery-arrow {
    opacity: 1;
    width: 36px;
    height: 36px;
  }

  .be-gallery-arrow svg {
    width: 14px;
    height: 14px;
  }

  .be-gallery-arrow--prev { left: 8px; }
  .be-gallery-arrow--next { right: 8px; }

  .be-product-gallery__thumb {
    width: 56px;
    height: 56px;
  }
}

/* ── Mobile (single column) ── */
@media (max-width: 768px) {
  .be-product__grid {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 16px;
    padding-top: 0;
    padding-bottom: 32px;
  }

  .be-product__media {
    grid-column: 1;
    grid-row: 1;
  }

  .be-product__summary {
    grid-column: 1;
    grid-row: 2;
    padding: 0 var(--gutter-mobile);
  }

  .be-product .product_title {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .be-product p.price,
  .be-product .price {
    margin-bottom: 12px;
  }

  .be-product__summary .cart {
    flex-direction: column;
  }

  .be-product__summary .cart .quantity {
    width: 100%;
  }

  .be-btn--full {
    padding: 14px 20px;
  }
}

/* ── Tabs (C3.2) ── */
.be-tabs {
  margin-top: 48px;
  padding: 0 32px;
  max-width: var(--site-width);
  margin-left: auto;
  margin-right: auto;
}

.be-tabs__nav {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid #e6e6e6;
}

.be-tabs__btn {
  appearance: none;
  background: none;
  border: none;
  padding: 14px 0;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
  cursor: pointer;
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}

.be-tabs__btn:hover {
  color: var(--color-text);
}

.be-tabs__btn.is-active {
  color: var(--color-text);
}

.be-tabs__btn.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #000;
}

.be-tabs__panel {
  padding: 24px 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}

.be-tabs__panel[hidden] {
  display: none;
}

.be-tabs__panel h2 {
  display: none;
}

.be-tabs__panel p {
  margin: 0 0 16px;
}

.be-tabs__panel table {
  width: 100%;
  border-collapse: collapse;
}

.be-tabs__panel table th,
.be-tabs__panel table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e6e6e6;
  text-align: left;
  font-size: 13px;
}

.be-tabs__panel table th {
  font-weight: 600;
  width: 35%;
}

/* Hide legacy Woo tabs if they leak through */
.woocommerce-tabs.wc-tabs-wrapper {
  display: none;
}

@media (max-width: 768px) {
  .be-tabs {
    padding: 0 var(--gutter-mobile);
    margin-top: 32px;
  }

  .be-tabs__nav {
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .be-tabs__nav::-webkit-scrollbar {
    display: none;
  }

  .be-tabs__btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ── Related Products (C3.3 — compact) ── */
.be-related {
  margin-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid #e6e6e6;
}

.be-related__heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  text-align: center;
  margin: 36px 0 28px;
  color: var(--color-heading);
}

.be-related__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Hide legacy Woo related if it leaks */
.be-product .related.products {
  display: none;
}

@media (max-width: 768px) {
  .be-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    row-gap: 24px;
  }

  .be-related__heading {
    font-size: 16px;
    margin: 32px 0 24px;
  }
}

/* ── Below-the-fold wrapper ── */
.be-product__below-fold {
  margin-top: 0;
}

.be-product__below-fold:empty {
  display: none;
}

/* ── Metrics (C3.4 — compact, Shopify parity) ── */
.be-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 28px 0;
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid #e6e6e6;
  border-bottom: 1px solid #e6e6e6;
}

.be-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.be-metric__icon {
  font-size: 22px;
  line-height: 1;
}

.be-metric__label {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  font-weight: 600;
}

.be-metric__value {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-light);
}

@media (max-width: 768px) {
  .be-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
    padding: 20px 0;
  }
}

/* ── Video Breakdown (C3.5 — less dominant) ── */
.be-video-section {
  margin: 28px 0;
}

.be-video-section__heading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 24px;
  color: var(--color-heading);
}

.be-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.be-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .be-video-section {
    margin: 24px 0;
  }

  .be-video-section__heading {
    font-size: 16px;
    margin-bottom: 16px;
  }
}
