/* ============================================================
   Tonimax — stili del progetto (palette blu mare/oro)
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --blu-mare: #0a2f44;
  --blu-notte: #041e2b;
  --oro: #c9a959;
  --oro-chiaro: #e6c988;
  --coral: #e76f51;
  --sabbia: #f8f4ef;
  --bianco: #ffffff;
  --grigio-scuro: #2d3e4f;
  --ombra: 0 20px 40px -10px rgba(0, 0, 0, 0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--sabbia);
  color: var(--grigio-scuro);
  overflow-x: hidden;
  cursor: none; /* cursore personalizzato */
  line-height: 1.5;
}

/* ===== CURSORE PERSONALIZZATO ===== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 8px; height: 8px;
  background: var(--oro);
  transition: transform 0.05s linear;
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 2px solid var(--oro);
  transition: transform 0.15s ease-out, width 0.2s, height 0.2s, background 0.2s;
}
.cursor-ring.hovering {
  width: 60px; height: 60px;
  background: rgba(201, 169, 89, 0.15);
  border-color: var(--oro-chiaro);
}
@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; letter-spacing: -0.02em; }
a { color: inherit; }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--oro);
  outline-offset: 3px;
}

.skip-link {
  position: fixed; top: -100px; left: 12px;
  background: var(--oro); color: var(--blu-notte);
  padding: 10px 16px; border-radius: 8px; z-index: 4000;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(10, 47, 68, 0.92);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 1000;
  padding: 0.8rem 5%;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  border-bottom: 2px solid var(--oro);
  transition: padding 0.3s, background 0.3s;
  gap: 1rem;
}
.navbar.scrolled {
  padding: 0.5rem 5%;
  background: rgba(4, 30, 43, 0.98);
}

.logo { display: flex; align-items: center; gap: 12px; cursor: pointer; text-decoration: none; }
.logo-icon {
  width: 48px; height: 48px;
  object-fit: contain;
  flex: 0 0 auto;
  transition: transform 0.4s;
}
.logo:hover .logo-icon { transform: scale(1.08); }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text .brand {
  font-family: 'Playfair Display', serif; font-weight: 900;
  font-size: 1.6rem; color: var(--bianco); letter-spacing: 1px;
}
.logo-text .sub {
  font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 3px; color: var(--oro-chiaro); font-weight: 600;
}

.nav-links { display: flex; gap: 2.2rem; align-items: center; }
.nav-links a {
  color: var(--bianco); text-decoration: none;
  font-weight: 500; font-size: 1rem;
  position: relative; transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -6px; left: 0;
  width: 0%; height: 2px; background: var(--oro);
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--oro-chiaro); }
.nav-links a:hover::after { width: 100%; }

.nav-links .nav-logout { margin: 0; }
.nav-links .nav-logout-btn {
  color: var(--bianco); background: none; border: 0; padding: 0;
  font: inherit; font-weight: 500; font-size: 1rem;
  cursor: pointer; position: relative; transition: color 0.2s;
  white-space: nowrap;
}
.nav-links .nav-logout-btn::after {
  content: ''; position: absolute; bottom: -6px; left: 0;
  width: 0%; height: 2px; background: var(--oro);
  transition: width 0.3s;
}
.nav-links .nav-logout-btn:hover { color: var(--oro-chiaro); }
.nav-links .nav-logout-btn:hover::after { width: 100%; }

.pro-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(201, 169, 89, 0.18);
  color: var(--oro-chiaro); border: 1px solid rgba(201, 169, 89, 0.5);
  padding: 6px 12px; border-radius: 40px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--oro);
  color: var(--oro); border-radius: 10px;
  width: 44px; height: 44px; cursor: pointer; font-size: 1.2rem;
}

.cart-btn {
  background: var(--oro); border: none; color: var(--blu-notte);
  font-weight: 700; padding: 12px 22px; border-radius: 40px;
  font-size: 1rem; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all 0.25s;
  box-shadow: 0 6px 14px rgba(201, 169, 89, 0.4);
  animation: pulse-glow 2.5s infinite;
  white-space: nowrap;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 6px 14px rgba(201, 169, 89, 0.4); }
  50% { box-shadow: 0 6px 28px rgba(201, 169, 89, 0.8); }
}
.cart-btn:hover { background: var(--oro-chiaro); transform: scale(1.05); animation: none; }

.cart-count {
  background: var(--blu-notte); color: var(--oro);
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  transition: transform 0.3s;
}
.cart-count.bump { animation: bump 0.4s; }
@keyframes bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.6); background: var(--coral); }
  100% { transform: scale(1); }
}

/* ===== HERO ===== */
.hero {
  min-height: 92vh;
  display: flex; align-items: center;
  padding: 2rem 5%;
  background: linear-gradient(135deg, #041e2b 0%, #0a2f44 60%, #1b4f6e 100%);
  position: relative; overflow: hidden;
  gap: 3rem;
}
.hero::before {
  content: '';
  position: absolute; top: -20%; right: -10%;
  width: 70%; height: 140%;
  background: radial-gradient(circle, rgba(201, 169, 89, 0.15) 0%, transparent 70%);
  border-radius: 50%; z-index: 0;
}

/* Particelle animate */
.particles { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute;
  background: rgba(201, 169, 89, 0.6);
  border-radius: 50%;
  animation: floatUp linear infinite;
  box-shadow: 0 0 8px rgba(201, 169, 89, 0.6);
}
@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(-20vh) scale(1.2); opacity: 0; }
}

