@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  --background: 220 25% 97%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --primary: 246 80% 60%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 250 84% 70%;
  --secondary: 220 18% 92%;
  --secondary-foreground: 222 47% 12%;
  --muted: 220 18% 94%;
  --muted-foreground: 217 20% 36%;
  --accent: 246 95% 96%;
  --accent-foreground: 246 80% 50%;
  --destructive: 0 84% 58%;
  --destructive-foreground: 0 0% 100%;
  --success: 158 64% 40%;
  --success-foreground: 0 0% 100%;
  --border: 220 18% 86%;
  --input: 220 18% 86%;
  --ring: 246 80% 60%;
  --radius: 0.875rem;

  --gradient-hero: linear-gradient(135deg, hsl(246 80% 60%) 0%, hsl(263 75% 56%) 50%, hsl(220 90% 55%) 100%);
  --gradient-soft: radial-gradient(ellipse 100% 60% at 50% 0%, hsl(246 100% 96%) 0%, hsl(220 25% 97%) 60%);
  --gradient-card: linear-gradient(180deg, hsl(0 0% 100%) 0%, hsl(220 25% 98%) 100%);

  --shadow-soft: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -3px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 36px -8px rgba(15, 23, 42, 0.12), 0 6px 16px -4px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 10px 30px -6px rgba(91, 80, 234, 0.35);
  --shadow-ring: 0 0 0 4px rgba(91, 80, 234, 0.12);
}

.dark {
  --background: 240 40% 6%;
  --foreground: 230 30% 96%;
  --card: 240 30% 10%;
  --card-foreground: 230 30% 96%;
  --popover: 240 30% 10%;
  --popover-foreground: 230 30% 96%;
  --primary: 243 90% 72%;
  --primary-foreground: 240 40% 8%;
  --primary-glow: 250 90% 78%;
  --secondary: 240 25% 14%;
  --secondary-foreground: 230 30% 96%;
  --muted: 240 22% 14%;
  --muted-foreground: 230 15% 68%;
  --accent: 243 45% 22%;
  --accent-foreground: 243 90% 88%;
  --destructive: 0 72% 55%;
  --destructive-foreground: 0 0% 100%;
  --success: 158 60% 55%;
  --success-foreground: 240 40% 8%;
  --border: 240 22% 18%;
  --input: 240 22% 18%;
  --ring: 243 90% 72%;

  --gradient-soft: radial-gradient(ellipse 100% 60% at 50% 0%, hsl(243 60% 18%) 0%, hsl(240 40% 6%) 60%);
  --gradient-hero: linear-gradient(135deg, hsl(243 90% 72%) 0%, hsl(263 80% 68%) 50%, hsl(220 90% 65%) 100%);
  --gradient-card: linear-gradient(180deg, hsl(240 30% 11%) 0%, hsl(240 30% 9%) 100%);

  --shadow-soft: 0 1px 2px 0 hsl(0 0% 0% / 0.3);
  --shadow-md: 0 4px 16px -4px hsl(0 0% 0% / 0.4);
  --shadow-lg: 0 20px 48px -12px hsl(0 0% 0% / 0.55);
  --shadow-glow: 0 12px 40px -8px hsl(243 90% 72% / 0.4);
  --shadow-ring: 0 0 0 4px hsl(243 90% 72% / 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Hind Siliguri', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 15% -10%, hsl(var(--primary) / 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 0%, hsl(263 70% 60% / 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dark body {
  background-image:
    radial-gradient(circle at 15% -10%, hsl(var(--primary) / 0.18) 0%, transparent 45%),
    radial-gradient(circle at 85% 0%, hsl(263 80% 60% / 0.14) 0%, transparent 40%);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Hind Siliguri', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.bg-primary { background-color: hsl(var(--primary)); }
.text-primary { color: hsl(var(--primary)); }
.bg-primary-fg { color: hsl(var(--primary-foreground)); }
.bg-card { 
  background-color: hsl(var(--card)); 
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
}
.text-card-fg { color: hsl(var(--card-foreground)); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.border-theme { border-color: hsl(var(--border)); }
.bg-accent { background-color: hsl(var(--accent)); }
.text-accent { color: hsl(var(--accent-foreground)); }

/* Product Page Button Styling */
.btn-outline-primary {
  border: 2px solid hsl(var(--primary));
  color: hsl(var(--primary));
  background-color: transparent;
  transition: all 0.2s ease-in-out;
}
.btn-outline-primary:hover {
  background-color: hsl(var(--primary)) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-glow);
}
.dark .btn-outline-primary:hover {
  background-color: hsl(var(--primary)) !important;
  color: #ffffff !important;
}

.bg-gradient-hero { background: var(--gradient-hero); }
.bg-gradient-soft { background: var(--gradient-soft); }
.bg-gradient-card { background: var(--gradient-card); }

.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.shadow-glow { box-shadow: var(--shadow-glow); }
.shadow-float { box-shadow: var(--shadow-lg); }

.glass {
  background: hsl(var(--card) / 0.88);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border: 1px solid hsl(var(--border) / 0.85);
  box-shadow: var(--shadow-soft);
}

.hover-lift {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: hsl(var(--border));
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.5); }

/* Animation utilities & Keyframes */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-float { animation: float 4s ease-in-out infinite; }

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
.animate-float-slow { animation: floatSlow 6s ease-in-out infinite; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px -3px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 28px 4px rgba(99, 102, 241, 0.6); }
}
.animate-pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }

