/**
 * Liora Flames - Main Stylesheet
 * Premium Candle E-Commerce Platform
 */

/* CSS Variables */
:root {
  /* OLD COLORS
  --primary-black: #0a0a0a;
  --primary-white: #ffffff;
  --cream-base: #faf8f5;
  --cream-dark: #f5f0e8;
  --brown-primary: #8b6f47;
  --brown-dark: #5c4033;
  --brown-light: #d4c4a8;
  --gold-accent: #d4af37;
  --gold-light: #f4e4bc;
  --text-primary: #2c2c2c;
  --text-secondary: #6b6b6b;
  */

  /* NEW VANILLA THEME */
  --primary-black: #1a1a1a;
  --primary-white: #ffffff;
  --cream-base: #F5F0EA;
  --cream-dark: #E6E1D8;
  --brown-primary: #6B523A;
  --brown-dark: #48392B;
  --brown-light: #A58B70;
  --gold-accent: #D4AF37;
  --gold-light: #F4E4BC;
  --text-primary: #48392B;
  --text-secondary: #6B523A;

  --flame-orange: #ff6b35;
  --flame-yellow: #f7931e;
  --flame-gold: #ffd700;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Adjust to match header height */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--cream-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════
   LUXURY MICRO-DETAILS
   ═══════════════════════════════════════════════ */

/* 1. Custom Cursor Disabled */

/* 2. Page Intro Curtain */
.liora-curtain {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: #151311;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.liora-curtain .curtain-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(231, 225, 216, 0.7);
  opacity: 0;
  transform: translateY(8px);
  animation: curtainBrandIn 0.8s ease-out 0.1s forwards;
}

@keyframes curtainBrandIn {
  to { opacity: 1; transform: translateY(0); }
}

.liora-curtain.lifting {
  opacity: 0;
  pointer-events: none;
}

/* 3. Scroll Progress Bar */
.liora-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--brown-primary), var(--gold-accent));
  z-index: 9999;
  transition: none;
  pointer-events: none;
  opacity: 0.7;
}

/* 4. Image Viewport Reveal */
.liora-img-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(.25,.1,.25,1),
              transform 0.9s cubic-bezier(.25,.1,.25,1);
}

.liora-img-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* 5. Staggered Text Reveal */
.liora-text-reveal .word {
  display: inline-block;
  overflow: hidden;
}

.liora-text-reveal .word-inner {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.7s cubic-bezier(.25,.1,.25,1);
}

.liora-text-reveal.in-view .word-inner {
  transform: translateY(0);
}

/* 6. Link underline draw */
.liora-link-draw {
  position: relative;
  text-decoration: none;
}
.liora-link-draw::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s cubic-bezier(.25,.1,.25,1);
}
.liora-link-draw:hover::after {
  width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

.font-cormorant {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

/* Header Styles */
#mainHeader .flex.items-center.justify-between {
    justify-content: space-between;
}

@media (min-width: 1024px) {
    #mainHeader .flex.items-center.justify-between {
        justify-content: center;
    }
    #mainHeader .flex.items-center.gap-4:first-child {
        position: absolute;
        left: 1rem;
    }
    #mainHeader .flex.items-center.gap-4:last-child {
        position: absolute;
        right: 1rem;
    }
}

/* Add some padding to the body for inner pages to prevent content from being hidden behind the header */
body.has-fixed-header {
    padding-top: 144px; /* Adjust this value based on the new header height */
}

@media (max-width: 1023px) {
    body.has-fixed-header {
        padding-top: 80px; /* Mobile header is shorter */
    }
}

/* Flame Glow Effect */
.flame-glow {
  animation: flameGlow 3s ease-in-out infinite alternate;
}

