/* Shared layout. Product variation values remain managed by WooCommerce. */
body.single-product.cwlb-layout-ready {
  --cwlb-layout-red: #e52231;
  --cwlb-layout-border: #37383b;
}

body.single-product.cwlb-layout-ready .cwlb-redundant-badges,
body.single-product.cwlb-layout-ready .wd-products-nav,
body.single-product.cwlb-layout-ready .cwlb-perks { display: none !important; }

body.single-product.cwlb-has-assurance .dark-trust-wrapper { display: none !important; }

/* Keep the purchase area focused; product data and navigation remain in WooCommerce. */
body.single-product.cwlb-layout-ready .summary-inner .product_meta,
body.single-product.cwlb-layout-ready .summary-inner .product-share,
body.single-product.cwlb-layout-ready .summary-inner .wd-compare-btn,
body.single-product.cwlb-layout-ready .summary-inner .wd-wishlist-btn,
body.single-product.cwlb-layout-ready .wd-sticky-btn-actions .wd-compare-btn,
body.single-product.cwlb-layout-ready .wd-sticky-btn-actions .wd-wishlist-btn,
body.single-product.cwlb-layout-ready .wd-buy-now-btn {
  display: none !important;
}

/* Restore WoodMart's earlier green call to action while keeping red accents. */
body.single-product.postid-14937.cwlb-layout-ready .summary-inner .single_add_to_cart_button,
body.single-product.postid-14937.cwlb-layout-ready .cwlb-mobile-cta button {
  background: #83b735 !important;
  border-color: #83b735 !important;
  color: #fff !important;
}

body.single-product.postid-14937.cwlb-layout-ready .summary-inner .single_add_to_cart_button:hover,
body.single-product.postid-14937.cwlb-layout-ready .cwlb-mobile-cta button:hover {
  background: #719f2e !important;
  border-color: #719f2e !important;
}

body.single-product.cwlb-layout-ready .cwlb-top-breadcrumb {
  display: block;
  margin: 0 0 16px;
  color: #aeb0b5;
  font-size: 12px;
  line-height: 1.45;
}

