:root {
  --bg-color: #0a0710;
  --card-bg: rgba(22, 16, 36, 0.6);
  --accent-purple: #9d4edd;
  --accent-blue: #00f0ff;
  --accent-pink: #ff007f;
  --text-main: #f3f0ff;
  --text-muted: #a097c0;
  --glow-purple: rgba(157, 78, 221, 0.4);
  --glow-blue: rgba(0, 240, 255, 0.4);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(157, 78, 221, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 240, 255, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
}

/* --- NAVBAR & LOGO --- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 7, 16, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.site-logo {
  height: 40px; /* Dimensione ottimale per la navbar */
  width: auto;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.site-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 10px var(--glow-blue));
}

.logo-text {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: -1px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

nav a:hover {
  color: var(--accent-blue);
  text-shadow: 0 0 10px var(--glow-blue);
}

.cart-btn {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(0, 240, 255, 0.2));
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--glow-blue);
  border-color: var(--accent-blue);
}

/* --- HERO SECTION --- */
.hero {
  min-height: 75vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 1rem;
}

.hero-badge {
  font-family: 'Press Start 2P', cursive;
  font-size: 0.65rem;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px var(--glow-blue);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.hero h1 span {
  background: linear-gradient(90deg, #ff007f, var(--accent-purple), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px var(--glow-purple);
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 0 30px rgba(255, 0, 127, 0.6);
}

/* --- FILTRI CATEGORIE --- */
.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.3s ease;
}

.filter-btn:hover, .filter-btn.active {
  background: rgba(157, 78, 221, 0.2);
  border-color: var(--accent-purple);
  color: var(--text-main);
  box-shadow: 0 0 12px var(--glow-purple);
}

/* --- GRIGLIA PRODOTTI --- */
.products-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  pointer-events: none;
}

.product-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--glow-blue);
}

.product-img-wrapper {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.product-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.product-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

.product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.add-to-cart {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.add-to-cart:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--glow-purple);
  transform: rotate(90deg);
}

/* --- SIDEBAR CARRELLO --- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background-color: #12121a !important; 
  z-index: 9999;
  transition: right 0.3s ease;
  padding: 1.5rem;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.cart-drawer.open {
  right: 0;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-cart {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
}

.cart-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.cart-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background-color: #12121a;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

a:focus-visible, 
button:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--card-bg);
  border: 1px solid var(--accent-purple);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* --- FOOTER --- */
.site-footer {
  background: rgba(8, 5, 14, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-col.brand-col {
  grid-column: span 1;
}

.footer-col p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
  line-height: 1.5;
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-col ul a:hover {
  color: var(--accent-blue);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.2rem;
}

.social-links a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0.8rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.social-links a:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--glow-purple);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.payment-methods span {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-left: 0.4rem;
  font-size: 0.8rem;
}

.product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-link:hover h3 {
  color: var(--accent-blue);
}

/* --- BADGE ULTIMI PEZZI --- */
.badge-low-stock {
  color: #ff3366;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-block;
  margin-top: 0.5rem;
  text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
  animation: pulse-red 2s infinite ease-in-out;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}