/* ============================================================
   VITALHEALTH — Premium Wellness Supplements
   Design System + Product Cards + Carousel + Voice Agent UI
   ============================================================ */

/* ---------- CSS VARIABLES (Design Tokens) ---------- */
:root {
  /* Colors */
  --bg-primary: #0a0f1c;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1e2a42;
  --surface: #232d45;
  --accent-1: #00d4aa;
  --accent-2: #0066ff;
  --accent-gradient: linear-gradient(135deg, #00d4aa 0%, #0066ff 100%);
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger: #ef4444;
  --success: #22c55e;
  --border: rgba(255,255,255,0.06);
  --glass: rgba(17,24,39,0.85);
  --glass-border: rgba(255,255,255,0.1);

  /* Typography */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-hero: clamp(2rem, 5vw, 3.5rem);

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(0,212,170,0.3);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ---------- UTILITY ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ---------- LOADING SKELETON ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--surface) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,15,28,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-4) var(--sp-6);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  color: #fff;
}

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

/* Category Filter Nav */
.category-nav {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.cat-btn {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}

.cat-btn:hover, .cat-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(0,212,170,0.25);
}

/* ---------- HERO SECTION ---------- */
.hero {
  position: relative;
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,212,170,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 100%, rgba(0,102,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--sp-4);
}

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

.hero p {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--sp-8);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  color: var(--accent-1);
  margin-bottom: var(--sp-6);
}

/* ---------- PRODUCT GRID ---------- */
.product-section {
  padding: var(--sp-8) var(--sp-6) var(--sp-16);
  max-width: 1320px;
  margin: 0 auto;
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-8);
  text-align: center;
}

#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-6);
}

/* ---------- PRODUCT CARD ---------- */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0,212,170,0.2);
}

/* Highlight effect when voice agent finds product */
.product-card.highlighted {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-glow), 0 0 60px rgba(0,212,170,0.15);
  animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50% { box-shadow: 0 0 50px rgba(0,212,170,0.5), 0 0 80px rgba(0,212,170,0.2); }
}

/* Discount badge */
.card-badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  background: var(--danger);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 2;
  letter-spacing: 0.02em;
}

/* ---------- INFINITE CSS CAROUSEL ---------- */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.carousel-track {
  display: flex;
  width: calc(240px * 12); /* 6 original + 6 cloned */
  height: 100%;
  animation: carousel-slide 24s linear infinite;
}

.carousel-track:hover {
  animation-play-state: paused;
}

.carousel-slide {
  flex: 0 0 240px;
  height: 100%;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform var(--duration-normal) var(--ease-out);
}

.carousel-slide img:hover {
  transform: scale(1.05);
}

@keyframes carousel-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-240px * 6)); }
}

/* Image placeholder (when img fails to load) */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-card) 100%);
  display: grid;
  place-items: center;
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

/* ---------- CARD BODY ---------- */
.card-body {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-1);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.card-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.card-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-4);
  flex: 1;
}

/* Star Rating */
.card-rating {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: var(--gold);
  font-size: var(--fs-sm);
}

.star.empty { color: var(--text-muted); }

.rating-text {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* Price Row */
.card-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.price-current {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--accent-1);
}

.price-original {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: line-through;
}

/* CTA Button */
.card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3) var(--sp-6);
  background: var(--accent-gradient);
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.card-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.card-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,212,170,0.35);
}

.card-cta:hover::before { opacity: 1; }

/* ---------- FAB — Floating Action Button ---------- */
#voice-fab {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 24px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(0,212,170,0.3);
  z-index: 1000;
  transition: transform var(--duration-normal) var(--ease-spring);
  animation: fab-pulse 3s ease-in-out infinite;
}

#voice-fab:hover {
  transform: scale(1.1);
}

#voice-fab.active {
  animation: none;
  transform: rotate(45deg) scale(1.05);
}

@keyframes fab-pulse {
  0%, 100% { box-shadow: var(--shadow-lg), 0 0 0 0 rgba(0,212,170,0.4); }
  50% { box-shadow: var(--shadow-lg), 0 0 0 14px rgba(0,212,170,0); }
}

/* ---------- VOICE MODAL ---------- */
#voice-modal {
  position: fixed;
  bottom: 110px;
  right: var(--sp-8);
  width: 380px;
  max-height: 520px;
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
}

#voice-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: var(--fs-base);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.modal-title .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  animation: dot-blink 2s ease-in-out infinite;
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lang-toggle {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-1);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
}

.lang-toggle:hover {
  background: rgba(0,212,170,0.2);
}

/* Modal Chat Body */
.modal-chat {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 200px;
  max-height: 320px;
}

.chat-bubble {
  max-width: 85%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  line-height: 1.5;
  animation: bubble-in var(--duration-normal) var(--ease-spring);
}

@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.agent {
  background: var(--surface);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: var(--sp-1);
}

.chat-bubble.user {
  background: var(--accent-gradient);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: var(--sp-1);
}

/* Modal Input Area */
.modal-input-area {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
}

.modal-input-area input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--sp-2) var(--sp-4);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--duration-fast);
}

.modal-input-area input:focus {
  border-color: var(--accent-1);
}

.mic-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #fff;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: transform var(--duration-fast) var(--ease-spring);
  flex-shrink: 0;
}

.mic-btn:hover { transform: scale(1.1); }

