@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --blu: #0f172a;
  --blu-light: #1e3a5f;
  --arancione: #f97316;
  --arancione-glow: rgba(249, 115, 22, 0.45);
  --rosso: #ef4444;
  --bianco: #fafafa;
  --slate: #334155;
  --verde: #22c55e;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bianco);
  color: var(--slate);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ── NAVBAR ── */
.nav-main {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(249, 115, 22, 0.15);
  transition: background 0.3s, box-shadow 0.3s;
}
.nav-main.scrolled {
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.nav-logo { transition: transform 0.3s; }
.nav-logo:hover { transform: scale(1.03); }

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #f97316 100%);
  background-size: 200% 200%;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, background-position 0.4s;
  box-shadow: 0 4px 20px var(--arancione-glow);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transition: left 0.5s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--arancione-glow);
  background-position: 100% 0;
}
.btn-primary:hover::after { left: 150%; }
.btn-primary:active { transform: translateY(0); }

.btn-hero {
  font-size: 1.125rem;
  padding: 1rem 2.5rem;
  border-radius: 16px;
  animation: pulse-glow 2.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 24px var(--arancione-glow); }
  50% { box-shadow: 0 4px 40px rgba(249, 115, 22, 0.65), 0 0 60px rgba(249, 115, 22, 0.2); }
}

/* ── HERO ── */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  background-size: 400% 400%;
  animation: gradient-shift 12s ease infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  animation: float-orb 8s ease-in-out infinite;
}
.hero-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(249,115,22,0.4) 0%, transparent 70%);
  top: -100px; right: -80px;
  animation-delay: 0s;
}
.hero-orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, transparent 70%);
  bottom: -80px; left: -60px;
  animation-delay: -3s;
}
.hero-orb-3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(249,115,22,0.25) 0%, transparent 70%);
  top: 50%; left: 30%;
  animation-delay: -5s;
}
@keyframes float-orb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(249,115,22,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249,115,22,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #fb923c;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
  animation: fade-up 0.8s ease both;
}
.hero-badge-dot {
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: blink 1.5s ease infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #22c55e; }
  50% { opacity: 0.5; }
}