.hero-content { position: relative; z-index: 2; flex: 1; max-width: 650px; }
.hero-content .badge {
  display: inline-block;
  background: rgba(201, 169, 89, 0.18);
  backdrop-filter: blur(4px);
  color: var(--oro-chiaro);
  padding: 0.6rem 1.4rem; border-radius: 40px;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 1px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(201, 169, 89, 0.5);
  animation: shimmer 3s infinite;
  background-size: 200% auto;
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.hero-content .badge i { animation: spin-slow 6s linear infinite; display: inline-block; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.hero-content h1 {
  font-size: 4rem; color: var(--bianco);
  line-height: 1.1; margin-bottom: 1.2rem;
}
.hero-content h1 .highlight {
  color: var(--oro);
  text-shadow: 0 0 20px rgba(201, 169, 89, 0.5);
  background: linear-gradient(90deg, var(--oro), var(--oro-chiaro), var(--oro));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
.hero-content p {
  font-size: 1.2rem; color: #d9e4ec;
  margin-bottom: 2.5rem; font-weight: 300;
  max-width: 550px; line-height: 1.6;
}
.hero-html { color: #d9e4ec; margin-bottom: 2rem; max-width: 550px; }
.hero-html p { margin-bottom: 1rem; }
.hero-cta { display: flex; gap: 20px; flex-wrap: wrap; }

.btn-primary, .btn-outline {
  padding: 16px 38px; border-radius: 50px;
  font-size: 1.1rem; cursor: pointer;
  text-decoration: none; display: inline-block;
  position: relative; overflow: hidden;
  transition: all 0.3s;
  font-family: 'Inter', sans-serif;
}
.btn-primary {
  background: var(--oro); border: none; color: var(--blu-notte);
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(201, 169, 89, 0.35);
}
.btn-primary::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
  background: var(--oro-chiaro);
  transform: translateY(-4px);
  box-shadow: 0 20px 35px rgba(201, 169, 89, 0.5);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--oro); color: var(--oro);
  font-weight: 600;
}
.btn-outline:hover { background: var(--oro); color: var(--blu-notte); transform: translateY(-4px); }
button.btn-primary, button.btn-outline { font-family: 'Inter', sans-serif; }

.hero-image {
  flex: 1; position: relative; z-index: 2;
  display: flex; justify-content: center; align-items: center;
}
.hero-image img {
  max-width: 100%; height: auto;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  border: 4px solid var(--oro);
  transition: all 0.4s;
  animation: morph 8s ease-in-out infinite, float 5s ease-in-out infinite;
}
@keyframes morph {
  0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
.hero-image img:hover { transform: scale(1.03) rotate(1deg); }

/* ===== SEZIONE PRODOTTI ===== */
.section-title {
  text-align: center; font-size: 2.8rem;
  color: var(--blu-mare); margin-bottom: 0.5rem;
  position: relative;
}
.section-title::after {
  content: ''; display: block;
  width: 90px; height: 4px; background: var(--oro);
  margin: 20px auto 0; border-radius: 4px;
  animation: width-pulse 2.5s ease-in-out infinite;
}
@keyframes width-pulse {
  0%, 100% { width: 90px; }
  50% { width: 150px; }
}
.section-sub {
  text-align: center; color: #5b6f80;
  font-size: 1.2rem; margin-bottom: 3.5rem; font-weight: 300;
}

.products { padding: 6rem 5%; background: var(--bianco); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem; margin-top: 2rem;
}

/* Card con TILT 3D */
.product-card, .mare-card, .category-card {
  background: var(--bianco);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  border: 1px solid rgba(201, 169, 89, 0.2);
  position: relative;
  display: flex; flex-direction: column;
  transform-style: preserve-3d;
  transition: box-shadow 0.35s, border-color 0.35s, transform 0.15s ease-out;
  will-change: transform;
}
.product-card:hover, .mare-card:hover, .category-card:hover {
  box-shadow: var(--ombra);
  border-color: var(--oro);
}
/* Riflesso al passaggio del mouse */
.product-card::after, .mare-card::after, .category-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(201, 169, 89, 0.25), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.product-card:hover::after, .mare-card:hover::after, .category-card:hover::after { opacity: 1; }

.product-img {
  height: 200px; background-size: cover; background-position: center;
  position: relative;
  transition: transform 0.6s ease;
  overflow: hidden;
  background-color: var(--sabbia);
}
.product-card:hover .product-img, .category-card:hover .product-img { transform: scale(1.1); }
.product-img::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(10, 47, 68, 0.5));
  opacity: 0; transition: opacity 0.4s;
}
.product-card:hover .product-img::before { opacity: 1; }
.product-img-link { display: block; text-decoration: none; color: inherit; }

.product-tag {
  position: absolute; top: 16px; left: 16px;
  background: var(--oro); color: var(--blu-notte);
  font-weight: 700; font-size: 0.75rem;
  padding: 6px 14px; border-radius: 30px;
  letter-spacing: 0.5px; text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 2;
  animation: tagPulse 2s infinite;
}
@keyframes tagPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.product-tag.pesce { background: var(--coral); color: white; }

.product-info {
  padding: 1.8rem 1.5rem 1.8rem;
  display: flex; flex-direction: column; flex: 1;
  transform: translateZ(20px);
}
.product-info h3 {
  font-size: 1.5rem; font-family: 'Playfair Display', serif;
  color: var(--blu-mare); margin-bottom: 0.4rem;
}
.product-info h3 a { text-decoration: none; }
.product-category {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--oro); font-weight: 700; margin-bottom: 0.7rem;
}
.product-info .desc {
  font-size: 0.95rem; color: #6e7e8d;
  margin-bottom: 1.2rem; font-weight: 300;
  line-height: 1.4; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem;
}
.price {
  font-weight: 800; font-size: 1.5rem; color: var(--blu-notte);
}
.price small { font-size: 0.8rem; font-weight: 400; color: #8a9aa8; }

.add-to-cart {
  background: var(--blu-mare); border: none; color: white;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  flex: 0 0 auto;
}
.add-to-cart:hover {
  background: var(--oro); color: var(--blu-notte);
  transform: rotate(90deg) scale(1.1);
}
.add-to-cart.clicked { animation: clickPop 0.5s; }
@keyframes clickPop {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.5) rotate(180deg); background: var(--coral); }
  100% { transform: scale(1) rotate(360deg); }
}
.add-to-cart:disabled { opacity: 0.45; cursor: not-allowed; }
.add-to-cart:disabled:hover { transform: none; background: var(--blu-mare); color: white; }