/* Cart Badge Bounce Animation */
@keyframes cartBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.45) rotate(-10deg); }
  65% { transform: scale(1.15) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.animate-cart-bump {
  animation: cartBump 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Radar Wave for WhatsApp / Live status */
@keyframes radarWave {
  0% { transform: scale(0.95); opacity: 0.85; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
.animate-radar {
  animation: radarWave 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

/* Scroll Reveal Animations (Silky Smooth Spring Curves) */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.animate-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger Utilities */
.stagger-1 { transition-delay: 0.05s !important; }
.stagger-2 { transition-delay: 0.1s !important; }
.stagger-3 { transition-delay: 0.15s !important; }
.stagger-4 { transition-delay: 0.2s !important; }

/* Shimmer Wave for Special Badges */
@keyframes shimmerWave {
  0% { transform: translateX(-150%) skewX(-20deg); }
  100% { transform: translateX(250%) skewX(-20deg); }
}
.shimmer-badge {
  position: relative;
  overflow: hidden;
}
.shimmer-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmerWave 3s infinite;
}

/* Product Card Interactive Elevation & Glow */
.product-card-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease;
}
.product-card-hover:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 36px -8px rgba(99, 102, 241, 0.22), 0 6px 16px -4px rgba(15, 23, 42, 0.1);
  border-color: hsl(var(--primary) / 0.6);
}

.product-card-hover:hover img {
  transform: scale(1.06);
}

.product-card-hover img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glow on Focus & Hover for Buttons */
.shadow-glow {
  box-shadow: var(--shadow-glow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.shadow-glow:hover {
  box-shadow: 0 12px 32px -4px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}


/* Modern Toast Alert System */
#toast-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
@media (min-width: 640px) {
  #toast-container {
    bottom: 24px;
    right: 24px;
  }
}
.toast-msg {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 400px;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
}
@keyframes toastSlideIn {
  from { transform: translateY(30px) scale(0.92); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Mobile Safe Areas and App Shell */
.pb-mobile-nav {
  padding-bottom: 72px;
}
@media (min-width: 768px) {
  .pb-mobile-nav {
    padding-bottom: 0px;
  }
}

.mobile-bottom-bar {
  background: hsl(var(--card) / 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid hsl(var(--border) / 0.8);
}

/* Touch Friendly Utilities */
.touch-press {
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.touch-press:active {
  transform: scale(0.94);
  opacity: 0.9;
}

/* Smart Full Auto-Hide Header (Complete Screen Immersion on Scroll Down, Reveal on Scroll Up) */
#site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.3s ease,
              border-color 0.3s ease;
  will-change: transform;
}

/* When scrolling down, slide entire header and transparent background 100% off screen */
#site-header.header-hidden {
  transform: translateY(-100%) !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

/* When scrolling up, floating glass header with sleek drop shadow */
#site-header.header-scrolled {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Light Theme Contrast & Legibility Overhauls */
html:not(.dark) body {
  background-color: hsl(var(--background));
  color: #0f172a;
}

html:not(.dark) .text-muted-foreground {
  color: #475569;
}

html:not(.dark) .bg-card {
  background-color: #ffffff;
  border-color: #dbe2ea;
  box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.04);
}

html:not(.dark) .product-card-hover {
  background-color: #ffffff;
  border: 1px solid #dbe2ea;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 3px 0 rgba(15, 23, 42, 0.04);
}

html:not(.dark) .product-card-hover:hover {
  border-color: #6366f1;
  box-shadow: 0 14px 28px -6px rgba(99, 102, 241, 0.18), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
}

html:not(.dark) .bg-secondary\/30,
html:not(.dark) .bg-secondary\/40,
html:not(.dark) .bg-secondary\/50 {
  background-color: #eef2f6;
}

html:not(.dark) input:not([type="checkbox"]):not([type="radio"]),
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html:not(.dark) input:not([type="checkbox"]):not([type="radio"]):focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

html:not(.dark) .badge-pill {
  background-color: #eef2f6;
  color: #334155;
  border: 1px solid #cbd5e1;
}

/* Select & Option Styling for Maximum Contrast */
select {
  color: hsl(var(--foreground));
  background-color: hsl(var(--card));
}

select option {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 10px 14px;
}

html:not(.dark) select option {
  background-color: #ffffff;
  color: #0f172a;
}

/* Category Filter Bar Horizontal Scrollbar */
.category-scroll-bar::-webkit-scrollbar {
  height: 4px;
}

.category-scroll-bar::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 9999px;
}
