/* ==========================================================================
   Touchie Vietnam - Luxury Artisanal Candles Boutique Main Stylesheet
   Version 1.4.0 - $10k Flagship Luxury Lighting & Editorial Motion System
   ========================================================================== */

:root {
  --color-bg: #FAF7F2;
  --color-card: #FFFFFF;
  --color-dark: #1C1917;
  --color-title: #3D2B1F;
  --color-espresso: #3D2B1F;
  --color-mocha: #6B5344;
  --color-sand: #F2ECE4;
  --color-gold: #C5A880;
  --color-terracotta: #C85A17;
  --color-terracotta-hover: #AF4B0E;
  --color-amber: #D9822B;
  --color-sage: #7A8B7B;
  --color-lavender: #8E7C93;

  /* Dynamic Chromatic Scent Aura Variables */
  --scent-aura-primary: rgba(217, 130, 43, 0.24);
  --scent-aura-secondary: rgba(200, 90, 23, 0.12);
  --scent-accent-hex: #C85A17;

  /* Interactive Spotlight Coordinates */
  --mouse-x: 50%;
  --mouse-y: 30%;

  --font-serif: 'Montserrat', sans-serif;
  --font-title: 'Montserrat', sans-serif;
  --font-sans: 'Quicksand', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Montserrat', sans-serif;

  --shadow-card: 0 10px 30px -5px rgba(61, 43, 31, 0.05), 0 2px 6px -1px rgba(61, 43, 31, 0.02);
  --shadow-hover: 0 22px 42px -10px rgba(200, 90, 23, 0.14), 0 4px 12px -2px rgba(61, 43, 31, 0.06);
  --shadow-drawer: -10px 0 35px rgba(28, 25, 23, 0.15);
}

/* Base & Typography */
body.touchie-body {
  background-color: var(--color-bg);
  color: var(--color-dark);
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.65;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.75s cubic-bezier(0.22, 1, 0.36, 1), color 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

h1, h2, h3, .font-luxury, .font-display {
  font-family: 'Montserrat', sans-serif !important;
  color: var(--color-title, #3D2B1F) !important;
}

h1, .page-title {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 900 !important; /* Super Bold 900 */
  letter-spacing: -0.025em !important;
}

h2, .section-title {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 800 !important; /* Super Bold 800 */
  letter-spacing: -0.02em !important;
}

h3, h3.font-luxury {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 700 !important; /* Bold 700 */
  letter-spacing: -0.01em !important;
}

h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.85rem);
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  line-height: 1.24;
}

h3 {
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
  line-height: 1.34;
}

h4 {
  font-size: 1.125rem;
  line-height: 1.4;
}

::selection {
  background-color: var(--color-gold);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-terracotta);
}

/* 1. Top Announcement Bar */
.touchie-announcement-bar {
  background-color: var(--color-dark);
  color: var(--color-bg);
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* 2. Header & Nav Links */
.touchie-header {
  transition: background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* Strict Logo Constraints - Prevents WooCommerce height:auto blowout */
.header-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-height: 48px !important;
}

.header-logo a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  max-height: 48px !important;
}

.header-logo img,
.header-logo .custom-logo,
.touchie-header .header-logo img,
.woocommerce .touchie-header .header-logo img,
.woocommerce-page .touchie-header .header-logo img,
#masthead .header-logo img {
  height: 44px !important;
  max-height: 44px !important;
  width: auto !important;
  max-width: 180px !important;
  object-fit: contain !important;
  display: block !important;
  transition: filter 0.5s ease, transform 0.3s ease;
}

@media (max-width: 1023px) {
  .header-logo img,
  .touchie-header .header-logo img,
  .woocommerce .touchie-header .header-logo img,
  .woocommerce-page .touchie-header .header-logo img,
  #masthead .header-logo img {
    height: 38px !important;
    max-height: 38px !important;
    max-width: 150px !important;
  }
}

.nav-link {
  position: relative;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-espresso);
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-terracotta);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--color-terracotta);
}

.nav-link:hover::after {
  width: 100%;
}

/* ==========================================================================
   3. $10K LUXURY LIGHTING & EDITORIAL MOTION SYSTEM (60 FPS GPU ACCELERATED)
   ========================================================================== */

/* 3.1 Living Candlelight Aura & Chromatic Breathing */
@keyframes candleBreathe {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.78;
  }
  50% {
    transform: translate3d(0, -6px, 0) scale(1.09);
    opacity: 1;
  }
}