.availability {
  display: inline-block; font-size: 0.8rem; font-weight: 600;
  color: #2f7d5b; margin-bottom: 0.8rem;
}
.availability.out-of-stock { color: var(--coral); }
.category-link {
  color: var(--blu-mare); font-weight: 700; font-size: 0.9rem;
  margin-top: auto;
}

/* ===== SEZIONE MARE ===== */
.mare-section {
  background: linear-gradient(120deg, #0a2f44 0%, #1b4f6e 100%);
  padding: 6rem 5%; color: white;
  position: relative; overflow: hidden;
}
.mare-section::before {
  content: '🐟'; position: absolute;
  font-size: 25rem; opacity: 0.03;
  bottom: -10%; right: 0;
  transform: rotate(-15deg);
  animation: swim 20s linear infinite;
}
@keyframes swim {
  0% { transform: rotate(-15deg) translateX(0); }
  50% { transform: rotate(-15deg) translateX(-40px); }
  100% { transform: rotate(-15deg) translateX(0); }
}

.mare-header {
  display: flex; justify-content: space-between;
  align-items: flex-end; margin-bottom: 3.5rem;
  flex-wrap: wrap; gap: 2rem;
}
.mare-header .section-title { color: white; text-align: left; margin-bottom: 0; }
.mare-header .section-title::after { margin: 20px 0 0; }
.mare-header p {
  color: #c9dae7; max-width: 400px;
  font-size: 1.1rem; font-weight: 300;
}
.mare-header p i { animation: spin-slow 4s linear infinite; display: inline-block; }

.mare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
}
.mare-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 169, 89, 0.3);
}
.mare-card:hover {
  border-color: var(--oro);
  background: rgba(255, 255, 255, 0.12);
}
.mare-img {
  height: 200px; background-size: cover; background-position: center;
  position: relative; transition: transform 0.6s ease;
  background-color: rgba(255,255,255,0.05);
}
.mare-card:hover .mare-img { transform: scale(1.1); }
.mare-info { padding: 1.8rem 1.5rem; transform: translateZ(20px); }
.mare-info h3 {
  font-size: 1.6rem; color: var(--oro-chiaro);
  font-family: 'Playfair Display', serif; margin-bottom: 0.3rem;
}
.mare-info h3 a { text-decoration: none; }
.mare-info .provenienza {
  font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 2px; color: #9bb7cc; margin-bottom: 1rem;
}
.mare-info .desc {
  color: #d0e1ed; font-size: 0.95rem;
  margin-bottom: 1.5rem; line-height: 1.5;
}
.mare-info .price { color: white; font-size: 1.6rem; margin-bottom: 1.2rem; }
.mare-info .price small { color: #9bb7cc; }
.mare-availability { color: var(--oro-chiaro); }

.btn-mare {
  background: var(--oro); color: var(--blu-notte);
  border: none; padding: 12px 28px; border-radius: 40px;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  width: 100%; transition: all 0.3s;
  position: relative; overflow: hidden;
  font-family: 'Inter', sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-mare::before {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.6s;
}
.btn-mare:hover::before { left: 100%; }
.btn-mare:hover { background: var(--oro-chiaro); letter-spacing: 1px; }
.btn-mare:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-mare.clicked { animation: clickPop 0.5s; }

/* ===== PRO BANNER ===== */
.pro-cta { padding: 4rem 5%; background: var(--sabbia); }
.pro-banner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 2rem;
  background: var(--blu-notte); border: 1px solid var(--oro);
  border-radius: 24px; padding: 2.5rem 3rem;
  box-shadow: var(--ombra);
}
.pro-banner .section-title { color: var(--oro-chiaro); font-size: 2.2rem; text-align: left; }
.pro-banner .section-title::after { margin: 16px 0 0; }
.pro-banner .section-sub { color: #aac2d4; text-align: left; margin-bottom: 0; }

/* ===== CARRELLO ===== */
.cart-panel {
  position: fixed; top: 0; right: -480px;
  width: 420px; max-width: 100vw; height: 100vh;
  background: var(--bianco);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
  z-index: 2000; transition: right 0.5s cubic-bezier(0.77, 0, 0.18, 1);
  display: flex; flex-direction: column;
  padding: 2rem 1.8rem; overflow-y: auto;
}
.cart-panel.open { right: 0; }
.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; border-bottom: 2px solid var(--sabbia);
  padding-bottom: 1rem;
}
.cart-header h3 { font-size: 1.8rem; color: var(--blu-mare); }
.close-cart {
  background: none; border: none; font-size: 2rem;
  cursor: pointer; color: var(--grigio-scuro); line-height: 1;
  transition: transform 0.3s, color 0.3s;
}
.close-cart:hover { transform: rotate(90deg); color: var(--coral); }

.cart-items { flex: 1; display: flex; flex-direction: column; gap: 1.2rem; }
.cart-item {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #eaeef2; padding-bottom: 0.8rem;
  animation: slideIn 0.4s ease;
  gap: 0.8rem;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.cart-item-info h4 { font-size: 1rem; font-weight: 600; color: var(--blu-mare); }
.cart-item-info .item-price { font-size: 0.9rem; color: #6e7e8d; }
.cart-item-actions { display: flex; align-items: center; gap: 10px; }
.cart-item-actions button {
  background: #f0f4f8; border: none; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; font-weight: 700;
  color: var(--blu-mare); transition: all 0.2s;
}
.cart-item-actions button:hover { background: var(--oro); color: var(--blu-notte); transform: scale(1.15); }
.cart-item-actions button.remove-item:hover { background: var(--coral); color: white; }
.cart-item-actions .item-qty { min-width: 22px; text-align: center; font-weight: 600; }

.cart-total {
  margin-top: 1.5rem; border-top: 2px solid var(--sabbia);
  padding-top: 1.5rem; font-size: 1.4rem; font-weight: 700;
  color: var(--blu-mare); display: flex; justify-content: space-between;
  gap: 1rem;
}
.cart-disclaimer { font-size: 0.8rem; color: #6e7e8d; margin-top: 0.8rem; }
.checkout-btn {
  background: var(--oro); border: none; color: var(--blu-notte);
  font-weight: 700; padding: 18px; border-radius: 50px;
  font-size: 1.2rem; margin-top: 1.5rem; cursor: pointer;
  transition: all 0.25s; width: 100%;
  position: relative; overflow: hidden;
  display: block; text-align: center; text-decoration: none;
  font-family: 'Inter', sans-serif;
}
.checkout-btn:hover { background: var(--oro-chiaro); transform: scale(1.02); }
.cart-full-link { display: block; text-align: center; margin-top: 1rem; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500; display: none;
  opacity: 0; transition: opacity 0.3s;
}
.overlay.active { display: block; opacity: 1; }

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
  position: fixed; top: 100px; right: 24px;
  z-index: 3000; display: flex; flex-direction: column; gap: 12px;
  max-width: calc(100vw - 24px);
}
.toast {
  background: var(--blu-notte);
  color: white; padding: 16px 24px;
  border-radius: 14px; border-left: 5px solid var(--oro);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; gap: 12px;
  font-weight: 500; min-width: 280px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.hide { animation: toastOut 0.4s forwards; }
.toast i { color: var(--oro); font-size: 1.4rem; }
.toast.toast-error { border-left-color: var(--coral); }
.toast.toast-error i { color: var(--coral); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(120%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(120%); }
}

/* ===== FOOTER ===== */
.footer {
  background: var(--blu-notte); color: #aac2d4;
  padding: 4rem 5% 2rem;
  position: relative; overflow: hidden;
}
.footer::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--oro), transparent);
  animation: shimmer 4s linear infinite;
  background-size: 200% auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3rem; margin-bottom: 3rem;
}
.footer h4 {
  color: var(--oro-chiaro); font-family: 'Playfair Display', serif;
  font-size: 1.4rem; margin-bottom: 1.2rem;
}
.footer p, .footer a {
  color: #aac2d4; text-decoration: none;
  line-height: 1.8; font-size: 0.95rem; transition: color 0.2s;
}
.footer a:hover { color: var(--oro); }
.footer .logo-icon { width: 40px; height: 40px; }
.footer-logo { margin-bottom: 1.5rem; }
.footer-social { display: flex; gap: 1rem; font-size: 1.3rem; align-items: center; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem; text-align: center; font-size: 0.9rem;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { transform: translateX(-60px); }
.reveal-left.visible { transform: translateX(0); }
.reveal-right { transform: translateX(60px); }
.reveal-right.visible { transform: translateX(0); }
.reveal-scale { transform: scale(0.85); }
.reveal-scale.visible { transform: scale(1); }

/* ===== CONTATORI ANIMATI ===== */
.stats-bar {
  display: flex; justify-content: center; gap: 4rem;
  flex-wrap: wrap; padding: 3rem 5%;
  background: var(--sabbia);
  border-bottom: 1px solid rgba(201, 169, 89, 0.2);
}
.stat-item { text-align: center; }
.stat-item .stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 3rem; font-weight: 900;
  color: var(--blu-mare);
  display: block;
}
.stat-item .stat-label {
  font-size: 0.9rem; text-transform: uppercase;
  letter-spacing: 2px; color: #6e7e8d; font-weight: 600;
}

/* ============================================================
   Classi generiche del contratto (catalogo, form, account, admin)
   ============================================================ */

.container { width: min(1400px, 92%); margin: 0 auto; padding: 3rem 0; }
.page-head { padding: 3rem 5% 0; }
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding: 1.5rem 5% 0; font-size: 0.9rem; color: #6e7e8d;
}
.breadcrumb a { color: var(--blu-mare); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--oro); text-decoration: underline; }

