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

body {
    font-family: 'Arial', sans-serif;
    background-color: white;
    color: #333;
    line-height: 1.6;
}

/* HEADER */
header {
    background-color: #f8f7f7;
    border-bottom: 1px solid #ccc;
}
header .container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}
/* Header fisso senza blur */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Tolto backdrop-filter e reso un semplice background semitrasparente */
    background-color: rgba(248,247,247,0.8);
    border-radius: 0;
    box-shadow: none;
    z-index: 999;
    padding: 0 20px;
}
.site-header.scrolled {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    border-radius: 9999px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
/* LOGO */
.logo img {
    height: 50px;
}

/* NAV PRINCIPALE */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    justify-content: center;
}
.main-nav a {
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
}
.visit-store-cta .btn {
    background-color: #d61116;
    color: #f8f7f7;
}
/* Hamburger mobile */
.hamburger {
    display: none;
}
/* BOTTONI */
.btn,
.btn-primary {
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 9999px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}
.btn {
    background-color: #000;
    color: #f8f7f7;
}
.btn-primary {
    background-color: #d61116;
    color: #f8f7f7;
}
.btn:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
.btn:hover {
    background-color: #333;
}
.btn-primary:hover {
    background-color: #ba1818;
}

/* Titolo della Galleria */
.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-header h1 {
    font-size: 2.5rem;   /* Titolo grande */
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
		margin-top: 50px;

}

.gallery-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    margin-top: 10px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

  /* Box generico in cui mettiamo le foto */
  .gallery-box {
    background-color: #fff;
    border: 1px solid #ddd;
    overflow: hidden;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
	  max-width: 650px;
  }
  /* Righe della gallery */
  .gallery-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2px;
  }
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* FILTRI */
.filters {
    text-align: center; 
    margin: 40px 0 30px; /* Tienilo se vuoi lo spazio, ma non dovrebbe alterare l'allineamento */
  }
  

.filter-buttons {
    display: flex;
    justify-content: center; /* Centra i pulsanti */
    flex-wrap: wrap;
    gap: 15px; /* Spaziatura tra i pulsanti */
    margin: 0 auto; /* Facoltativo per sicurezza */
  }

.filter-btn {
    padding: 12px 24px;
    background-color: #e63946;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #d62828;
    transform: translateY(-3px);
}

/* Modifica per migliorare la disposizione dei box nella griglia */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Cambia a 4 colonne invece di 5 */
    gap: 30px;
    justify-items: center;
    align-items: start;
    justify-content: center;
}

.product-box {
    width: 320px; /* Ingrandisce la larghezza dei box */
    height: 400px; /* Aumenta l'altezza dei box per allineare meglio le immagini */
    text-align: center;
    position: relative;
    cursor: pointer;
    border: 1px solid white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.product-box img {
    width: 100%;              /* Larghezza al 100% per riempire il box */
    height: 100%;             /* Altezza al 100% per uniformare le immagini */
    object-fit: cover;        /* Le immagini si adattano senza distorsioni, riempiendo l'area */
    border-radius: 10px;
}


.product-box h3 {
    margin: 15px 0;
    font-size: 1.2rem;
    color: #333;
}

/* SHOWBOX (MODALE INGRANDIMENTO) - VERSIONE MIGLIORATA */
.showbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.showbox.hidden {
    display: none;
}

.showbox-content {
    background-color: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 0;
}

.showbox-slider {
    position: relative;
    width: 100%;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: 500px;
    height: auto;
    margin: 40px 0 0 0;
    overflow: visible;
}

.showbox-slider img {
    max-width: 80%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1;
}

.showbox-slider img.active {
    display: block;
    opacity: 1;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    z-index: 2;
}

/* Rimuovo tutti gli stili relativi allo zoom */
.showbox-slider img.zoomed,
.showbox-slider img.active:not(.zoomed) {
    cursor: default;
    transform: none;
    transition: none;
}

.showbox-info {
    padding: 30px 40px 40px 40px;
    max-height: none;
    overflow: visible;
    text-align: left;
}

.showbox-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #333;
    font-weight: bold;
}

.showbox-info #showbox-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e63946;
    margin-bottom: 10px;
}

.showbox-info #showbox-brand {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
}

.description-container {
    margin-top: 15px;
}

.description-container h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.description-container p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* PULSANTE DI CHIUSURA */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: none;
}

.close-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    color: #e63946;
}

/* PULSANTI PREV/NEXT NEL MODALE */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

/* INDICATORI (DOTS) PER LO SLIDER */
.dots-container {
    text-align: center;
    padding: 15px 0;
    background: #f8f8f8;
    border-top: 1px solid #eee;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dot:hover {
    background-color: #999;
    transform: scale(1.2);
}

.dot.active {
    background-color: #e63946;
    border-color: #e63946;
    transform: scale(1.2);
}

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .product-grid {
      grid-template-columns: repeat(3, 1fr); /* 3 colonne su tablet medio */
    }
  }

@media (max-width: 768px) {
    .product-box {
        width: 90%;
        height: 350px; /* Puoi anche diminuire leggermente l'altezza su dispositivi più piccoli */
    }

    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .showbox-content {
        max-width: 98vw;
        max-height: 98vh;
        padding: 0;
    }
    
    .showbox-slider {
        min-height: 180px;
        max-height: 250px;
        margin: 20px 0 0 0;
    }
    
    .showbox-slider img {
        max-width: 95%;
        max-height: 180px;
    }
    
    .showbox-info {
        padding: 18px 10px 24px 10px;
    }
    
    .prev, .next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
    
    .close-btn {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colonne su schermi più piccoli */
    }

}

@media (max-width: 480px) {
    .filter-btn {
        width: 100%;
    }

    .product-box {
        width: 100%;
    }

    .showbox-slider {
        min-height: 120px;
        max-height: 160px;
    }
    
    .showbox-slider img {
        max-height: 120px;
    }
    
    .showbox-info {
        padding: 10px 4px 16px 4px;
    }
    
    .prev, .next {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .prev {
        left: 5px;
    }
    
    .next {
        right: 5px;
    }
    
    .dot {
        width: 10px;
        height: 10px;
        margin: 0 3px;
    }

    .product-grid {
        grid-template-columns: 1fr; /* 1 colonna su schermi molto piccoli */
    }

}