.mic-btn.listening {
  animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,170,0.5); }
  50% { box-shadow: 0 0 0 12px rgba(0,212,170,0); }
}

/* Waveform animation during listening */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: var(--sp-3);
  justify-content: center;
}

.waveform.hidden { display: none; }

.wave-bar {
  width: 4px;
  height: 20px;
  background: var(--accent-1);
  border-radius: var(--radius-full);
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 28px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; height: 16px; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--sp-12) var(--sp-6) var(--sp-8);
  text-align: center;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}

.footer-disclaimer {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--sp-6);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.footer-links a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}

.footer-links a:hover { color: var(--accent-1); }

.footer-copy {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  #product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .category-nav { display: none; }

  .hero { padding: var(--sp-10) var(--sp-4); }

  #product-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  #voice-modal {
    right: var(--sp-4);
    left: var(--sp-4);
    width: auto;
    bottom: 100px;
  }

  #voice-fab {
    bottom: var(--sp-6);
    right: var(--sp-6);
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .header-inner { padding: 0; }
  .logo { font-size: var(--fs-base); }
  .carousel-wrapper { height: 200px; }
  .carousel-track { width: calc(200px * 12); }
  .carousel-slide { flex: 0 0 200px; }

  @keyframes carousel-slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-200px * 6)); }
  }
}

/* ---------- SOFIA FLOATING AVATAR ---------- */
.sofia-container {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  margin-top: -120px;
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.sofia-avatar-btn {
  position: relative;
  width: clamp(90px, 12vw, 140px);
  height: auto;
  overflow: visible;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 300ms;
  animation: sofia-float 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0,212,170,0.3));
}

.sofia-avatar-btn:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 12px 32px rgba(0,212,170,0.5));
}

.sofia-avatar-btn:active {
  transform: scale(0.95);
}

.sofia-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.sofia-listening-ring {
  position: absolute;
  top: 15%;
  left: 50%;
  width: 80%;
  height: 45%;
  transform: translate(-50%, 0);
  border-radius: 50%;
  border: 3px solid var(--accent-1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms;
}

.sofia-listening-ring.active {
  opacity: 1;
  animation: sofia-ring-pulse 1.5s ease-out infinite;
}

@keyframes sofia-ring-pulse {
  0% { transform: translate(-50%, 0) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, 0) scale(1.6); opacity: 0; }
}

@keyframes sofia-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.sofia-lang-btn {
  padding: 0.25rem 0.75rem;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-1);
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.25);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 150ms;
  letter-spacing: 0.05em;
}

.sofia-lang-btn:hover {
  background: rgba(0,212,170,0.25);
}

.sofia-tooltip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(17,24,39,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 2px solid rgba(0,212,170,0.4);
  border-radius: 1.5rem;
  padding: 1.5rem 2rem;
  min-width: 280px;
  max-width: 340px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.7), 0 0 30px rgba(0,212,170,0.25);
  opacity: 0;
  animation: tooltip-in-centered 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1s forwards;
  z-index: 10000;
  text-align: center;
  pointer-events: auto;
}

.sofia-tooltip::after {
  display: none;
}

.sofia-tooltip p {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.sofia-tooltip p:last-of-type { margin-bottom: 0; }

.sofia-tooltip-en {
  color: var(--accent-1) !important;
  font-size: 0.9rem !important;
  font-style: italic;
}

.sofia-tooltip-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 150ms;
}

.sofia-tooltip-close:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
  transform: scale(1.1);
}

.sofia-tooltip.hidden {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tooltip-in-centered {
  from { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.sofia-container.entering {
  animation: sofia-enter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes sofia-enter {
  from { opacity: 0; right: -100px; }
  to { opacity: 1; right: 1.5rem; }
}

/* Sofia responsive */
@media (max-width: 768px) {
  .sofia-container {
    right: 0.75rem;
    top: auto;
    bottom: 100px;
    margin-top: 0;
  }

  .sofia-avatar-btn { width: 70px; }

  .sofia-tooltip {
    min-width: 260px;
    max-width: 300px;
  }

  .sofia-tooltip p { font-size: 0.95rem; }

  @keyframes sofia-enter {
    from { opacity: 0; right: -80px; }
    to { opacity: 1; right: 0.75rem; }
  }
}

@media (max-width: 480px) {
  .sofia-avatar-btn { width: 60px; }
  .sofia-container { bottom: 90px; right: 0.5rem; }
  .sofia-tooltip { min-width: 240px; max-width: 280px; }
}

/* ---------- PRINT ---------- */
@media print {
  #voice-fab, #voice-modal, .site-header, .sofia-container { display: none !important; }
  body { background: #fff; color: #000; }
  .product-card { break-inside: avoid; border: 1px solid #ccc; }
}

/* ==========================================================================
   11. SOFIA ANIMATION OVERLAY
   ========================================================================== */
.sofia-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 26, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.sofia-overlay.hidden {
  display: none;
  opacity: 0;
}

.sofia-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  padding: var(--sp-6);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.15);
}

.sofia-overlay-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-cyan);
  animation: pulseGlow 2s infinite ease-in-out;
  margin-bottom: var(--sp-3);
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px var(--accent-cyan); }
  50% { box-shadow: 0 0 25px var(--accent-cyan); }
  100% { box-shadow: 0 0 5px var(--accent-cyan); }
}