.grid-2, .grid-3 {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.panel {
  background: var(--bianco); border: 1px solid rgba(201, 169, 89, 0.25);
  border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}
.panel-head {
  padding: 1.2rem 1.5rem; border-bottom: 1px solid rgba(201, 169, 89, 0.2);
  background: linear-gradient(135deg, var(--blu-notte), var(--blu-mare));
}
.panel-head h2, .panel-head h3 { color: var(--oro-chiaro); font-size: 1.4rem; }
.panel-head h2 { font-size: 1.6rem; }
.panel-body { padding: 1.5rem; }
.panel-body > * + * { margin-top: 1rem; }

.form-grid {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label, .filters label {
  font-size: 0.85rem; font-weight: 700; color: var(--blu-mare);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.field input, .field select, .field textarea,
.filters input, .filters select, .filters textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid #cfd8df; background: var(--bianco);
  color: var(--grigio-scuro); font-family: 'Inter', sans-serif; font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.filters input:focus, .filters select:focus, .filters textarea:focus {
  outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(201, 169, 89, 0.2);
}
.field input:disabled, .field select:disabled { background: #f0f4f8; opacity: 0.7; }
.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.5rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 40px; cursor: pointer;
  text-decoration: none; font-family: 'Inter', sans-serif;
  font-weight: 700; font-size: 1rem; border: 2px solid transparent;
  transition: all 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-ghost { background: transparent; border-color: var(--blu-mare); color: var(--blu-mare); }
.btn-ghost:hover { background: var(--blu-mare); color: var(--bianco); }
.btn-danger { background: var(--coral); border-color: var(--coral); color: white; }
.btn-danger:hover { background: #d35a3d; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.filters { padding: 1.5rem; margin-bottom: 2.5rem; }
.filters .form-grid { margin-bottom: 0.5rem; }

.catalog-section { padding: 0 5% 6rem; }
.catalog-grid { margin-top: 0; }
.empty-state {
  text-align: center; padding: 4rem 1.5rem; color: #6e7e8d;
  background: var(--bianco); border: 1px dashed rgba(201, 169, 89, 0.5);
  border-radius: 20px; margin-top: 2rem;
}
.empty-state i { font-size: 2.5rem; color: var(--oro); display: block; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1.5rem; }

.pagination {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 1rem; margin-top: 3rem;
}
.page-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 40px;
  background: var(--blu-mare); color: var(--bianco);
  text-decoration: none; font-weight: 600;
  transition: background 0.2s;
}
.page-link:hover { background: var(--oro); color: var(--blu-notte); }
.page-link.disabled { background: #dfe6eb; color: #8a9aa8; cursor: not-allowed; }
.page-current { font-weight: 600; color: var(--blu-mare); }

.notice {
  background: rgba(201, 169, 89, 0.12);
  border-left: 4px solid var(--oro);
  border-radius: 8px; padding: 12px 16px;
  color: var(--grigio-scuro); font-size: 0.95rem;
}
.notice[hidden] { display: none; }
.notice-error { background: rgba(231, 111, 81, 0.12); border-left-color: var(--coral); }
.notice-success { background: rgba(47, 125, 91, 0.12); border-left-color: #2f7d5b; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; border-bottom: 2px solid var(--sabbia); }
.tab-btn {
  background: transparent; border: none; border-bottom: 3px solid transparent;
  padding: 12px 18px; cursor: pointer; font-weight: 700;
  color: #6e7e8d; font-family: 'Inter', sans-serif;
}
.tab-btn.active { color: var(--blu-mare); border-bottom-color: var(--oro); }
.tab-panel { padding: 1.5rem 0; }
.tab-panel[hidden] { display: none; }

.info-list { list-style: none; display: grid; gap: 0.8rem; }
.info-list li { padding-left: 1.6rem; position: relative; line-height: 1.6; }
.info-list li > i { position: absolute; left: 0; top: 0.2rem; color: var(--oro); }
.info-list strong { color: var(--blu-mare); }
.quote {
  border-left: 4px solid var(--oro); padding: 1rem 1.5rem;
  background: var(--sabbia); border-radius: 0 12px 12px 0;
  font-style: italic;
}
.checkbox-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 8px 0; font-weight: 500;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--oro); flex: 0 0 auto; }
.account-choice { margin-top: 0.75rem; }
.account-choice small { display: block; margin-left: 28px; }
.account-fields {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 2px solid var(--sabbia);
}
.account-fields[hidden] { display: none; }
.account-fields h3 { margin-bottom: 0.75rem; color: var(--blu-mare); }
.payment-proof-panel { margin-bottom: 1.5rem; }
.payment-proof-panel .notice a { color: inherit; text-decoration: underline; }
.payment-proof-form {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 2px solid var(--sabbia);
}
.payment-proof-form input[type="file"] { padding: 0.6rem; }
.radio-group { border: none; padding: 0; margin: 0 0 1.5rem; }
.radio-group legend {
  font-size: 0.85rem; font-weight: 700; color: var(--blu-mare);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.6rem;
}
.thumbnail {
  width: 56px; height: 56px; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(201, 169, 89, 0.3); flex: 0 0 auto;
}

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 480px; font-size: 0.95rem; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eaeef2; }
.data-table th {
  background: var(--sabbia); color: var(--blu-mare);
  text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px;
}
.data-table tbody tr:hover { background: rgba(201, 169, 89, 0.07); }
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }

.status-pill {
  display: inline-block; padding: 6px 14px; border-radius: 40px;
  font-size: 0.8rem; font-weight: 700;
  background: var(--sabbia); color: var(--blu-mare); border: 1px solid rgba(201,169,89,0.4);
}
.status-pill.ricevuto { background: rgba(201,169,89,0.2); }
.status-pill.in_lavorazione { background: rgba(60,130,190,0.15); color: #1b4f6e; }
.status-pill.preparato { background: rgba(47,125,91,0.15); color: #2f7d5b; }
.status-pill.spedito { background: rgba(28,92,140,0.15); color: #1c5c8c; }
.status-pill.completato { background: rgba(47,125,91,0.25); color: #216b4c; }
.status-pill.annullato { background: rgba(231,111,81,0.2); color: #b14b32; }

.pro-banner-inline {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  background: rgba(201, 169, 89, 0.12); border: 1px solid var(--oro);
  border-radius: 14px; padding: 1rem 1.5rem; margin-bottom: 1.5rem;
}

/* ===== DETTAGLIO PRODOTTO ===== */
.product-detail { padding: 3rem 5%; display: grid; gap: 3rem; grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr); }
.product-detail-img {
  min-height: 420px; background-size: cover; background-position: center;
  border-radius: 20px; border: 4px solid var(--oro); position: relative;
  box-shadow: var(--ombra); background-color: var(--sabbia);
}
.product-thumbs { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1rem; }
.product-thumb {
  width: 80px; height: 80px; background-size: cover; background-position: center;
  border-radius: 12px; border: 1px solid var(--oro); cursor: pointer;
  background-color: var(--sabbia);
}
.product-detail-info h1 { color: var(--blu-mare); font-size: 2.6rem; margin-bottom: 0.5rem; }
.product-code { font-size: 0.9rem; color: #6e7e8d; margin-bottom: 1rem; }
.product-detail-price { margin-bottom: 0.8rem; }
.product-description { line-height: 1.7; margin-bottom: 1.5rem; }
.purchase-row { align-items: end; }
.detail-add { white-space: nowrap; }
.price-disclaimer { font-size: 0.85rem; color: #6e7e8d; margin-top: 1rem; }
.product-tabs-panel { margin: 0 5% 4rem; padding: 1.5rem; }
.related-section { border-top: 1px solid rgba(201, 169, 89, 0.2); }

/* ===== CARRELLO / CHECKOUT / ORDINE ===== */
.cart-page, .checkout-form, .contact-page, .auth-page, .order-success { padding: 0 5% 5rem; }
.cart-page, .checkout-bottom, .contact-page, .auth-page, .order-success { display: grid; gap: 2rem; grid-template-columns: minmax(280px, 1.6fr) minmax(260px, 1fr); align-items: start; }
.cart-page { grid-template-columns: minmax(280px, 1.6fr) minmax(260px, 1fr); }
.cart-page-items { display: grid; gap: 1rem; }
.cart-page-item {
  display: flex; gap: 1rem; align-items: center;
  padding-bottom: 1rem; border-bottom: 1px solid #eaeef2;
}
.cart-page-item-info { flex: 1; min-width: 0; }
.cart-page-item-info h3 { font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 700; color: var(--blu-mare); }
.cart-page-item-info p { font-size: 0.85rem; color: #6e7e8d; }
.cart-page-item .item-line-total { font-weight: 800; color: var(--blu-notte); white-space: nowrap; }
.cart-page-actions { display: flex; align-items: center; gap: 6px; }
.cart-page-actions button {
  background: #f0f4f8; border: none; width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-weight: 700; color: var(--blu-mare);
}
.cart-page-actions button.remove-item:hover { background: var(--coral); color: white; }
.summary-list { display: grid; grid-template-columns: 1fr auto; gap: 0.8rem 1rem; }
.summary-list dt { color: #6e7e8d; }
.summary-list dd { text-align: right; font-weight: 700; color: var(--blu-mare); }
.summary-list .summary-total { font-size: 1.3rem; color: var(--blu-notte); }
.cart-summary .notice, .checkout-submit-panel .notice { margin-top: 1.5rem; }
.checkout-form > .panel { margin-bottom: 2rem; }
.checkout-form .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bank-instructions h3 { color: var(--blu-mare); margin-bottom: 0.8rem; }
.bank-instructions .info-list { margin-bottom: 0.8rem; }
.error-page { padding: 0 5% 6rem; max-width: 800px; }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 2500;
  background: var(--blu-notte); color: #e6eef4;
  border-top: 3px solid var(--oro);
  padding: 1.2rem 5%;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner-text { max-width: 760px; }
.cookie-banner-text strong { color: var(--oro-chiaro); font-family: 'Playfair Display', serif; font-size: 1.2rem; }
.cookie-banner-text p { font-size: 0.9rem; line-height: 1.5; margin: 0.4rem 0; }
.cookie-banner-text a { color: var(--oro-chiaro); }
.cookie-banner-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* ===== AUTOCOMPLETE ===== */
.autocomplete-menu {
  position: absolute; z-index: 1200; left: 0; right: 0; top: 100%;
  background: var(--bianco); border: 1px solid var(--oro);
  border-radius: 10px; box-shadow: var(--ombra);
  list-style: none; max-height: 260px; overflow-y: auto;
}
.autocomplete-menu li a { display: block; padding: 10px 14px; text-decoration: none; color: var(--blu-mare); }
.autocomplete-menu li a:hover { background: var(--sabbia); }
.field { position: relative; }

/* ===== ACCOUNT / ADMIN ===== */
.admin-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2rem; padding: 2rem 5%; }
.admin-main { min-width: 0; }
.admin-nav { display: flex; flex-direction: column; gap: 0.4rem; background: var(--bianco); border: 1px solid rgba(201,169,89,0.25); border-radius: 16px; padding: 1rem; height: fit-content; }
.admin-nav a { display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--blu-mare); font-weight: 600; }
.admin-nav a:hover { background: var(--sabbia); color: var(--oro); }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 2rem; }
.stat-grid > * { background: var(--bianco); border: 1px solid rgba(201,169,89,0.25); border-radius: 16px; padding: 1.5rem; text-align: center; }
.stat-grid .stat-number { font-family: 'Playfair Display', serif; font-size: 2.4rem; color: var(--blu-mare); display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.92rem; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 1024px) {
  .hero-content h1 { font-size: 3rem; }
  .hero { flex-direction: column; text-align: center; }
  .hero-content p { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-image { margin-top: 3rem; max-width: 520px; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--blu-notte); padding: 1rem 5%;
    border-bottom: 2px solid var(--oro); box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-links .pro-badge, .nav-links .nav-logout-btn { padding: 12px 0; width: 100%; text-align: left; }
  .nav-links .nav-logout { width: 100%; }
  .nav-links a::after, .nav-links .nav-logout-btn::after { display: none; }
  .product-detail { grid-template-columns: 1fr; }
  .product-detail-img { min-height: 320px; }
}

@media (max-width: 700px) {
  .hero-content h1 { font-size: 2.4rem; }
  .section-title { font-size: 2.2rem; }
  .cart-panel { width: 100vw; right: -100vw; }
  .mare-header { flex-direction: column; align-items: flex-start; }
  .stats-bar { gap: 2rem; }
  .stat-item .stat-number { font-size: 2.2rem; }
  .toast-container { right: 12px; left: 12px; }
  .toast { min-width: auto; }
  .cart-label { display: none; }
  .cart-page, .checkout-bottom, .contact-page, .auth-page, .order-success { grid-template-columns: 1fr; }
  .product-detail-info h1 { font-size: 2.1rem; }
  .pro-banner { padding: 1.5rem; }
  .cookie-banner { padding: 1rem 5%; }
  .footer-grid { gap: 2rem; }
  .btn-primary, .btn-outline { padding: 14px 24px; font-size: 1rem; }
}

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