/*
 * SEEMA Spices & Pure Talbeena
 * Professional Light & Dark Theme System + Mega Menu & Animations
 *
 * Fonts are loaded ONCE in includes/header.php (and admin/includes/header.php)
 * via a single optimised Google Fonts request. Do not add an @import here —
 * a second stylesheet request blocks rendering and doubles font downloads.
 *
 * Type system:
 *   --font-serif : Playfair Display  → headings, brand wordmark, display text
 *   --font-sans  : Plus Jakarta Sans → body, UI, labels, buttons
 */

/* Color Variables */
:root {
  --spice-amber: #F5A623;
  --spice-gold: #F5A623;
  --talbeena-cream: #FAF8F2;
  --emerald-deep: #0C3427;
  --spice-rust: #991B1B;

  /* Light Theme Palette Tokens (Warm Heritage Ivory & Forest Green) */
  --bg-main: #FAF8F2;
  --bg-card: #FFFFFF;
  --bg-subtle: #F4EFE6;
  --text-main: #1C1917;
  --text-muted: #57534E;
  --text-faint: #78716C;
  --border-main: #EAE5D9;
  --border-accent: rgba(245, 166, 35, 0.3);
  --header-glass: rgba(252, 251, 247, 0.95);
  --card-shadow: 0 4px 20px -2px rgba(44, 28, 14, 0.06);
}

html.dark {
  /* Dark Theme Palette Tokens */
  --bg-main: #0C0A09;
  --bg-card: #1C1917;
  --bg-subtle: #141210;
  --text-main: #F5F5F4;
  --text-muted: #D6D3D1;
  --text-faint: #A8A29E;
  --border-main: #292524;
  --border-accent: rgba(217, 119, 6, 0.35);
  --header-glass: rgba(12, 10, 9, 0.94);
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Responsive media defaults to prevent overflow */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

/* Touch-optimized smooth momentum scrolling for iOS/iPad */
.overflow-x-auto, .overflow-y-auto, .no-scrollbar {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* Display / heading type — Playfair Display for heritage elegance */
h1, h2, h3, .font-serif {
  font-family: 'Playfair Display', Georgia, "Times New Roman", serif;
}

/* Brand wordmark & regal accents reuse the display serif (single-load type system) */
.font-regal {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
}

/* Handwritten accent now renders as an italic display serif — keeps the warm
   artisanal feel without loading a third webfont. */
.font-handwriting {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
}

/* Hindi / Devanagari text falls back gracefully without an extra webfont */
.font-hindi, [lang="hi"] {
  font-family: 'Noto Sans Devanagari', 'Nirmala UI', 'Segoe UI', 'Plus Jakarta Sans', sans-serif;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: #A8A29E;
  border-radius: 9999px;
}

html.dark ::-webkit-scrollbar-thumb {
  background: #44403C;
}

::-webkit-scrollbar-thumb:hover {
  background: #D97706;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #D6D3D1;
  border-radius: 9999px;
}

html.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #292524;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #D97706;
}

/* Ambient Radial Gradients */
.bg-radial-spice {
  background: radial-gradient(circle at top right, rgba(217, 119, 6, 0.12), transparent 50%),
              radial-gradient(circle at bottom left, rgba(6, 78, 59, 0.08), transparent 45%);
}

.bg-radial-talbeena {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.12), transparent 70%);
}

html.dark .bg-radial-spice {
  background: radial-gradient(circle at top right, rgba(217, 119, 6, 0.18), transparent 50%),
              radial-gradient(circle at bottom left, rgba(6, 78, 59, 0.15), transparent 45%);
}

html.dark .bg-radial-talbeena {
  background: radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.2), transparent 70%);
}

/* Glassmorphism Header */
.header-glass {
  background-color: var(--header-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Product Card Styling */
.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(217, 119, 6, 0.5);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.12), 0 0 20px -4px rgba(217, 119, 6, 0.2);
}

html.dark .product-card:hover {
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.6), 0 0 20px -4px rgba(217, 119, 6, 0.25);
}

/* Mega Menu Dropdowns */
.mega-menu-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.mega-menu-trigger:hover .mega-menu-panel,
.mega-menu-panel:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Floating Animations */
@keyframes softFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

.animate-soft-float {
  animation: softFloat 4s ease-in-out infinite;
}

/* Theme Toggle Pill Styling */
.theme-switch-track {
  background: #E7E5E4;
  transition: background-color 0.3s;
}

html.dark .theme-switch-track {
  background: #292524;
}

/* Light Theme Card Overrides for high contrast & luxury appearance */
html:not(.dark) .light-card-contrast {
  background-color: #FFFFFF;
  border-color: #E7E5E4;
  color: #1C1917;
}

