/* Single product — Apple Store configurator layout */

body.bth-apple-product {
  background: #fff;
  color: #1d1d1f;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.bth-apple-product .bth-apple-main.bth-product-main {
  width: 100%;
  max-width: 100%;
  padding-bottom: 0;
}

body.bth-apple-product .bth-apple-footer {
  margin-top: 0;
}

/* Newsletter — same spacing as Home / Shop */
body.bth-apple-product .bth-apple-main > .newsletter-band {
  margin-top: clamp(24px, 4vw, 40px);
}

.bth-product-shell {
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 56px) 0 clamp(28px, 4vw, 40px);
}

.bth-product-back {
  margin: 0 0 clamp(20px, 3vw, 28px);
}

.bth-product-back__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.bth-product-back__link::before {
  content: '‹';
  font-size: 20px;
  line-height: 1;
  color: #86868b;
}

.bth-product-back__link:hover,
.bth-product-back__link:focus-visible {
  background: transparent !important;
  border: 0 !important;
  color: #b91c1c !important;
  text-decoration: none !important;
  transform: none;
}

.bth-product-back__link:hover::before {
  color: #b91c1c;
}

.bth-product__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.bth-product__gallery {
  min-width: 0;
  padding: clamp(8px, 1.2vw, 12px);
  background: #f5f5f7;
  border-radius: 18px;
}

.bth-product__gallery .woocommerce-product-gallery {
  margin: 0;
  width: 100% !important;
  opacity: 1 !important;
}

.bth-product-gallery__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(320px, 45vw, 520px);
  padding: clamp(12px, 2vw, 20px);
}

.bth-product-gallery__hero {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(320px, 45vw, 520px);
  object-fit: contain;
  object-position: center;
}

.bth-product__gallery .flex-viewport.is-bth-hidden,
.bth-product__gallery .woocommerce-product-gallery__trigger.is-bth-hidden,
.bth-product__gallery .woocommerce-product-gallery__image.is-bth-hidden {
  display: none !important;
}

.bth-product__gallery .woocommerce-product-gallery[data-bth-gallery-init] .flex-viewport {
  display: none !important;
}

.bth-product__gallery .flex-viewport {
  width: 100% !important;
  overflow: hidden;
}

.bth-product__gallery .woocommerce-product-gallery__wrapper {
  margin: 0;
}

/* Before custom gallery init — only first image */
.bth-product__gallery .woocommerce-product-gallery:not([data-bth-gallery-init]) .woocommerce-product-gallery__wrapper:not(.gallery-ready) .woocommerce-product-gallery__image:not(:first-child) {
  display: none !important;
}

.bth-product__gallery .flex-viewport .woocommerce-product-gallery__image a {
  display: block;
  width: 100%;
}

.bth-product__gallery .flex-viewport .woocommerce-product-gallery__image img,
.bth-product__gallery .woocommerce-product-gallery__image--placeholder img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: contain;
  object-position: center;
}

