@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --secondary: #10b981;
  --dark: #0f172a;
  --gray: #64748b;
  --light: #f1f5f9;
  --white: #ffffff;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  margin: 0; padding: 0;
  color: var(--dark);
  background-color: #f8fafc;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 { margin-top: 0; font-weight: 700; letter-spacing: -0.5px; }
a { text-decoration: none; color: inherit; }
ul, ol { padding-left: 20px; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-alt { padding: 60px 0; background-color: var(--light); }
.section-subtitle { color: var(--gray); max-width: 1000px; margin: 0 auto 30px auto; text-align: center; }


/* --- HEADER / NAVBAR --- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; /* Altezza Header corretta */
  position: relative;
}

/* REGOLA LOGO BLINDATA */
.logo img { 
    height: 35px !important;      /* Altezza forzata */
    max-height: 35px !important;  /* Altezza massima forzata */
    width: auto !important;       /* Larghezza automatica */
    min-height: 0 !important;     /* Evita blocchi minimi */
    
    display: block !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* NAVIGAZIONE PRINCIPALE */
.main-nav { display: flex; align-items: center; gap: 30px; height: 100%; }

.main-nav a {
    text-decoration: none; color: #334155; font-weight: 500; font-size: 0.95rem;
    margin: 0; transition: color 0.2s; position: relative;
}

.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--primary); border-radius: 999px; transition: width 0.2s ease-out;
}

.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.main-nav a:hover::after { width: 100%; }

/* Trigger del Menu Prodotti */
.prodotti-trigger {
    cursor: pointer; padding: 35px 0; display: inline-block; height: 100%; 
    display: flex; align-items: center; color: #334155; font-weight: 500; font-size: 0.95rem;
}
.prodotti-trigger:hover, .prodotti-trigger.active-prodotti { color: var(--primary); }

/* --- SOTTOMENU PRODOTTI (BARRA ORIZZONTALE) --- */
.menu-item-prodotti { position: static; height: 100%; display: flex; align-items: center; }

.horizontal-bar {
    position: absolute; 
    top: 70px; /* Deve coincidere con l'altezza della .nav-bar */
    left: 0; width: 100%;
    background-color: #ffffff; 
    border-top: 1px solid #f1f5f9; border-bottom: 1px solid #cbd5e1;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    z-index: 999;
    
    visibility: hidden; opacity: 0; transform: translateY(-10px);
    transition: all 0.2s ease-out; 
    padding: 5px 0;
}

.horizontal-links {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: center; gap: 40px;
}

/* --- SOTTOMENU PRODOTTI (Versione Finale Pulita) --- */

.horizontal-links a {
    font-size: 0.8rem; 
    color: #475569; font-weight: 600;
    padding: 3px 0; margin: 0; 
    
    text-decoration: none;
    border: none;
    position: relative;
    
    /* AGGIUNGI QUESTA RIGA: */
    border-bottom: none !important; /* Blocca la riga blu del Javascript */
}

/* Rimuove l'animazione ereditata */
.horizontal-links a::after {
    content: none !important;
    display: none !important;
}

.horizontal-links a:hover { 
    color: var(--primary); 
    text-decoration: none;
    border: none;
}

/* Mostra menu al passaggio del mouse */
.menu-item-prodotti:hover .horizontal-bar, 
.horizontal-bar:hover, 
.horizontal-bar.force-visible {
    visibility: visible; opacity: 1; transform: translateY(0);
}


/* Icona Carrello */
.nav-cart {
    display: flex; align-items: center; text-decoration: none; 
    position: relative; font-size: 1.2rem; color: #333;
}
.cart-badge {
    position: absolute; top: -8px; right: -10px; background: #ef4444; color: white;
    font-size: 0.7rem; font-weight: bold; border-radius: 50%; width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
}


/* --- HERO SECTION --- */
.hero {
    position: relative;
    background-image: url('../img/hero-bg.jpg'); 
    background-size: cover; background-position: center; background-repeat: no-repeat;
    padding: 120px 0; color: #ffffff;
}
.hero::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 1;
}
.hero-content { position: relative; z-index: 2; }
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.hero-text { max-width: 800px; }


/* --- ELEMENTI UI GENERICI --- */
.btn {
  display: inline-block; padding: 12px 30px; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer;
  transition: all 0.2s ease-out; box-shadow: 0 4px 6px rgba(15, 23, 42, 0.25);
}
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background-color: transparent; color: white; border: 1px solid rgba(255,255,255,0.8); }
.btn-outline:hover { background-color: rgba(15, 23, 42, 0.7); border-color: white; }
.btn-small { padding: 8px 18px; font-size: 0.85rem; box-shadow: none; }


/* --- NUOVI ELEMENTI HOME PAGE (SLIDER & BOX) --- */