@keyframes flameFlicker {
  0%, 100% {
    transform: scale(1) rotate(-1deg);
    opacity: 0.92;
  }
  25% {
    transform: scale(1.04, 0.97) rotate(1.5deg);
    opacity: 1;
  }
  50% {
    transform: scale(0.98, 1.05) rotate(-0.5deg);
    opacity: 0.86;
  }
  75% {
    transform: scale(1.03, 1.02) rotate(1deg);
    opacity: 0.96;
  }
}

.touchie-ambient-aura {
  background: radial-gradient(
    circle at 50% 50%,
    var(--scent-aura-primary) 0%,
    var(--scent-aura-secondary) 45%,
    transparent 75%
  );
  filter: blur(36px);
  animation: candleBreathe 4.8s ease-in-out infinite;
  transition: background 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  pointer-events: none;
}

.touchie-flame-badge {
  animation: flameFlicker 3.2s ease-in-out infinite;
  display: inline-block;
}

/* 3.2 Olfactory Vapor Wisps & Golden Micro-Embers */
@keyframes emberFloat {
  0% {
    transform: translate3d(0, 12px, 0) scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 0.85;
  }
  70% {
    opacity: 0.55;
  }
  100% {
    transform: translate3d(var(--ember-drift, 14px), -95px, 0) scale(1.15);
    opacity: 0;
  }
}

@keyframes vaporRise {
  0% {
    transform: translate3d(0, 10px, 0) scaleX(0.95);
    opacity: 0;
  }
  40% {
    opacity: 0.42;
  }
  100% {
    transform: translate3d(-8px, -55px, 0) scaleX(1.08);
    opacity: 0;
  }
}

.touchie-ember {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: radial-gradient(circle, #FFD28A 0%, #D9822B 70%, transparent 100%);
  box-shadow: 0 0 10px 2px rgba(217, 130, 43, 0.65);
  pointer-events: none;
  will-change: transform, opacity;
  animation: emberFloat var(--ember-duration, 6.5s) ease-in-out infinite;
  animation-delay: var(--ember-delay, 0s);
}

.touchie-vapor-wisp {
  pointer-events: none;
  will-change: transform, opacity;
  animation: vaporRise 7.5s ease-in-out infinite;
}

/* 3.3 Interactive Cursor Spotlight & Luxury Card Specular Glow */
.touchie-cursor-stage {
  position: relative;
}

.touchie-cursor-stage::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    550px circle at var(--mouse-x, 50%) var(--mouse-y, 30%),
    var(--scent-aura-secondary),
    transparent 65%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
  transition: opacity 0.5s ease;
}

.lux-card-glow {
  position: relative;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.45s ease,
              background-color 0.5s ease;
}

.lux-card-glow:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: var(--shadow-hover);
  border-color: rgba(200, 90, 23, 0.45) !important;
}

/* 3.4 Editorial Scroll Choreography (.lux-reveal) */
.lux-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.lux-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.lux-stagger-1 { transition-delay: 0.08s; }
.lux-stagger-2 { transition-delay: 0.18s; }
.lux-stagger-3 { transition-delay: 0.28s; }
.lux-stagger-4 { transition-delay: 0.38s; }

/* 3.5 Animated Olfactory Intensity Meters */
.scent-meter-track {
  width: 100%;
  height: 5px;
  background-color: #F2ECE4;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.scent-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C5A880 0%, #D9822B 55%, #C85A17 100%);
  border-radius: 9999px;
  transition: width 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.scent-meter-fill.is-animated {
  width: var(--meter-target, 85%);
}

/* ==========================================================================
   4. "🕯️ THẮP NẾN ĐÊM" SANCTUARY MODE (body.candlelight-mode)
   ========================================================================== */

body.candlelight-mode {
  --color-bg: #14100D;
  --color-card: #1E1814;
  --color-dark: #FAF7F2;
  --color-espresso: #E6DDD3;
  --color-mocha: #B8A696;
  --color-sand: #332922;
  --scent-aura-primary: rgba(217, 130, 43, 0.42);
  --scent-aura-secondary: rgba(200, 90, 23, 0.22);
  --shadow-hover: 0 24px 48px -8px rgba(217, 130, 43, 0.28), 0 0 25px -4px rgba(200, 90, 23, 0.18);
  background-color: #14100D !important;
  color: #FAF7F2 !important;
}

body.candlelight-mode #masthead.touchie-header {
  background-color: rgba(20, 16, 13, 0.94) !important;
  border-color: #332922 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Invert dark logo softly to warm ivory in Candlelight Mode */
body.candlelight-mode #masthead .header-logo img,
body.candlelight-mode #mobile-nav-drawer img,
body.candlelight-mode #cart-drawer .p-6 img {
  filter: brightness(0) invert(0.95) sepia(0.15) saturate(0.4) !important;
}

