/* --- 1. Sfondo e Base --- */
body {
    margin: 0;
    padding: 0;
    background-color: #e8e8e8;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23bcbcbc' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: repeat;
    font-family: sans-serif;
}

/* --- 2. Header e Nav --- */
header { background-color: #1a1a1a; padding: 60px 20px; text-align: center; color: #ffffff; }
header h1 { font-size: 3rem; font-weight: 300; letter-spacing: 6px; margin: 0 0 20px 0; text-transform: uppercase; }

.menu-toggle { display: none; cursor: pointer; font-size: 30px; color: #fff; margin-bottom: 10px; }
nav { display: flex; justify-content: center; gap: 30px; }
nav a, .dropbtn { text-decoration: none; color: #ffffff; text-transform: uppercase; font-size: 0.9rem; cursor: pointer; transition: 0.3s; }
nav a:hover, .dropdown:hover .dropbtn { color: #d4af37; }

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: #262626; min-width: 160px; z-index: 1000; box-shadow: 0px 8px 16px rgba(0,0,0,0.5); }
.dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { color: #ccc; padding: 12px 16px; display: block; text-align: center; border-bottom: 1px solid #333; }
.dropdown-content a:hover { background-color: #333; color: #d4af37; }

/* --- 3. Galleria Home (Solo Home) --- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 20px; max-width: 1200px; margin: 0 auto; }
.artwork { position: relative; width: 100%; padding-top: 100%; overflow: hidden; border-radius: 8px; }
.artwork img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: 0.4s; }
.artwork img:hover { transform: scale(1.05); }

/* --- 4. Schede Prodotto (Matita.html) --- */
.product-card { display: flex; flex-wrap: wrap; background: #fff; padding: 25px; margin: 30px auto; max-width: 900px; border-radius: 8px; gap: 30px; }
.product-image { flex: 0 0 350px; height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; background: #f4f4f4; }
.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: pointer; }
.product-details { flex: 1; min-width: 280px; }
.product-video { margin-top: 15px; width: 100%; aspect-ratio: 16 / 9; }
.product-video iframe { width: 100%; height: 100%; border: none; }

/* --- 5. Modale Zoom --- */
.modal { display: none; position: fixed; z-index: 9999; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); justify-content: center; align-items: center; cursor: pointer; }
.modal img { max-width: 90%; max-height: 90%; border: 4px solid #fff; }
.close-modal { position: absolute; top: 20px; right: 30px; color: #fff; font-size: 40px; cursor: pointer; }

/* --- 6. Mobile Responsivo --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    nav { display: none; flex-direction: column; gap: 15px; }
    nav.active { display: flex; }
    .dropdown { position: static; }
    .dropdown-content { position: static; display: none; width: 100%; }
    #nav-menu.active .dropdown-content { display: block; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
}