/*
 * YHN 4.0 — Single Product Page Conversion Redesign
 * Works cleanly BOTH with the preserved left category sidebar (default) AND optional 2-column mode.
 * Includes:
 *   1. Quiet Premium styling for the left category sidebar (#product-sidebar).
 *   2. Gallery & Buy Box balance without double borders.
 *   3. Visual Variant Swatch Cards with size hints + price/discount cues (inspired by lucyengraving.com).
 *   4. Delivery ETA + Freeship + Zalo CTA + Vietnamese Payment Badges strip.
 *   5. Compact mobile price & tidy "XÓA" reset pill.
 */

/* 1. Left Category Sidebar Polish (Preserved by default!) */
body.yhn-redesign-40.single-product #product-sidebar .widget,
body.yhn-redesign-40.single-product .product-page-aside .widget {
  background: var(--yhn-bg) !important;
  border: 1px solid var(--yhn-line) !important;
  border-radius: var(--yhn-radius-lg) !important;
  padding: 16px 14px !important;
  box-shadow: var(--yhn-shadow-sm) !important;
}

body.yhn-redesign-40.single-product #product-sidebar .widget-title,
body.yhn-redesign-40.single-product .product-page-aside .widget-title {
  color: var(--yhn-ink) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

body.yhn-redesign-40.single-product #product-sidebar .is-divider.small,
body.yhn-redesign-40.single-product .product-page-aside .is-divider.small {
  background-color: var(--yhn-brand) !important;
  width: 28px !important;
  height: 2px !important;
}

body.yhn-redesign-40.single-product #product-sidebar .product-categories a:hover,
body.yhn-redesign-40.single-product #product-sidebar .product-categories .current-cat > a {
  color: var(--yhn-brand) !important;
  font-weight: 600 !important;
}

/* 2. Gallery & Buy Box Surface Harmony */
body.yhn-redesign-40.single-product .product-main {
  padding-top: 18px !important;
  padding-bottom: 36px !important;
}

body.yhn-redesign-40.single-product.yhn-pdp-2col .product-main > .row.content-row {
  max-width: var(--yhn-container);
  margin-inline: auto;
  align-items: flex-start;
}

body.yhn-redesign-40.single-product .product-gallery {
  background: var(--yhn-bg) !important;
  border: 1px solid var(--yhn-line) !important;
  border-radius: var(--yhn-radius-lg) !important;
  box-shadow: var(--yhn-shadow-sm) !important;
  padding: 14px !important;
}

body.yhn-redesign-40.single-product .product-gallery .woocommerce-product-gallery__wrapper {
  background: var(--yhn-surface);
  border-radius: var(--yhn-radius-md);
  overflow: hidden;
}

