/* RESET E FIX OVERFLOW GLOBALE */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f8f8f8;
    color: #333;
}

/* ===== HEADER & BARRA FILTRI ===== */
.page-title-section {
    text-align: center;
    padding: 30px 15px 20px 15px;
    background: #ffffff;
    color: #0c0c0c;
    width: 100%;
    max-width: 100%;
}

.page-title-section h1 {
    margin-bottom: 10px;
    font-size: 1.8rem;
    word-wrap: break-word;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Stili Barra Filtri */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
}

.filter-btn {
    background-color: #f0f0f0;
    color: #003366;
    border: 2px solid #003366;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 100%;
    white-space: normal;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #003366;
    color: #ffffff;
}

/* ===== STRUTTURA VETRINA ===== */
.categoria-section {
    max-width: 1300px;
    margin: 20px auto 40px auto;
    padding: 0 15px;
    width: 100%;
}

.vetrina {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.product-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
}

.product-card.hide {
    display: none !important;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card h2 {
    margin-bottom: 12px;
    font-size: 1.2rem;
    word-break: break-word;
}

.product-card .note {
    word-break: break-word;
    font-size: 0.9rem;
}

/* ===== CAROUSEL ===== */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
    height: 240px;
    background-color: #f0f0f0;
    width: 100%;
    max-width: 100%;
}

.carousel-track {
    display: flex !important;
    height: 100% !important;
    transition: transform 0.4s ease-in-out;
    width: 100%;
}

.carousel-track .slide {
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px;
    overflow: hidden;
}

.carousel-track img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: auto !important;
    image-orientation: from-image;
    cursor: zoom-in;
}

.carousel-track img.rotate-90 {
    transform: rotate(90deg);
    max-width: 200px !important;
}

.carousel-track img.rotate-270 {
    transform: rotate(270deg);
    max-width: 200px !important;
}

/* Pulsanti Carousel */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    user-select: none;
    transition: background 0.3s ease;
}

.prev:hover, .next:hover {
    background: rgba(0,0,0,0.8);
}

.prev { left: 8px; }
.next { right: 8px; }

/* ===== MODALE ZOOM IMMAGINE (INTERATTIVA) ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.image-modal[style*="block"] {
    display: flex !important;
}

.image-modal .modal-content {
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
    margin: auto;
    cursor: grab;
    user-select: none;
    transition: transform 0.05s ease-out;
    transform-origin: center center;
}

.image-modal .modal-content:active {
    cursor: grabbing;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: 0.3s;
}

.modal-close:hover {
    color: #bbb;
}

/* ===== FRECCE NAVIGAZIONE MODALE ===== */
.modal-prev, .modal-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 28px;
    padding: 12px 18px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    user-select: none;
    transition: background 0.3s ease;
}

.modal-prev:hover, .modal-next:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

.modal-prev.hidden, .modal-next.hidden {
    display: none !important;
}