body.single-product.cwlb-layout-ready .cwlb-top-breadcrumb .wd-breadcrumbs {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.single-product.cwlb-layout-ready .cwlb-top-breadcrumb a { color: #c7c9cd; }
body.single-product.cwlb-layout-ready .cwlb-top-breadcrumb a:hover { color: #fff; }

/* Five visible thumbnail slots bring three gallery images down to ~70px on phones. */
body.single-product .wd-gallery-thumb .wd-carousel {
  --wd-col-lg: 7 !important;
  --wd-col-md: 7 !important;
  --wd-col-sm: 5 !important;
}

body.single-product.cwlb-layout-ready .wd-gallery-thumb .wd-carousel-item {
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--cwlb-layout-border);
  border-radius: 7px;
}

body.single-product.cwlb-layout-ready .wd-gallery-thumb .wd-carousel-item.wd-thumb-active {
  border-color: var(--cwlb-layout-red);
}

body.single-product.cwlb-layout-ready .wd-gallery-thumb .wd-carousel-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Hide the theme's extra enlarge control while keeping images and thumbnails usable. */
body.single-product.cwlb-layout-ready .product-additional-galleries {
  display: none !important;
}

body.single-product.cwlb-layout-ready .woocommerce-product-gallery {
  gap: 6px;
}

/* A portrait size-chart slide must not increase the height of the whole gallery. */
body.single-product.cwlb-layout-ready .wd-gallery-images .wd-carousel-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

/* Restyle the native quantity input without replacing its WooCommerce behavior. */
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity {
  display: inline-flex;
  align-items: stretch;
  width: 132px;
  height: 48px;
  overflow: hidden;
  border: 1px solid #51545a;
  border-radius: 10px;
  background: #191a1d;
}

body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .minus,
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .plus,
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity input.qty {
  height: 46px;
  min-height: 46px;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .minus,
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .plus {
  flex: 0 0 40px;
  width: 40px;
  padding: 0;
  color: #f3f3f4;
  font-size: 19px;
  font-weight: 500;
  cursor: pointer;
}

body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity input.qty {
  flex: 1 1 auto;
  min-width: 0;
  width: 50px;
  padding: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .minus:hover,
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .plus:hover {
  background: #292b2f !important;
  color: #fff;
}

body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .minus:focus-visible,
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity .plus:focus-visible,
body.single-product.cwlb-layout-ready .summary-inner form.cart .quantity input.qty:focus-visible {
  outline: 2px solid #e52231;
  outline-offset: -3px;
}

body.single-product.cwlb-layout-ready .cwlb-assurance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 17px 0 22px;
  padding: 13px 0;
  border-top: 1px solid var(--cwlb-layout-border);
  border-bottom: 1px solid var(--cwlb-layout-border);
  background: #191a1c;
}

body.single-product.cwlb-layout-ready .cwlb-assurance-item {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 0 7px;
  color: #f2f2f3;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 650;
  text-align: center;
}

body.single-product.cwlb-layout-ready .cwlb-assurance-item + .cwlb-assurance-item {
  border-left: 1px solid var(--cwlb-layout-border);
}

body.single-product.cwlb-layout-ready .cwlb-assurance-item svg {
  flex: 0 0 auto;
  color: var(--cwlb-layout-red);
}

body.single-product.cwlb-layout-ready form.variations_form .cwlb-size-guide {
  display: inline-block;
  margin-left: 9px;
  color: #fff;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.single-product.cwlb-layout-ready .cwlb-addon-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin: 12px 0 0;
  padding: 10px 15px;
  border: 1px solid var(--cwlb-layout-border);
  border-radius: 8px 8px 0 0;
  background: #181a1d;
  color: #fff;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

body.single-product.cwlb-layout-ready .cwlb-optional-block > .prad-section-header {
  display: none !important;
}

body.single-product.cwlb-layout-ready .cwlb-optional-block .prad-section-body {
  border: 1px solid var(--cwlb-layout-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
}

body.single-product.cwlb-layout-ready .cwlb-optional-block:not(.cwlb-open) .prad-section-body {
  display: none !important;
  max-height: 0 !important;
}

body.single-product.cwlb-layout-ready .cwlb-optional-block.cwlb-open .prad-section-body {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
}

body.single-product.cwlb-layout-ready .cwlb-addon-toggle:focus-visible,
body.single-product.cwlb-layout-ready .cwlb-size-guide:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Match the already approved Goku swatches on other variable products. */
@media (max-width: 767px) {
  body.single-product.cwlb-layout-ready .cwlb-top-breadcrumb { margin-bottom: 10px; }
  body.single-product.cwlb-layout-ready .product-image-summary-inner { row-gap: 14px; }
  body.single-product.cwlb-layout-ready .wd-gallery-thumb { margin-top: 8px; }
  body.single-product.cwlb-layout-ready .wd-gallery-thumb .wd-carousel-item { min-width: 44px; }

  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_size"],
  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_thickness"],
  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_buckle-type"] {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_size"] .wd-swatch,
  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_thickness"] .wd-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 7px 10px;
    margin: 0;
    border: 1px solid var(--cwlb-layout-border);
    border-radius: 7px;
    font-size: 13px;
  }

  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_buckle-type"] .wd-swatch {
    display: flex;
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    max-width: calc(33.333% - 6px);
    min-height: 112px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 7px 3px;
    border: 1px solid var(--cwlb-layout-border);
    border-radius: 7px;
  }

  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_buckle-type"] .wd-swatch-bg {
    display: block;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
  }

  body.single-product.cwlb-layout-ready form.variations_form .wd-swatches-product[data-id="pa_buckle-type"] .wd-swatch-text {
    display: block !important;
    position: static !important;
    width: 100%;
    white-space: normal !important;
    line-height: 1.2;
    font-size: 11px;
    text-align: center;
  }

  body.single-product.cwlb-layout-ready .cwlb-assurance-item { font-size: 11px; }
}