body.yhn-redesign-40.single-product .product-thumbnails .col > a {
  border-radius: var(--yhn-radius-md);
  overflow: hidden;
  border: 1px solid var(--yhn-line);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

body.yhn-redesign-40.single-product .product-thumbnails .is-nav-selected > a {
  border-color: var(--yhn-brand) !important;
}

body.yhn-redesign-40.single-product .product-info.summary,
body.yhn-redesign-40.single-product .product-info .entry-summary {
  background: var(--yhn-bg) !important;
  border: 1px solid var(--yhn-line) !important;
  border-radius: var(--yhn-radius-lg) !important;
  box-shadow: var(--yhn-shadow-sm) !important;
  padding: clamp(16px, 2vw, 24px) !important;
}

body.yhn-redesign-40.single-product .product-info .product-title,
body.yhn-redesign-40.single-product .product-info h1.product_title,
body.yhn-redesign-40.single-product .entry-summary h1.product_title {
  font-size: clamp(20px, 1.9vw, 25px) !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  color: var(--yhn-ink) !important;
  margin-bottom: 10px !important;
}

body.yhn-redesign-40.single-product .product-info .price-wrapper {
  background: var(--yhn-surface);
  border: 1px solid var(--yhn-line);
  border-radius: var(--yhn-radius-md);
  padding: 12px 14px;
  margin: 12px 0 16px !important;
}

body.yhn-redesign-40.single-product .product-info .price,
body.yhn-redesign-40.single-product .product-info .price ins .amount,
body.yhn-redesign-40.single-product .product-info .woocommerce-variation-price .price {
  color: var(--yhn-brand) !important;
  font-weight: 800 !important;
}

/* 3. Visual Variant Swatch Cards (Size Hint + Price Preview, inspired by lucyengraving.com) */
body.yhn-redesign-40.single-product .ux-swatches {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.yhn-redesign-40.single-product .ux-swatches .ux-swatch {
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 40px;
  padding: 7px 12px !important;
  border-radius: var(--yhn-radius-md) !important;
  border: 1px solid var(--yhn-line) !important;
  background: var(--yhn-bg) !important;
  color: var(--yhn-ink) !important;
  line-height: 1.25 !important;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

body.yhn-redesign-40.single-product .ux-swatches .ux-swatch.selected,
body.yhn-redesign-40.single-product .ux-swatches .ux-swatch:hover:not(.disabled) {
  border-color: var(--yhn-brand) !important;
  background-color: var(--yhn-brand-soft) !important;
  color: var(--yhn-brand) !important;
  box-shadow: 0 0 0 1px var(--yhn-brand) !important;
}

.yhn-swatch-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--yhn-muted);
  line-height: 1.1;
}

body.yhn-redesign-40.single-product .ux-swatches .ux-swatch.selected .yhn-swatch-meta {
  color: var(--yhn-brand);
}

.yhn-swatch-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-accent-soft);
  color: var(--yhn-accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.yhn-swatch-tag--sale {
  background: var(--yhn-sale);
  color: #ffffff;
}

/* Primary Add to Cart CTA */
body.yhn-redesign-40.single-product .single_add_to_cart_button.button {
  background-color: var(--yhn-brand) !important;
  color: #ffffff !important;
  border-radius: var(--yhn-radius-md) !important;
  min-height: 46px !important;
  padding-inline: 22px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  box-shadow: var(--yhn-shadow-brand) !important;
  transition: background-color var(--yhn-transition), transform var(--yhn-transition) !important;
}

body.yhn-redesign-40.single-product .single_add_to_cart_button.button:hover:not(.disabled) {
  background-color: var(--yhn-brand-hover) !important;
  transform: translateY(-1px);
}

/* 4. Delivery ETA + Zalo CTA + Vietnamese Payment Badges */
.yhn-pdp-eta-card {
  margin: 16px 0 14px;
  padding: 14px 15px;
  background: var(--yhn-surface);
  border: 1px solid var(--yhn-line);
  border-radius: var(--yhn-radius-lg);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.yhn-pdp-eta-card__row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.yhn-pdp-eta-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  background: var(--yhn-accent-soft);
  border: 1px solid var(--yhn-line);
  color: var(--yhn-accent);
}

.yhn-pdp-eta-card__copy strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--yhn-ink);
  margin-bottom: 2px;
}

.yhn-pdp-eta-card__copy small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--yhn-muted);
}

.yhn-pdp-eta-card__free {
  display: inline-block;
  margin-left: 4px;
  font-weight: 700;
  color: var(--yhn-success);
}

.yhn-pdp-zalo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: var(--yhn-radius-md);
  border: 1px solid var(--yhn-brand-border);
  background: var(--yhn-bg);
  color: var(--yhn-ink) !important;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color var(--yhn-transition), background-color var(--yhn-transition), color var(--yhn-transition);
}

.yhn-pdp-zalo-btn:hover {
  border-color: var(--yhn-brand);
  background: var(--yhn-brand-soft);
  color: var(--yhn-brand) !important;
}

.yhn-pdp-zalo-btn__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: var(--yhn-radius-pill);
  background: #0068ff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* Vietnamese Payment & Trust Badges Strip */
.yhn-pdp-payment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--yhn-line);
}

.yhn-pdp-payment-badges > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-bg);
  border: 1px solid var(--yhn-line);
  font-size: 11px;
  font-weight: 600;
  color: var(--yhn-ink);
  white-space: nowrap;
}

.yhn-pdp-payment-badges svg {
  color: var(--yhn-accent);
  flex-shrink: 0;
}

/* Purchase Assurance polish */
body.yhn-redesign-40.single-product .yhn-purchase-assurance {
  border-radius: var(--yhn-radius-md) !important;
  border-color: var(--yhn-line) !important;
  background: var(--yhn-bg) !important;
}

/* 5. Keep PDP variation reset link ("XÓA") tidy */
body.yhn-redesign-40.single-product .variations .reset_variations {
  position: static !important;
  display: inline-block !important;
  margin: 8px 0 0 !important;
  padding: 2px 8px !important;
  border-radius: var(--yhn-radius-pill);
  background: var(--yhn-surface);
  border: 1px solid var(--yhn-line);
  color: var(--yhn-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

body.yhn-redesign-40.single-product .variations .reset_variations:hover {
  border-color: var(--yhn-brand);
  color: var(--yhn-brand) !important;
}

@media (max-width: 849px) {
  body.yhn-redesign-40.single-product .product-info.summary,
  body.yhn-redesign-40.single-product .product-info .entry-summary {
    padding: 16px 14px !important;
  }

  body.yhn-redesign-40.single-product .product-info .price-wrapper {
    padding: 10px 12px !important;
  }

  body.yhn-redesign-40.single-product .product-info .price {
    font-size: clamp(17px, 4.6vw, 22px) !important;
    line-height: 1.35 !important;
  }
}