.bth-product__gallery .flex-control-thumbs,
.bth-product__gallery .bth-product-gallery__thumbs {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.bth-product__gallery .flex-control-thumbs li {
  width: 56px;
  margin: 0;
}

.bth-product__gallery .flex-control-thumbs li img {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: contain;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  opacity: 0.65;
  transition: border-color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.bth-product__gallery .flex-control-thumbs li img.flex-active,
.bth-product__gallery .flex-control-thumbs li img:hover {
  border-color: #86868b !important;
  background: #fff !important;
  opacity: 1;
}

.bth-product__config {
  position: sticky;
  top: calc(var(--bth-header-height, 64px) + 16px);
  min-width: 0;
}

.bth-product__series {
  display: inline-block;
  margin: 0 0 8px;
  color: #86868b;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

a.bth-product__series:hover {
  color: #b91c1c;
}

.bth-product__title {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 600;
}

.bth-product__sku {
  margin: 10px 0 0;
  color: #86868b;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.bth-product__pack {
  margin: 8px 0 0;
  color: #86868b;
  font-size: 13px;
  font-weight: 500;
}

.bth-product__lead {
  margin: 14px 0 0;
  color: #6e6e73;
  font-size: 15px;
  line-height: 1.55;
}

.bth-product__lead p {
  margin: 0;
}

.bth-product__configurator {
  margin-top: clamp(20px, 3vw, 28px);
  padding-top: clamp(18px, 2.5vw, 24px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.bth-product__configurator form.cart {
  margin: 0;
}

.bth-product__configurator table.variations {
  display: none;
}

.bth-product__configurator .bth-config-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bth-config-group__label {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: #1d1d1f;
}

.bth-config-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bth-config-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1.5px solid #d2d2d7;
  border-radius: 12px;
  background: #fff !important;
  color: #1d1d1f !important;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  box-shadow: none !important;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.bth-config-option:hover,
.bth-config-option:focus-visible {
  border-color: #86868b !important;
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
}

.bth-config-option.is-selected {
  border-color: #b91c1c !important;
  background: #fef2f2 !important;
  color: #991b1b !important;
  font-weight: 600;
  box-shadow: none !important;
}

.bth-config-option[hidden],
.bth-config-option.is-unavailable {
  display: none !important;
}

.bth-config-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.18) !important;
}

.bth-product__configurator .reset_variations {
  display: inline-block;
  margin: 8px 0 0;
  font-size: 13px;
  color: #6e6e73 !important;
  text-decoration: none;
}

.bth-product__configurator .reset_variations:hover {
  color: #b91c1c !important;
  text-decoration: underline;
}

.bth-product__configurator .reset_variations[style*="hidden"] {
  display: none !important;
}

.bth-product__configurator .single_variation_wrap {
  margin-top: 20px;
}

/* Keep Woo variation data for JS, hide inside form */
.bth-product__configurator .woocommerce-variation-price,
.bth-product__configurator .woocommerce-variation-availability,
.bth-product__configurator form.cart > .stock,
.bth-product__configurator .woocommerce-variation-description {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bth-product__configurator .woocommerce-variation.single_variation:empty {
  display: none;
}

.bth-product__configurator label[for*='quantity'],
.bth-product__configurator label[for*='qty'],
.bth-product__configurator .quantity label,
.bth-product__configurator form.cart > label,
.bth-product__configurator .woocommerce-variation-add-to-cart > label,
.bth-product__configurator .quantity-label {
  display: none !important;
}

.bth-product__configurator form.cart > .quantity:not(.bth-product__purchase .quantity) {
  display: none !important;
}

.bth-product__purchase {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bth-product__purchase-qty {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bth-product__purchase-qty::before {
  content: 'Quantity';
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  flex-shrink: 0;
}

/* Parent theme .single-product .quantity::before also outputs "Quantity" — suppress duplicate */
body.bth-apple-product .bth-product__configurator .quantity::before,
body.bth-apple-product.single-product .quantity::before,
body.bth-apple-product .single-product .quantity::before {
  content: none !important;
  display: none !important;
}

.bth-product__purchase-qty > label,
.bth-product__purchase-qty > span:not(.bth-qty-stepper) {
  display: none !important;
}

.bth-product__purchase-qty-label {
  display: none !important;
}

.bth-product__purchase-btn {
  width: 100%;
}

.bth-product__configurator .quantity {
  margin: 0;
}

.bth-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.bth-qty-stepper__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent !important;
  color: #1d1d1f !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none !important;
}

.bth-qty-stepper__btn:hover:not(:disabled),
.bth-qty-stepper__btn:focus:not(:disabled) {
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
}

.bth-qty-stepper__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bth-qty-stepper__input {
  width: 44px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: none !important;
  border-left: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 0 !important;
  background: #fff !important;
  font-size: 15px !important;
  font-weight: 500;
  text-align: center;
  box-shadow: none !important;
  appearance: textfield;
}

.bth-product__configurator .single_add_to_cart_button,
.bth-product__configurator button.single_add_to_cart_button.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 22px !important;
  border: 0 !important;
  border-radius: 980px !important;
  background: #b91c1c !important;
  color: #fff !important;
  font: inherit !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background 0.2s ease;
}

.bth-product__configurator .single_add_to_cart_button:hover,
.bth-product__configurator button.single_add_to_cart_button.button:hover,
.bth-product__configurator .single_add_to_cart_button:focus,
.bth-product__configurator button.single_add_to_cart_button.button:focus {
  background: #991b1b !important;
  color: #fff !important;
}

.bth-product__checkout-meta {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bth-product__checkout-meta:empty,
.bth-product__checkout-meta:not(:has(.price, .stock)) {
  display: none;
}

.bth-product__price,
#bth-product-price-display {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.bth-product__price .price,
#bth-product-price-display .price {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: #b91c1c !important;
}

.bth-product__price .amount,
#bth-product-price-display .amount,
.bth-product__price bdi,
#bth-product-price-display bdi {
  color: #b91c1c !important;
}

.bth-product__price-note {
  font-size: 12px;
  font-weight: 400;
  color: #86868b;
  letter-spacing: 0;
  line-height: 1.4;
}

.bth-product__price del,
#bth-product-price-display del {
  font-size: 18px;
  color: #86868b;
  font-weight: 400;
}

.bth-product__stock,
#bth-product-stock-display {
  margin: 6px 0 0;
}

.bth-product__stock .stock,
#bth-product-stock-display .stock {
  margin: 0;
  font-size: 13px;
  color: #86868b;
  line-height: 1.45;
}