@keyframes flameGlow {
  0% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Header Flame Animation */
.header-flame path {
  animation: headerFlameFlicker 2s ease-in-out infinite;
}

@keyframes headerFlameFlicker {
  0%, 100% {
    opacity: 0.9;
    transform: scaleY(1);
  }
  25% {
    opacity: 0.85;
    transform: scaleY(0.98);
  }
  50% {
    opacity: 0.95;
    transform: scaleY(1.02);
  }
  75% {
    opacity: 0.88;
    transform: scaleY(0.97);
  }
}

/* Product Card Glow Effect */
.product-card {
  position: relative;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.product-card:hover {
  transform: translateY(-8px);
}

.product-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.product-card:hover::after {
  opacity: 1;
  animation: candleGlow 2s ease-in-out infinite alternate;
}

@keyframes candleGlow {
  0% {
    opacity: 0.3;
    width: 60%;
  }
  100% {
    opacity: 0.6;
    width: 90%;
  }
}

/* Add to Cart Button - Wax Melting Effect */
.btn-add-cart {
  position: relative;
  overflow: hidden;
}

.btn-add-cart::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.btn-add-cart:hover::before {
  left: 100%;
}

/* Page Transitions */
.page-transition {
  animation: fadeInLikeCandle 0.8s ease-out;
}

@keyframes fadeInLikeCandle {
  0% {
    opacity: 0;
    filter: brightness(0.3);
  }
  50% {
    opacity: 0.5;
    filter: brightness(0.6);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

/* Loading Spinner - Luxury Animated Brand Logo */
.flame-loader {
  width: 36px;
  height: 36px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  background: url('../images/lioralogo.png') no-repeat center center;
  background-size: 20px auto;
  border-radius: 50%;
}

.flame-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(212, 175, 55, 0.15); /* Soft gold ring */
  border-top-color: #D4AF37; /* Solid gold spinner top */
  border-radius: 50%;
  animation: premiumSpinnerRotate 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.flame-loader::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(212, 175, 55, 0.04);
  border-radius: 50%;
  animation: premiumPulse 2s ease-in-out infinite;
}

/* If inside a dark background button or element, invert the logo so it appears white */
button .flame-loader,
.bg-brown-dark .flame-loader,
.bg-brown-primary .flame-loader {
  filter: brightness(0) invert(1);
}

@keyframes premiumSpinnerRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes premiumPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
  }
}

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Warm Gradient Overlays */
.warm-gradient-overlay {
  position: relative;
}

.warm-gradient-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(212, 175, 55, 0.05) 0%,
    rgba(139, 111, 71, 0.1) 50%,
    rgba(212, 175, 55, 0.05) 100%
  );
  pointer-events: none;
}

/* Gold Shimmer Effect */
.gold-shimmer {
  background: linear-gradient(
    90deg,
    var(--gold-accent) 0%,
    var(--gold-light) 25%,
    var(--gold-accent) 50%,
    var(--gold-light) 75%,
    var(--gold-accent) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Button Hover Glow */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--gold-accent), var(--brown-primary), var(--gold-accent));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-glow:hover::after {
  opacity: 1;
  animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
  0%, 100% {
    filter: blur(8px);
  }
  50% {
    filter: blur(12px);
  }
}

/* Parallax Warm Overlay */
.parallax-warm {
  position: relative;
}

.parallax-warm::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 107, 53, 0.08) 0%,
    rgba(247, 147, 30, 0.05) 30%,
    transparent 70%
  );
  pointer-events: none;
  animation: warmPulse 4s ease-in-out infinite;
}

@keyframes warmPulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.8;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream-dark);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-black), var(--brown-dark), var(--primary-black));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--brown-dark), var(--primary-black), var(--brown-dark));
}

/* Selection Color */
::selection {
  background: rgba(212, 175, 55, 0.3);
  color: var(--text-primary);
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid var(--gold-accent);
  outline-offset: 2px;
}

/* Image Hover Zoom */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.7s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

/* Line Clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 100px;
  right: 20px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1000;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

/* Modal Backdrop */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

/* Form Inputs */
.input-candle {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 1rem 1.5rem;
  color: white;
  transition: all 0.3s ease;
}

.input-candle:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  outline: none;
}

.input-candle::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Card Hover Lift */
.card-lift {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--brown-primary) 0%, var(--gold-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated Underline */
.animated-underline {
  position: relative;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brown-primary), var(--gold-accent));
  transition: width 0.3s ease;
}

.animated-underline:hover::after {
  width: 100%;
}

/* Floating Animation */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Pulse Glow */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
}

/* Print Styles */
@media print {
  header, footer, .no-print {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --cream-base: #ffffff;
    --cream-dark: #f0f0f0;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE CART DRAWER BOTTOM SHEET (MOBILE)
   ═══════════════════════════════════════════════ */
@media (max-width: 639px) {
  #cartDrawer {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 75vh !important;
    width: 100% !important;
    border-top-left-radius: 1.5rem !important; /* rounded-t-3xl */
    border-top-right-radius: 1.5rem !important;
    border-top: 1px solid rgba(107, 82, 58, 0.1) !important; /* thin brown border */
    transform: translateY(100%) !important;
  }
  
  #cartDrawer.open {
    transform: translateY(0) !important;
  }
}