html:not(.dark) .light-text-contrast {
  color: #1C1917;
}

html:not(.dark) .light-muted-contrast {
  color: #57534E;
}

/* Authentic Spice Powder Splatter Bloom for Circular Showcase */
.spice-splash-chilli {
  background: radial-gradient(circle at center, rgba(220, 38, 38, 0.45) 0%, rgba(239, 68, 68, 0.18) 55%, transparent 75%);
  filter: drop-shadow(0 4px 10px rgba(220, 38, 38, 0.25));
}
.spice-splash-turmeric {
  background: radial-gradient(circle at center, rgba(245, 166, 35, 0.55) 0%, rgba(251, 191, 36, 0.22) 55%, transparent 75%);
  filter: drop-shadow(0 4px 10px rgba(245, 166, 35, 0.3));
}
.spice-splash-coriander {
  background: radial-gradient(circle at center, rgba(46, 125, 50, 0.45) 0%, rgba(74, 222, 128, 0.18) 55%, transparent 75%);
  filter: drop-shadow(0 4px 10px rgba(46, 125, 50, 0.25));
}
.spice-splash-cumin {
  background: radial-gradient(circle at center, rgba(161, 98, 7, 0.48) 0%, rgba(180, 83, 9, 0.2) 55%, transparent 75%);
  filter: drop-shadow(0 4px 10px rgba(161, 98, 7, 0.25));
}
.spice-splash-garam {
  background: radial-gradient(circle at center, rgba(194, 65, 12, 0.5) 0%, rgba(217, 119, 6, 0.22) 55%, transparent 75%);
  filter: drop-shadow(0 4px 10px rgba(194, 65, 12, 0.25));
}

/* ==========================================================
 * Explore by Category Arched Cards & Fast Mobile Carousel
 * ========================================================== */

/* Fast Momentum Horizontal Scroll for Mobile (Strict flex-nowrap row) */
.category-carousel-scroll {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory !important;
  scroll-snap-stop: normal;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-padding-left: 1rem;
  scroll-padding-right: 1rem;
  will-change: scroll-position;
}

.category-carousel-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.category-carousel-scroll > * {
  scroll-snap-align: start !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

@media (min-width: 1280px) {
  .category-carousel-scroll {
    display: grid !important;
    overflow-x: visible !important;
  }
}

/* Arched Card Silhouettes matching reference heritage design */
.arch-card-frame {
  border-radius: 92px 92px 24px 24px;
}

.arch-capsule-frame {
  border-radius: 56px 56px 56px 56px;
}

@media (min-width: 640px) {
  .arch-card-frame {
    border-radius: 104px 104px 26px 26px;
  }
  .arch-capsule-frame {
    border-radius: 64px 64px 64px 64px;
  }
}

@media (min-width: 1280px) {
  .arch-card-frame {
    border-radius: 112px 112px 28px 28px;
  }
}

/* Reduced Motion Safety */
@media (prefers-reduced-motion: reduce) {
  .category-carousel-scroll {
    scroll-behavior: auto !important;
  }
  .category-carousel-scroll * {
    transition: none !important;
    transform: none !important;
  }
}




/* ==========================================================
 * Professional Reviews Horizontal Scroller & Carousel
 * ========================================================== */
.reviews-carousel-scroll {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-padding-left: 1rem;
  scroll-padding-right: 1rem;
  cursor: grab;
  user-select: none;
}

.reviews-carousel-scroll.is-dragging {
  cursor: grabbing !important;
  scroll-snap-type: none !important;
  scroll-behavior: auto !important;
}

.reviews-carousel-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.reviews-carousel-scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .reviews-carousel-scroll {
    scroll-behavior: auto !important;
  }
}


/* Product Card Clickability & Interactions */
.product-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.product-card a,
.product-card button,
.product-card [data-action] {
  cursor: pointer;
}

/* ==========================================================
 * Mobile Navigation Drawer Polish
 * ========================================================== */
#mobile-menu {
  will-change: transform;
}

#mobile-menu-backdrop {
  transition: opacity 0.3s ease;
}

/* Nav link press feedback + smooth active state */
.mobile-nav-link {
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.mobile-nav-link:active {
  transform: scale(0.985);
}

/* Accordion chevron rotation state */
.acc-chevron {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Prevent background scroll while the mobile drawer is open */
body.menu-open {
  overflow: hidden;
  touch-action: none;
}

/* Shop sort dropdown — pop-in animation */
@keyframes sd-pop-in {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#sort-dropdown-menu.sd-pop-in {
  transform-origin: top center;
  animation: sd-pop-in 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  #mobile-menu {
    transition: none !important;
  }
  .acc-panel {
    transition: none !important;
  }
  #sort-dropdown-menu.sd-pop-in {
    animation: none !important;
  }
}