.bth-product__stock .stock.in-stock,
#bth-product-stock-display .stock.in-stock {
  color: #15803d;
}

.bth-product__meta {
  margin-top: clamp(24px, 3vw, 32px);
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: #86868b;
  font-size: 12px;
  line-height: 1.5;
}

.bth-product__meta a {
  color: inherit;
  text-decoration: none;
}

.bth-product__meta a:hover {
  color: #b91c1c;
}

.bth-product__details {
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: clamp(32px, 5vw, 48px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.bth-product__details h2 {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 600;
  letter-spacing: -0.022em;
}

.bth-product__description.entry-content {
  max-width: 720px;
  color: #424245;
  font-size: 16px;
  line-height: 1.65;
}

.bth-product-related {
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: clamp(32px, 5vw, 48px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.bth-product-related section.related.products {
  margin: 0;
  padding: 0;
}

.bth-product-related section.related.products > h2 {
  margin: 0 0 24px;
  font-size: clamp(22px, 2.8vw, 28px);
  font-weight: 600;
  letter-spacing: -0.022em;
}

.bth-product-related ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bth-product-related ul.products::before,
.bth-product-related ul.products::after {
  display: none;
}

.bth-product-related ul.products > li.product {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Kill theme/Woo pink hovers on product page */
body.bth-apple-product .bth-config-option,
body.bth-apple-product .bth-qty-stepper__btn,
body.bth-apple-product .bth-shop-card,
body.bth-apple-product .bth-shop-card__title a,
body.bth-apple-product .bth-shop-card__btn,
body.bth-apple-product input,
body.bth-apple-product select,
body.bth-apple-product button {
  -webkit-tap-highlight-color: transparent;
}

body.bth-apple-product .bth-shop-card:hover {
  border-color: rgba(185, 28, 28, 0.22) !important;
  background: #fff !important;
}

body.bth-apple-product .bth-shop-card__title a:hover {
  color: #b91c1c !important;
}

body.bth-apple-product .bth-shop-card__btn:hover,
body.bth-apple-product .bth-shop-card__btn.button:hover {
  background: #991b1b !important;
  color: #fff !important;
}

@media (max-width: 980px) {
  .bth-product__stage {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .bth-product__config {
    position: static;
    top: auto;
  }

  .bth-product-related ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .bth-product-shell {
    width: min(100%, 94vw);
  }

  .bth-product-related ul.products {
    grid-template-columns: 1fr;
  }

  .bth-product-toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: translateY(120%);
  }

  .bth-product-toast.is-visible {
    transform: translateY(0);
  }
}

/* Hide default WooCommerce add-to-cart banner on product page */
body.bth-apple-product .bth-product-shell .woocommerce-notices-wrapper,
body.bth-apple-product .bth-product-shell .woocommerce-message,
body.bth-apple-product .bth-product-main > .woocommerce-notices-wrapper {
  display: none !important;
}

.bth-product-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 120%);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}

.bth-product-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.bth-product-toast__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ecfdf3;
  color: #15803d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.bth-product-toast__body {
  flex: 1;
  min-width: 0;
}

.bth-product-toast__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.3;
}

.bth-product-toast__name {
  margin: 2px 0 0;
  font-size: 13px;
  color: #6e6e73;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bth-product-toast__action {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 980px;
  background: #b91c1c;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.18s ease;
}

.bth-product-toast__action:hover,
.bth-product-toast__action:focus-visible {
  background: #991b1b;
  color: #fff !important;
}

.bth-product-toast__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #86868b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.bth-product-toast__close:hover,
.bth-product-toast__close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}