body.candlelight-mode .bg-white {
  background-color: #1E1814 !important;
}

body.candlelight-mode .bg-\[\#FAF7F2\],
body.candlelight-mode .bg-\[\#FAF7F2\]\/60,
body.candlelight-mode .bg-\[\#FAF7F2\]\/50,
body.candlelight-mode .bg-\[\#F2ECE4\]\/40,
body.candlelight-mode .bg-\[\#F2ECE4\]\/50 {
  background-color: #17120F !important;
}

body.candlelight-mode .bg-\[\#F2ECE4\] {
  background-color: #2A211B !important;
}

body.candlelight-mode .text-\[\#1C1917\] {
  color: #FAF7F2 !important;
}

body.candlelight-mode .text-\[\#3D2B1F\] {
  color: #E6DDD3 !important;
}

body.candlelight-mode .text-\[\#6B5344\] {
  color: #B8A696 !important;
}

body.candlelight-mode .border-\[\#F2ECE4\],
body.candlelight-mode .border-\[\#F2ECE4\]\/60,
body.candlelight-mode .border-\[\#F2ECE4\]\/70 {
  border-color: #332922 !important;
}

body.candlelight-mode .scent-meter-track {
  background-color: #2D241E !important;
}

body.candlelight-mode .touchie-ambient-aura {
  filter: blur(42px) brightness(1.25);
}

body.candlelight-mode .candlelight-toggle-btn {
  background-color: #C85A17 !important;
  color: #FFFFFF !important;
  border-color: #D9822B !important;
  box-shadow: 0 0 18px rgba(217, 130, 43, 0.55);
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .touchie-ambient-aura,
  .touchie-ember,
  .touchie-vapor-wisp,
  .touchie-flame-badge {
    animation: none !important;
  }
  .lux-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Interactive Scent Concierge (Mood Matcher) */
.mood-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 16px !important;
}

.mood-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.mood-card.active-mood {
  border-color: var(--color-terracotta) !important;
  background-color: rgba(242, 236, 228, 0.4) !important;
  box-shadow: 0 0 0 2px var(--color-terracotta);
  border-radius: 16px !important;
}

/* Drawer & Modals */
#cart-drawer.hidden, 
#mobile-nav-drawer.hidden, 
#quickview-modal.hidden, 
#qr-popup.hidden,
#touchie-channel-toast.hidden {
  display: none !important;
}

.touchie-drawer-panel {
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* WooCommerce Overrides */
.woocommerce .woocommerce-breadcrumb {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-mocha);
  margin-bottom: 24px;
}

.woocommerce span.onsale {
  background-color: var(--color-dark) !important;
  color: #fff !important;
  font-size: 10px !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 9999px !important;
  padding: 4px 8px !important;
  min-height: auto !important;
  line-height: 1.4 !important;
}

.woocommerce a.button, 
.woocommerce button.button, 
.woocommerce input.button {
  background-color: var(--color-dark) !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.15em !important;
  padding: 12px 20px !important;
  font-weight: 500 !important;
  transition: background-color 0.3s ease !important;
}

.woocommerce a.button:hover, 
.woocommerce button.button:hover, 
.woocommerce input.button:hover {
  background-color: var(--color-terracotta) !important;
  color: #ffffff !important;
}

/* Prose Typography for Blog & Pages */
.touchie-prose h2 {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  color: var(--color-dark);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.touchie-prose h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--color-dark);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.touchie-prose p {
  margin-bottom: 1.25rem;
}

.touchie-prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.touchie-prose li {
  margin-bottom: 0.5rem;
}

/* Brand Story Quote strictly 1 line */
.touchie-quote-h2 {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 800 !important;
  color: #3D2B1F !important;
  font-size: clamp(0.95rem, 1.85vw, 1.55rem) !important;
  white-space: nowrap !important;
  letter-spacing: -0.02em !important;
}
