/*
 * YHN 4.0 — Unified Design Tokens (Quiet Premium Beauty & Wellness)
 * Single source of truth for colors, surfaces, typography, spacing, radii, and footer.
 * Also harmonizes legacy :root variables (--pink*, --bg-soft*, --line*) from yhn-site-core
 * so zero neon-pink (#fe259a) bleed-through remains across any template.
 *
 * Switchable via Customizer body classes:
 *   - body.yhn-palette-ruby    (Default: Quiet Ruby — elevated YHN brand DNA)
 *   - body.yhn-palette-crimson (Warm Lucy — crimson, cream & gold)
 *   - body.yhn-palette-ivory   (Clinical Ivory — minimalist ink & rose)
 */

:root,
body.yhn-palette-ruby {
  --yhn-brand: #b5175b;
  --yhn-brand-hover: #941149;
  --yhn-brand-soft: #fdf2f6;
  --yhn-brand-border: #f1d3e0;
  --yhn-accent: #a67c52;
  --yhn-accent-soft: #faf5ef;
  --yhn-topbar-bg: #23181d;
  --yhn-topbar-fg: #fdf8fa;
  --yhn-nav-bg: #b5175b;
  --yhn-nav-fg: #ffffff;
  --yhn-footer-bg: #231d20;
  --yhn-footer-bottom-bg: #181316;
  --yhn-footer-accent: #f3a6c4;
  --yhn-band-dark: #2a1620;
  --yhn-band-dark-card: rgba(255, 255, 255, 0.07);
  --yhn-bg: #ffffff;
  --yhn-surface: #faf7f4;
  --yhn-surface-2: #f3ece5;
  --yhn-ink: #1a1715;
  --yhn-muted: #5c5550;
  --yhn-line: #e8e0d8;
  --yhn-sale: #c81e4b;
  --yhn-success: #047857;
  --yhn-success-soft: #ecfdf5;
  --yhn-star: #d4962a;

  /* Legacy alias harmonization (overrides yhn-site-core neon #fe259a) */
  --yhn-rose: var(--yhn-brand);
  --yhn-gold: var(--yhn-accent);
  --yhn-cream: var(--yhn-surface);
  --pink: var(--yhn-brand);
  --pink-2: var(--yhn-brand);
  --pink-dark: var(--yhn-brand-hover);
  --pink-hover: var(--yhn-brand-hover);
  --pink-soft: var(--yhn-brand-soft);
  --pink-soft-2: var(--yhn-brand-soft);
  --pink-soft-3: var(--yhn-brand-soft);
  --bg-soft: var(--yhn-bg);
  --bg-soft-2: var(--yhn-surface);
  --bg-soft-3: var(--yhn-surface);
  --line: var(--yhn-line);
  --line-2: var(--yhn-line);
  --line-3: var(--yhn-line);
  --line-4: var(--yhn-line);

  /* Radii & Shadows */
  --yhn-radius-sm: 6px;
  --yhn-radius-md: 10px;
  --yhn-radius-lg: 14px;
  --yhn-radius-pill: 999px;
  --yhn-shadow-sm: 0 2px 8px rgba(26, 23, 21, 0.05);
  --yhn-shadow-md: 0 12px 28px rgba(26, 23, 21, 0.09);
  --yhn-shadow-brand: 0 8px 20px rgba(181, 23, 91, 0.22);

  /* Layout & Motion */
  --yhn-container: 1240px;
  --yhn-transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

body.yhn-palette-crimson {
  --yhn-brand: #8b1e3f;
  --yhn-brand-hover: #6d1530;
  --yhn-brand-soft: #fbf2f4;
  --yhn-brand-border: #ecd1d8;
  --yhn-accent: #c5962e;
  --yhn-accent-soft: #faf5eb;
  --yhn-topbar-bg: #7a1026;
  --yhn-topbar-fg: #fff9ef;
  --yhn-nav-bg: #8b1e3f;
  --yhn-nav-fg: #ffffff;
  --yhn-footer-bg: #26191c;
  --yhn-footer-bottom-bg: #1a1013;
  --yhn-footer-accent: #e8c77b;
  --yhn-band-dark: #4a1020;
  --yhn-band-dark-card: rgba(255, 249, 239, 0.08);
  --yhn-bg: #ffffff;
  --yhn-surface: #faf5eb;
  --yhn-surface-2: #f2e8d6;
  --yhn-ink: #1c1614;
  --yhn-muted: #5b5048;
  --yhn-line: #e7decb;
  --yhn-sale: #9e1b32;
  --yhn-star: #c5962e;
  --yhn-shadow-brand: 0 8px 20px rgba(139, 30, 63, 0.22);
}

body.yhn-palette-ivory {
  --yhn-brand: #18181b;
  --yhn-brand-hover: #2e2e34;
  --yhn-brand-soft: #f4f4f5;
  --yhn-brand-border: #e4e4e7;
  --yhn-accent: #cf3d73;
  --yhn-accent-soft: #fdf2f7;
  --yhn-topbar-bg: #18181b;
  --yhn-topbar-fg: #fafafa;
  --yhn-nav-bg: #18181b;
  --yhn-nav-fg: #ffffff;
  --yhn-footer-bg: #18181b;
  --yhn-footer-bottom-bg: #101012;
  --yhn-footer-accent: #f48fb1;
  --yhn-band-dark: #18181b;
  --yhn-band-dark-card: rgba(255, 255, 255, 0.06);
  --yhn-bg: #ffffff;
  --yhn-surface: #f9f9fa;
  --yhn-surface-2: #f1f1f4;
  --yhn-ink: #141416;
  --yhn-muted: #52525b;
  --yhn-line: #e4e4e7;
  --yhn-sale: #cf3d73;
  --yhn-star: #d97706;
  --yhn-shadow-brand: 0 8px 20px rgba(24, 24, 27, 0.18);
}

/* Global Quiet Premium baseline overrides (non-checkout) */
body.yhn-redesign-40:not(.woocommerce-checkout) {
  color: var(--yhn-ink);
  background-color: var(--yhn-bg);
  overflow-x: clip;
}

/* Remove unwanted underline on VND currency symbol (₫) and sale <ins> globally */
body.yhn-redesign-40 .woocommerce-Price-amount,
body.yhn-redesign-40 .woocommerce-Price-currencySymbol,
body.yhn-redesign-40 ins,
body.yhn-redesign-40 .price ins {
  text-decoration: none !important;
}

/* Harmonize WooCommerce / Flatsome sale badges across archive & PDP */
body.yhn-redesign-40 .badge-container .badge-inner,
body.yhn-redesign-40 .callout .badge-inner,
body.yhn-redesign-40 .onsale {
  background-color: var(--yhn-sale) !important;
  color: #ffffff !important;
}

body.yhn-redesign-40:not(.woocommerce-checkout) a:focus-visible,
body.yhn-redesign-40:not(.woocommerce-checkout) button:focus-visible {
  outline: 2px solid var(--yhn-brand);
  outline-offset: 2px;
}

/* Shared star rating presentation (honest filled + empty stars) */
.yhn-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--yhn-muted);
}
.yhn-card-rating__stars {
  color: var(--yhn-star);
  letter-spacing: 0.04em;
  font-size: 12px;
}
.yhn-card-rating__avg {
  font-weight: 700;
  color: var(--yhn-ink);
}
.yhn-card-rating__count {
  color: var(--yhn-muted);
  font-size: 11.5px;
}

/* Accessibility: honor reduced motion globally */
@media (prefers-reduced-motion: reduce) {
  body.yhn-redesign-40 *,
  body.yhn-redesign-40 *::before,
  body.yhn-redesign-40 *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