/* Cards Grid (Box Prodotti) */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }
.card-item {
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  text-align: center; background: white; border-radius: var(--radius); padding: 30px 20px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; transition: all 0.2s;
  height: 100%; color: inherit; text-decoration: none;
}
.card-item h3 { margin-top: 0; margin-bottom: 10px; font-size: 1.15rem; color: #333; }
.card-item p { font-size: 0.9rem; color: #666; margin-bottom: 25px; line-height: 1.5; }
.card-item:hover { transform: translateY(-5px); box-shadow: 0 20px 30px -10px rgba(0,0,0,0.15); border-color: #cbd5e1; }

/* Pulsante SCOPRI */
.btn-scopri {
    display: inline-block; border: 2px solid #475569; color: #475569; background: transparent;
    padding: 8px 30px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 400;
    transition: all 0.3s; margin-top: auto;
}
.card-item:hover .btn-scopri { background-color: #475569; color: #ffffff; }

/* Slider Mouse Gallery */
.mouse-gallery-container {
    width: 100%; overflow: hidden; padding: 40px 0; background: #fff; cursor: ew-resize;
}
.mouse-gallery-track {
    display: flex; gap: 20px; width: max-content; transition: transform 0.1s ease-out; padding: 0 20px;
}
.gallery-item {
    width: 350px; height: 250px; border-radius: 12px; overflow: hidden;
    position: relative; box-shadow: 0 10px 20px rgba(0,0,0,0.1); flex-shrink: 0;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.1); }

/* Griglia Tecniche */
.tech-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; }
.tech-card {
    background: white; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; transition: transform 0.2s;
}
.tech-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.tech-img { height: 170px; overflow: hidden; }
.tech-img img { width: 100%; height: 100%; object-fit: cover; }
.tech-info { padding: 15px; text-align: center; }
.tech-info h3 { margin: 0; font-size: 1rem; color: #333; }
.tech-info p { font-size: 0.85rem; color: #666; margin-top: 5px; }

/* Responsive: 3 col tablet, 2 col mobile, 1 col piccolo */
@media (max-width: 1024px) { .tech-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .tech-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .tech-grid { grid-template-columns: 1fr; } }


/* --- PAGINA NASTRI (LISTINI) --- */
.nastro-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column;
}
.nastro-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.price-box {
    background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0;
    padding: 5px; text-align: center; border-radius: 4px; font-weight: bold; font-size: 1.2em; margin-bottom: 10px;
}
.btn-add-cart {
    background-color: #2563eb; color: white; border: none; padding: 6px 10px;
    border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.9em;
    transition: background 0.2s; height: 32px; width: 100%;
}
.btn-add-cart:hover { background-color: #1d4ed8; }


/* --- CONFIGURATORE --- */
.configuratore-container {
  max-width: 1200px; margin: 0 auto 40px auto; padding: 0 20px 40px 20px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr); gap: 32px; align-items: flex-start;
}
.anteprima {
  background: linear-gradient(145deg, #f9fafb, #e5e7eb); border-radius: 22px; padding: 20px 22px 24px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.14); position: sticky; top: 100px; border: 1px solid #d1d5db; color: #111827;
}
.anteprima-image-wrapper {
  position: relative; overflow: hidden; border-radius: 16px; background: transparent; 
  margin-bottom: 14px; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
}
.anteprima img#modello-img { width: 100%; height: 100%; object-fit: contain; background: transparent; }
.anteprima-dati { background-color: #f3f4f6; border-radius: 14px; padding: 10px 12px; margin: 8px 0 10px 0; border: 1px solid #e5e7eb; font-size: 0.88rem; }
.form-configuratore { background-color: white; border-radius: 18px; padding: 22px 24px 26px; box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08); }
.campo-form { display: flex; flex-direction: column; margin-bottom: 12px; }
.campo-form label { font-size: 0.9rem; font-weight: 500; color: var(--gray); margin-bottom: 4px; }
.campo-form input, .campo-form select, .campo-form textarea {
  border-radius: 6px; border: 1px solid #cbd5e1; padding: 8px 10px; font-size: 0.9rem; background-color: #ffffff;
}
#risultato-prezzo { margin-top: 2em; background: #eff6ff; padding: 20px; border-radius: 8px; }


/* --- PAGINA DTF --- */
.product-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; background: #fff; padding: 30px; border-radius: 8px; border: 1px solid #e2e8f0; }
.product-image { border-radius: 8px; overflow: hidden; border: 1px solid #f1f5f9; }
.btn-mega-configura { 
    display: block; width: 100%; background-color: #2563eb; color: #fff; text-align: center; 
    padding: 18px; font-size: 1.3rem; font-weight: bold; text-transform: uppercase; border: none; 
    border-radius: 6px; cursor: pointer; transition: background 0.3s; 
}
.btn-mega-configura:hover { background-color: #1d4ed8; }


/* --- ZOOM MODALE --- */
.modal-zoom {
  display: none; position: fixed; z-index: 2000; padding-top: 50px; 
  left: 0; top: 0; width: 100%; height: 100%; overflow: auto; 
  background-color: rgba(0,0,0,0.85); backdrop-filter: blur(5px);
  align-items: center; justify-content: center; flex-direction: column;
}
.modal-content {
  margin: auto; display: block; max-width: 90%; max-height: 85vh;
  border-radius: 4px; box-shadow: 0 0 20px rgba(255,255,255,0.1); animation: zoomIn 0.3s;
}
.close-zoom { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; }
@keyframes zoomIn { from {transform:scale(0.8); opacity:0} to {transform:scale(1); opacity:1} }


/* --- FOOTER --- */
.site-footer {
    background: #1e293b; color: #cbd5e1; padding: 40px 0 20px; margin-top: 50px; font-size: 0.9rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { color: #fff; margin-top: 0; margin-bottom: 15px; font-size: 1.1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #cbd5e1; text-decoration: none; transition: color 0.3s; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 20px; text-align: center; font-size: 0.85rem; color: #94a3b8; }


/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-content { flex-direction: column; }
  .main-nav { display: none; } 
  .configuratore-container { grid-template-columns: 1fr; }
  .anteprima { position: static; margin-bottom: 20px; }
  .product-wrapper { grid-template-columns: 1fr; }
}