.hero-title {
  animation: fade-up 0.8s ease 0.1s both;
}
.hero-title-accent {
  background: linear-gradient(90deg, #f97316, #fbbf24, #f97316);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 3s linear infinite;
}
@keyframes shimmer-text {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-subtitle { animation: fade-up 0.8s ease 0.2s both; }
.hero-cta-wrap { animation: fade-up 0.8s ease 0.35s both; }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
  animation: fade-up 0.8s ease 0.5s both;
}
.hero-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: #f97316;
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* ── MARQUEE ── */
.marquee-wrap {
  background: linear-gradient(90deg, #0f172a, #1e293b, #0f172a);
  border-top: 1px solid rgba(249,115,22,0.2);
  border-bottom: 1px solid rgba(249,115,22,0.2);
  overflow: hidden;
  padding: 0.75rem 0;
}
.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee 25s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.marquee-track span em { color: #f97316; font-style: normal; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── TRUST CARDS ── */
.trust-card {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s, border-color 0.35s;
  box-shadow: 0 4px 20px rgba(15,23,42,0.06);
}
.trust-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 40px rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.25);
}
.trust-icon {
  font-size: 2rem;
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.trust-card:hover .trust-icon { transform: scale(1.2) rotate(-5deg); }

/* ── SECTION TITLES ── */
.section-title {
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 60px; height: 4px;
  background: linear-gradient(90deg, #f97316, transparent);
  border-radius: 2px;
}

/* ── PRODUCT CARDS ── */
.card-prodotto {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15,23,42,0.08);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s;
  border: 1px solid rgba(15,23,42,0.04);
  position: relative;
}
.card-prodotto:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 48px rgba(15,23,42,0.14), 0 0 0 1px rgba(249,115,22,0.1);
}
.card-prodotto .img-wrap {
  overflow: hidden;
  position: relative;
}
.card-prodotto img {
  transition: transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
.card-prodotto:hover img { transform: scale(1.08); }

.card-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(239,68,68,0.4);
  letter-spacing: 0.05em;
}

.badge-sconto {
  background: linear-gradient(135deg, var(--rosso), #f97316);
  color: white;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
}

.badge-verde {
  background: var(--verde);
  color: white;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 6px;
}

.prezzo-scontato { color: var(--arancione); font-size: 1.25rem; font-weight: 800; }
.prezzo-originale { text-decoration: line-through; color: #94a3b8; font-size: 0.9rem; }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── CATALOG / PRODUCT extras ── */
.search-bar {
  background: white;
  border: 2px solid rgba(15,23,42,0.08);
  border-radius: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.search-bar:focus-within {
  border-color: rgba(249,115,22,0.4);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.1);
}

.product-gallery-main {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(15,23,42,0.15);
  transition: transform 0.4s;
}
.product-gallery-main:hover { transform: scale(1.01); }

.trust-box {
  background: linear-gradient(135deg, rgba(15,23,42,0.03), rgba(249,115,22,0.05));
  border: 1px solid rgba(249,115,22,0.12);
  border-radius: 16px;
}

/* ── FOOTER GLOW ── */
footer {
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249,115,22,0.5), transparent);
}

/* ── CART TOAST ── */
.cart-toast {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  background: #0f172a;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  border-left: 4px solid #f97316;
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  font-weight: 600;
  font-size: 0.9rem;
}
.cart-toast.show { transform: translateX(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}


/* ── RECENSIONI ── */
.rating-stars { color: #f97316; font-size: 1.1rem; letter-spacing: 1px; }
.review-card {
  background: white; border-radius: 14px; padding: 1rem 1.25rem;
  border: 1px solid rgba(15,23,42,0.06); box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.review-verified { color: #22c55e; font-size: 0.7rem; font-weight: 600; }
.specs-table td { padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.875rem; }
.specs-table td:first-child { color: #64748b; width: 40%; }

/* ── CHAT GEMMA ── */
#chat-widget { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9998; font-family: inherit; }
#chat-toggle {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #f97316, #fb923c);
  box-shadow: 0 6px 24px rgba(249,115,22,0.45);
  font-size: 1.5rem; transition: transform 0.2s;
}
#chat-toggle:hover { transform: scale(1.08); }
#chat-panel {
  display: none; position: absolute; bottom: 70px; right: 0;
  width: 340px; max-width: calc(100vw - 2rem); height: 420px;
  background: white; border-radius: 18px;
  box-shadow: 0 16px 48px rgba(15,23,42,0.2);
  flex-direction: column; overflow: hidden;
  border: 1px solid rgba(249,115,22,0.15);
}
#chat-panel.open { display: flex; }
.chat-header {
  background: #0f172a; color: white; padding: 0.875rem 1rem;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 0.9rem;
}
#chat-close { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 1.2rem; }
#chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem;
  background: #f8fafc;
}
.chat-msg { max-width: 85%; padding: 0.6rem 0.9rem; border-radius: 14px; font-size: 0.85rem; line-height: 1.45; }
.chat-msg-user { align-self: flex-end; background: #f97316; color: white; border-bottom-right-radius: 4px; }
.chat-msg-assistant { align-self: flex-start; background: white; color: #334155; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; }
.chat-loading { opacity: 0.6; font-style: italic; }
#chat-form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid #e2e8f0; background: white; }
#chat-input { flex: 1; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.5rem 0.75rem; font-size: 0.85rem; outline: none; }
#chat-input:focus { border-color: #f97316; }
#chat-form button { background: #f97316; color: white; border: none; border-radius: 10px; padding: 0.5rem 1rem; font-weight: 700; cursor: pointer; font-size: 0.85rem; }
@media (max-width: 480px) { #chat-panel { width: calc(100vw - 1rem); right: -0.5rem; } }
