/* VERSIONE: 2024-10-01-19:30 - RICERCA DESKTOP + CONTROLLI AFFIANCATI */

/* Reset e container principale */
.products-page {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    grid-template-rows: auto !important;
    gap: 2rem !important;
    padding: 2rem 5% !important;
    margin-top: 80px !important;
    min-height: calc(100vh - 80px) !important;
    background-color: #f5f5f5 !important;
    position: relative !important;
}

/* Nascondi i controlli mobile su desktop */
.top-actions-bar,
.mobile-search-modal {
    display: none !important;
}

/* Assicurati che i filtri siano visibili su desktop */
.filters-section {
    display: block !important;
    opacity: 1 !important;
    max-height: none !important;
}

/* Sezione Filtri */
.filters-section {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08) !important;
    padding: 2rem !important;
    height: fit-content !important;
    position: sticky !important;
    top: 100px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

/* Personalizzazione scrollbar per la sezione filtri */
.filters-section::-webkit-scrollbar {
    width: 4px !important;
    background-color: transparent !important;
}

.filters-section::-webkit-scrollbar-thumb {
    background-color: #333333 !important;
    border-radius: 4px !important;
}

.filters-section::-webkit-scrollbar-track {
    background-color: transparent !important;
}

/* Per Firefox */
.filters-section {
    scrollbar-width: thin !important;
    scrollbar-color: #333333 transparent !important;
}

/* Animazioni per mobile */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-group {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 1.5rem;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group h3 {
    color: #333;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
}

.filter-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

/* Range Prezzo */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.price-input {
    position: relative;
    flex: 1;
}

.price-input span {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.price-input input {
    width: 100%;
    padding: 0.8rem 0.8rem 0.8rem 25px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Griglia Prodotti */
#productsContainer {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 2rem !important;
    padding: 1rem !important;
}

.product-card {
    position: relative !important;
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.product-item {
    position: relative;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(196, 166, 97, 0.15);
}

.product-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f9f9f9;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-item:hover .product-image img {
    transform: scale(1.05);
}

/* Rimuovo tutte le regole hover che potrebbero interferire */
.product-card:hover .product-image,
.product-card:hover .product-image img,
.product-image:hover img,
.product-item:hover img,
.product-item img:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: block !important;
}

/* Assicuro che le immagini siano sempre visibili anche nei prodotti in evidenza */
.product-item.featured img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transform: none !important;
}

.product-card .quick-view-btn,
.product-card .add-to-cart-btn,
.product-card .product-price,
.product-card .product-title {
    transition: none !important;
}

.product-card:hover .quick-view-btn,
.product-card:hover .add-to-cart-btn,
.product-card:hover .product-price,
.product-card:hover .product-title {
    transform: none !important;
    opacity: 1 !important;
}

.product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

.product-badges i {
    background: rgba(255,255,255,0.9);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #c4a661;
    font-size: 1rem;
}

.product-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
    border-top: 1px solid #f0f0f0;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.4;
    font-family: 'Merriweather', serif;
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.product-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.8rem;
}

.category, .material, .color, .gender {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #666;
}

.category i, .material i, .color i, .gender i {
    color: #c4a661;
    font-size: 0.9rem;
}

.price-stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.8rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: #c4a661;
    font-family: 'Merriweather', serif;
}

.stock-indicator {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.stock-indicator.in-stock {
    background-color: #f1f8f1;
    color: #2e7d32;
}

.stock-indicator.low-stock {
    background-color: #fff8e1;
    color: #f57c00;
}

.stock-indicator i {
    font-size: 0.8rem;
}

/* Stati di Loading e No Products */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    grid-column: 1 / -1;
}

.loading i {
    margin-right: 0.5rem;
    color: #c4a661;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
    grid-column: 1 / -1;
}

.no-products i {
    font-size: 3rem;
    color: #c4a661;
    margin-bottom: 1rem;
}

.no-products h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

/* Regola specifica per desktop */
@media (min-width: 769px) {
    .description-section p {
        white-space: pre-line !important;
        word-wrap: break-word !important;
    }
}

/* Media Queries */
@media (max-width: 1024px) {
    .products-page {
        grid-template-columns: 1fr !important;
    }

    .filters-section {
        position: static !important;
        margin-bottom: 2rem !important;
    }
}

/* ===== SISTEMA SCONTI PRODOTTI ===== */

/* Badge "IN SCONTO" */
.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    z-index: 3;
    letter-spacing: 0.5px;
}

/* Container prezzi */
.product-price-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Prezzo originale barrato */
.product-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 0.9rem;
    font-weight: normal;
}

/* Prezzo scontato */
.product-current-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Badge percentuale sconto */
.product-discount-badge {
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

/* Stili per i dettagli prodotto nel modal */
.detail-price-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.detail-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 1.1rem;
    font-weight: normal;
}

.detail-current-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.4rem;
}

.detail-discount-badge {
    background: #e74c3c;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    white-space: nowrap;
}

/* ===== BARRA AZIONI SUPERIORE MOBILE ===== */
.top-actions-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-toggle-btn {
    background: linear-gradient(135deg, #b8860b, #daa520);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-toggle-btn:hover {
    background: linear-gradient(135deg, #daa520, #ffd700);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.filter-toggle-btn {
    flex: 1;
    background: linear-gradient(135deg, #333333, #555555);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ===== MODAL RICERCA MOBILE ===== */
.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
    animation: fadeIn 0.3s ease;
}

.mobile-search-modal.active {
    display: flex;
}

.mobile-search-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 600px;
    padding: 1.5rem;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.2);
    animation: slideUpModal 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpModal {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.mobile-search-header h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-search-header h3 i {
    color: #b8860b;
}

.close-search-btn {
    background: #f5f5f5;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-search-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.close-search-btn i {
    color: #666;
    font-size: 16px;
}

/* ===== RICERCA DESKTOP ===== */
.desktop-search-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.search-container-desktop {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-container-desktop .fa-search {
    position: absolute;
    left: 15px;
    color: #b8860b;
    font-size: 16px;
    z-index: 1;
}

.search-input-desktop {
    width: 100%;
    padding: 14px 50px 14px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.search-input-desktop:focus {
    outline: none;
    border-color: #b8860b;
    background: white;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.search-input-desktop::placeholder {
    color: #999;
}

.search-clear-desktop {
    position: absolute;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-clear-desktop:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.search-clear-desktop i {
    color: #666;
    font-size: 12px;
}

/* ===== BARRA CONTROLLI (PRODOTTI + ORDINA PER) ===== */
.controls-bar {
    background: white;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 250px;
}

.control-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
}

.product-type-select,
.sort-select {
    flex: 1;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.product-type-select:hover,
.sort-select:hover {
    border-color: #b8860b;
}

.product-type-select:focus,
.sort-select:focus {
    outline: none;
    border-color: #b8860b;
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

/* REGOLE DESKTOP - Garantisce che tutto funzioni correttamente sopra 769px */
@media (min-width: 769px) {
    .top-actions-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        pointer-events: none !important;
    }
    
    .mobile-search-modal {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        pointer-events: none !important;
    }
    
    .filters-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        max-height: 80vh !important;
    }
    
    .products-page {
        display: grid !important;
        grid-template-columns: 280px 1fr !important;
    }
}

@media (max-width: 768px) {
    .products-page {
        padding: 1rem !important;
    }
    
    /* Nascondi ricerca desktop */
    .desktop-search-bar {
        display: none !important;
    }
    
    /* Mostra barra azioni mobile */
    .top-actions-bar {
        display: flex !important;
    }
    
    /* Mostra modal ricerca quando attivo */
    .mobile-search-modal {
        display: none;
    }
    
    .mobile-search-modal.active {
        display: flex !important;
    }
    
    /* Adatta la barra controlli per mobile */
    .controls-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .control-group {
        width: 100%;
        min-width: auto;
    }
    
    .filter-toggle-btn:hover {
        background: linear-gradient(135deg, #555555, #777777) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
    }
    
    .filter-toggle-btn:active {
        transform: translateY(0) !important;
    }
    
    .filter-toggle-btn .fas {
        font-size: 16px !important;
    }
    
    .filter-arrow {
        transition: transform 0.3s ease !important;
    }
    
    .filter-arrow.rotated {
        transform: rotate(180deg) !important;
    }
    
    /* Nasconde i filtri di default su mobile */
    .filters-section {
        display: none !important;
        opacity: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: all 0.4s ease !important;
        margin-bottom: 0 !important;
    }
    
    /* Mostra i filtri quando attivi */
    .filters-section.show {
        display: block !important;
        opacity: 1 !important;
        max-height: 70vh !important; /* Limita l'altezza per permettere lo scroll */
        margin-bottom: 2rem !important;
        overflow-y: auto !important; /* Abilita lo scroll verticale */
        overflow-x: hidden !important; /* Nasconde lo scroll orizzontale */
    }
    
        /* Aggiusta il layout dei filtri per mobile */
    .filters-section.show {
        position: static !important;
        background: linear-gradient(145deg, #ffffff, #f8f9fa) !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
        padding: 1.5rem !important;
        animation: slideDown 0.4s ease !important;
        border: 1px solid rgba(0,0,0,0.05) !important;
        
        /* Stile scrollbar per mobile */
        scrollbar-width: thin !important;
        scrollbar-color: rgba(51, 51, 51, 0.6) transparent !important;
    }
    
    /* Scrollbar WebKit per mobile (iOS/Safari/Chrome) */
    .filters-section.show::-webkit-scrollbar {
        width: 6px !important;
        background-color: transparent !important;
    }
    
    .filters-section.show::-webkit-scrollbar-thumb {
        background-color: rgba(51, 51, 51, 0.6) !important;
        border-radius: 3px !important;
        border: 1px solid transparent !important;
        background-clip: content-box !important;
    }
    
    .filters-section.show::-webkit-scrollbar-thumb:hover {
        background-color: rgba(51, 51, 51, 0.8) !important;
    }
    
    .filters-section.show::-webkit-scrollbar-track {
        background-color: transparent !important;
    }
    
    /* Fade indicator per suggerire lo scroll */
    .filters-section.show::after {
        content: "";
        position: sticky !important;
        bottom: 0 !important;
        display: block !important;
        height: 20px !important;
        background: linear-gradient(transparent, rgba(248, 249, 250, 0.9)) !important;
        pointer-events: none !important;
        margin: 0 -1.5rem -1.5rem -1.5rem !important;
        border-radius: 0 0 12px 12px !important;
    }
    
    /* Migliora la visualizzazione dei gruppi di filtri su mobile */
    .filters-section.show .filter-group {
        margin-bottom: 1.5rem !important;
        padding-bottom: 1rem !important;
    }
    
    .filters-section.show .filter-group h3 {
        color: #333333 !important;
        font-size: 16px !important;
        margin-bottom: 12px !important;
        position: sticky !important;
        top: 0 !important;
        background: linear-gradient(145deg, #ffffff, #f8f9fa) !important;
        padding: 8px 0 !important;
        z-index: 1 !important;
    }

    #productsContainer {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 1rem !important;
        padding: 0 !important;
    }

    /* Ottimizzazione immagini prodotti per mobile */
    .product-image {
        height: 220px !important; /* Aumentato per maggiore visibilità */
    }

    .product-image img {
        object-fit: contain !important; /* Migliore visualizzazione dei gioielli */
    }
    
    /* Nascondi frecce su mobile - usa tap sull'immagine */
    .nav-btn {
        display: none !important; /* Nasconde completamente le frecce su mobile */
    }
    
    /* Indicatore tap per immagini multiple su mobile */
    .product-image[data-images] {
        position: relative;
        transition: transform 0.1s ease;
    }
    
    /* Feedback visivo al tap */
    .product-image[data-images]:active {
        transform: scale(0.98);
    }
    
    .product-image[data-images]::after {
        content: "👆 Tap";
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.6);
        color: white;
        padding: 2px 6px;
        border-radius: 8px;
        font-size: 0.6rem;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
        z-index: 3;
    }
    
    .product-image[data-images]:hover::after {
        opacity: 1;
    }
    
    /* Migliora i puntini di navigazione su mobile */
    .image-navigation {
        margin-top: 8px !important;
    }
    
    .nav-dot {
        width: 10px !important;
        height: 10px !important;
        margin: 0 6px !important;
        cursor: pointer !important;
        opacity: 0.7 !important;
    }
    
    .nav-dot.active {
        opacity: 1 !important;
        transform: scale(1.2) !important;
    }

    .product-info {
        padding: 12px !important; /* Ridotto per più spazio immagine */
    }

    .product-info h3 {
        font-size: 15px !important; /* Leggibile ma compatto */
        margin-bottom: 6px !important;
    }

    .product-category {
        font-size: 11px !important; /* Più compatto */
        margin-bottom: 6px !important;
    }

    .product-card {
        min-height: auto !important;
    }
    
    /* Ottimizzazione pulsanti per mobile */
    .product-actions {
        gap: 8px !important; /* Gap mobile ottimizzato */
        margin-top: 8px !important;
    }
    
    /* Ottimizzazione spacing generale */
    .product-details {
        margin: 4px 0 !important;
    }
    
    .stock-indicator {
        font-size: 0.75rem !important;
        padding: 3px 8px !important;
    }
    
    .details-btn {
        padding: 10px 12px !important; /* Padding mobile ottimizzato */
        font-size: 0.85rem !important;
        gap: 6px !important;
    }
    
    .add-to-cart {
        padding: 12px !important; /* Padding mobile ottimizzato */
        font-size: 0.9rem !important;
    }
    
    .price-stock-row {
        margin: 6px 0 !important; /* Ridotto spacing */
    }
    
    .product-price {
        font-size: 1.1rem !important; /* Più compatto */
    }
}

/* Nascondi hint tap solo su desktop */
@media (min-width: 769px) {
    .product-image[data-images]::after {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .product-card {
        width: 100% !important;
    }

    /* Per schermi molto piccoli, mantengo immagini visibili */
    .product-image {
        height: 200px !important; /* Mantengo dimensioni decenti */
    }

    .product-info {
        padding: 10px !important; /* Più compatto */
    }

    .product-info h3 {
        font-size: 14px !important;
        line-height: 1.3;
    }

    #productsContainer {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 0.8rem !important;
    }
    
    /* Pulsanti ottimizzati per schermi molto piccoli */
    .product-actions {
        gap: 6px !important; /* Gap ridotto per compattezza */
    }
    
    .details-btn {
        padding: 8px 10px !important; /* Padding ridotto */
        font-size: 0.8rem !important;
    }
    
    .add-to-cart {
        padding: 10px !important; /* Padding ridotto */
        font-size: 0.85rem !important;
    }
    
    .product-price {
        font-size: 1rem !important;
    }
}

/* Stili Logo */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5%;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 80px;
    overflow: visible;
}

.logo {
    position: relative;
    flex: 0 0 auto;
    margin-right: 2rem;
    z-index: 1001;
}

.logo a {
    display: block;
    text-decoration: none;
}

.logo-img {
    height: 100px;
    width: auto;
    object-fit: contain;
    position: absolute;
    top: -52px;
    z-index: 1002;
    pointer-events: none;
}

.logo-text {
    display: none;
}

/* Per dispositivi mobili */
@media (max-width: 768px) {
    .main-nav {
        height: 60px;
    }

    .logo-img {
        height: 100px;
        top: -52px;
    }
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.product-category {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

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

.stock-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.add-to-cart-btn i {
    font-size: 18px;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
}

.no-products i {
    font-size: 48px;
    color: #666;
    margin-bottom: 15px;
}

.no-products p {
    font-size: 18px;
    color: #666;
}

/* Stili per il carrello */
.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #c4a661;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.product-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.product-badges i {
    background: rgba(255, 255, 255, 0.9);
    color: var(--secondary-color);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.product-badges i:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
    color: white;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.product-category {
    font-size: 0.9rem;
    color: var(--secondary-color);
    background: rgba(196, 166, 97, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

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

.product-material {
    font-size: 0.9rem;
    color: #666;
    text-transform: capitalize;
}

/* Aggiungo un wrapper per il contenuto */
.product-content-wrapper {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Assicuriamoci che non ci siano margini o padding extra nei contenitori interni */
.product-header,
.product-details,
.product-description {
    margin-bottom: 0.15rem !important;
    padding: 0 !important;
}

.product-details {
    margin-bottom: 0.15rem !important;
}

.add-to-cart {
    width: 100%;
    padding: 0.8rem;
    background: white;
    color: #c4a661;
    border: 1px solid #c4a661;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.add-to-cart:hover {
    background: #c4a661;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 166, 97, 0.2);
}

.add-to-cart i {
    font-size: 0.9rem;
}

.stock-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-warning::before {
    content: "⚠️";
}

/* Navigation buttons - Frecce meno marcate */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.6); /* Più trasparente */
    border: none;
    border-radius: 50%;
    width: 30px; /* Più piccole */
    height: 30px; /* Più piccole */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    opacity: 0;
    color: rgba(196, 166, 97, 0.7); /* Colore più tenue */
    font-size: 0.75rem; /* Font più piccolo */
    box-shadow: 0 1px 4px rgba(0,0,0,0.05); /* Ombra più leggera */
}

.product-item:hover .nav-btn {
    opacity: 0.7; /* Meno visibili anche al hover */
}

.nav-btn:hover {
    background: rgba(196, 166, 97, 0.8); /* Meno marcato */
    color: white;
    transform: translateY(-50%) scale(1.05); /* Scaling ridotto */
    opacity: 0.9; /* Anche hover meno marcato */
}

.nav-btn.prev {
    left: 10px;
}

.nav-btn.next {
    right: 10px;
}

/* Navigation dots */
.image-navigation {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(196, 166, 97, 0.3);
}

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


.featured-badge::before {
    content: "IN EVIDENZA";
    position: absolute;
    top: 25px;
    right: -25px;
    background: #c4a661;
    color: white;
    text-align: center;
    transform: rotate(45deg);
    width: 150px;
    padding: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Stili per i pulsanti azioni prodotto - Layout verticale universale */
.product-actions {
    display: flex;
    flex-direction: column; /* Verticale anche su desktop */
    gap: 10px;
    margin-top: 12px;
}

.details-btn {
    flex: none; /* Rimuovi flex per layout verticale */
    width: 100%; /* Larghezza completa */
    background: linear-gradient(135deg, #666666, #888888);
    color: white;
    border: none;
    padding: 12px 16px; /* Più spazio essendo verticali */
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.details-btn:hover {
    background: linear-gradient(135deg, #555555, #777777);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.add-to-cart {
    flex: none; /* Rimuovi flex per layout verticale */
    width: 100%; /* Larghezza completa */
    padding: 14px 16px; /* Più prominente per il carrello */
    font-size: 1rem; /* Leggermente più grande */
}

/* Modal Dettagli Prodotto */
.product-details-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.product-details-modal .modal-content {
    background-color: #ffffff;
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del modal */
.product-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.product-details-header h2 {
    color: #333;
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.close-details-modal {
    background: #ff4444;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-details-modal:hover {
    background: #cc0000;
    transform: scale(1.1);
}

/* Contenuto principale del modal */
.product-details-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 30px;
}

/* Sezione immagini con scroll verticale */
.product-details-images {
    height: 100%;
}

.images-scroll-container {
    height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    padding: 15px;
    gap: 20px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    
    /* Scrollbar personalizzata */
    scrollbar-width: thin;
    scrollbar-color: rgba(51, 51, 51, 0.6) transparent;
}

.images-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.images-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.images-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(51, 51, 51, 0.6);
    border-radius: 4px;
}

.images-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(51, 51, 51, 0.8);
}

.detail-image-item {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.detail-image-item img {
    width: 100%;
    height: auto;
    min-height: 300px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.detail-image-item:hover img {
    transform: scale(1.02);
}

.image-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* Sezione informazioni prodotto */
.product-details-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
}

.detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.stock-info {
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stock-info.in-stock {
    background: #d4edda;
    color: #155724;
}

.stock-info.low-stock {
    background: #f8d7da;
    color: #721c24;
}

/* Griglia dettagli */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.detail-item span {
    font-weight: 500;
    color: #333;
    font-size: 1rem;
}

/* Sezione descrizione */
.description-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.description-section h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.description-section p {
    color: #666;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line !important;
}

/* Azioni del modal */
.detail-actions {
    margin-top: 10px;
}

.add-to-cart-detail {
    width: 100%;
    background: linear-gradient(135deg, #333333, #555555);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-to-cart-detail:hover {
    background: linear-gradient(135deg, #555555, #777777);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .product-details-modal .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .product-details-content {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 20px;
    }
    
    .product-details-header {
        padding: 15px 20px;
    }
    
    .product-details-header h2 {
        font-size: 1.4rem;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .images-scroll-container {
        height: 50vh !important; /* Altezza relativa al viewport per mobile */
        max-height: 400px !important;
        min-height: 300px !important;
        padding: 10px !important;
        gap: 15px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        
        /* Ottimizzazioni per touch scroll */
        -webkit-overflow-scrolling: touch !important; /* iOS smooth scrolling */
        scroll-behavior: smooth !important;
        overscroll-behavior-y: contain !important; /* Previene bounce eccessivo */
        
        /* Miglioramenti visual scroll */
        border-radius: 8px !important;
        background: #f8f9fa !important;
        
        /* Touch friendly scrollbar */
        scrollbar-width: thin !important;
        scrollbar-color: rgba(196, 166, 97, 0.6) transparent !important;
    }
    
    /* Scrollbar personalizzata per mobile */
    .images-scroll-container::-webkit-scrollbar {
        width: 6px !important; /* Più sottile su mobile */
    }
    
    .images-scroll-container::-webkit-scrollbar-track {
        background: transparent !important;
        border-radius: 3px !important;
    }
    
    .images-scroll-container::-webkit-scrollbar-thumb {
        background: rgba(196, 166, 97, 0.6) !important; /* Colore brand */
        border-radius: 3px !important;
        border: 1px solid rgba(255,255,255,0.2) !important;
    }
    
    .images-scroll-container::-webkit-scrollbar-thumb:hover,
    .images-scroll-container::-webkit-scrollbar-thumb:active {
        background: rgba(196, 166, 97, 0.8) !important;
    }
    
    .detail-image-item {
        min-height: 220px !important; /* Ridotto per mobile */
        max-height: 300px !important;
        margin-bottom: 10px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
        background: #fff !important;
        padding: 8px !important;
    }
    
    .detail-image-item img {
        min-height: 200px !important; /* Adeguato per mobile */
        max-height: 280px !important;
        width: 100% !important;
        object-fit: contain !important;
        border-radius: 4px !important;
    }
    
    .price-section {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* Ottimizzazioni aggiuntive per scroll smooth */
    .product-details-images {
        height: auto !important;
        max-height: 60vh !important;
        position: relative !important;
    }
    
        /* Indicatore scroll per utenti - SOLO CON MULTIPLE IMMAGINI */
    .images-scroll-container.multiple-images::before {
        content: "📸 Scorri per vedere tutte le foto" !important;
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(248, 249, 250, 0.9) !important;
        padding: 8px 12px !important;
        text-align: center !important;
        font-size: 0.8rem !important;
        color: #666 !important;
        border-radius: 4px 4px 0 0 !important;
        backdrop-filter: blur(5px) !important;
        z-index: 2 !important;
        margin-bottom: 10px !important;
    }
    
    /* Nasconde l'hint se c'è solo una foto */
    .images-scroll-container:not(.multiple-images)::before {
        display: none !important;
        content: none !important;
    }
}

/* Impedisce lo scroll del body quando il modal è aperto */
body.modal-open {
    overflow: hidden;
}

/* Ottimizzazioni aggiuntive per dispositivi piccoli */
@media (max-width: 480px) {
    .images-scroll-container {
        height: 40vh !important; /* Ancora più piccolo su schermi piccoli */
        max-height: 320px !important;
        padding: 8px !important;
        gap: 10px !important;
    }
    
    .detail-image-item {
        min-height: 180px !important;
        padding: 6px !important;
    }
    
    .detail-image-item img {
        min-height: 160px !important;
        max-height: 200px !important;
    }
    
    /* Scrollbar ancora più sottile su schermi piccoli */
    .images-scroll-container::-webkit-scrollbar {
        width: 4px !important;
    }
    
    /* Hint più piccolo - SOLO CON MULTIPLE IMMAGINI */
    .images-scroll-container.multiple-images::before {
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
    }
}

/* ===== SEZIONE SOTTOCATEGORIE PICCOLE ===== */

/* Stili per la barra sottocategorie */
.subcategories-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.subcategories-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subcategories-left label {
    font-weight: 600;
    color: var(--primary-color, #333);
    font-size: 0.9rem;
}

.subcategory-tabs-small {
    display: flex;
    gap: 0.5rem;
}

.subcategory-tab-small {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color, #333);
}

.subcategory-tab-small:hover {
    border-color: var(--secondary-color, #c4a661);
    background-color: #f9f9f9;
}

.subcategory-tab-small.active {
    background-color: var(--secondary-color, #c4a661);
    border-color: var(--secondary-color, #c4a661);
    color: white;
}

/* ===== SEZIONE ORDINAMENTO E TOGGLE VISTA ===== */

/* Stili per la sezione ordinamento */
.sort-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sort-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sort-left label {
    font-weight: 600;
    color: var(--primary-color, #333);
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--secondary-color, #c4a661);
}

/* Toggle Vista - Nascosto su desktop */
.view-toggle-mobile {
    display: none;
}

/* ===== STILI MOBILE ===== */
@media (max-width: 768px) {
    /* Sottocategorie mobile */
    .subcategories-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        margin: 1rem 0.5rem;
    }
    
    .subcategories-left {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .subcategories-left label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .subcategory-tabs-small {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .subcategory-tab-small {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
        min-width: 80px;
        text-align: center;
        border-radius: 20px;
    }
    
    .sort-section {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding: 1rem 0.5rem;
    }
    
    .sort-left {
        width: 100%;
        justify-content: center;
    }
    
    /* Mostra toggle vista solo su mobile */
    .view-toggle-mobile {
        display: flex !important;
        gap: 0;
        background-color: #f0f0f0;
        border-radius: 8px;
        padding: 4px;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .view-toggle-btn {
        padding: 8px 12px;
        border: none;
        background-color: transparent;
        color: #666;
        cursor: pointer;
        border-radius: 6px;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        min-width: 44px;
        height: 36px;
    }
    
    .view-toggle-btn.active {
        background-color: #fff;
        color: var(--secondary-color, #c4a661);
        box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        font-weight: 600;
    }
    
    .view-toggle-btn:hover:not(.active) {
        color: #333;
        background-color: rgba(255,255,255,0.5);
    }
}

/* ===== VISTA LISTA (SOLO MOBILE) ===== */
@media (max-width: 768px) {
    /* FORZA COMPLETAMENTE il layout a lista - sovrascrive TUTTO */
    .products-grid.list-view {
        display: flex !important; /* Cambia da grid a flex */
        flex-direction: column !important; /* Colonna verticale FORZATA */
        gap: 0.75rem !important;
        grid-template-columns: none !important; /* Disabilita grid */
        grid-template-rows: none !important; /* Disabilita grid rows */
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.5rem !important; /* Padding minimo */
        margin: 0 !important;
        align-items: stretch !important; /* Tutti gli elementi alla stessa larghezza */
        justify-content: flex-start !important;
        flex-wrap: nowrap !important; /* NO wrap - solo colonna */
        overflow-x: hidden !important; /* NO scroll orizzontale */
        box-sizing: border-box !important;
    }
    
    /* Layout orizzontale per ogni prodotto - uno sotto l'altro */
    .products-grid.list-view .product-item {
        display: flex !important;
        flex-direction: row !important; /* Immagine a sinistra, info a destra */
        background-color: #fff !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        overflow: hidden !important;
        min-height: 130px !important; /* Più spazio per tutte le info */
        height: auto !important;
        width: 100% !important; /* Occupa tutta la larghezza */
        max-width: 100% !important; /* Forza larghezza massima */
        margin: 0 !important; /* NO margini */
        padding: 0 !important;
        position: relative !important;
        flex-shrink: 0 !important; /* Non si restringe */
        flex-grow: 0 !important; /* Non cresce */
        flex-basis: auto !important; /* Base automatica */
        box-sizing: border-box !important;
        overflow: hidden !important; /* NO overflow */
        contain: layout !important; /* Contiene il layout */
    }
    
    /* ===== MASSIMA PRIORITÀ - FORZA LISTA MOBILE ===== */
    div.products-grid.list-view,
    .products-grid.list-view,
    #productsContainer.list-view {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        grid-auto-columns: none !important;
        grid-template-rows: none !important;
        grid-auto-rows: none !important;
        column-count: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.5rem !important;
        margin: 0 !important;
        gap: 0.75rem !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
    
    div.products-grid.list-view .product-item,
    .products-grid.list-view .product-item,
    #productsContainer.list-view .product-item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        grid-column: none !important;
        grid-row: none !important;
        float: none !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: row !important;
    }

    
    /* Container immagine a sinistra */
    .products-grid.list-view .product-image-container {
        flex-shrink: 0 !important;
        width: 110px !important;
        height: 130px !important; /* Stessa altezza del container */
        position: relative !important;
        overflow: hidden !important;
        align-self: flex-start !important; /* Allinea in alto */
    }
    
    /* Immagine prodotto */
    .products-grid.list-view .product-image {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
    }
    
    .products-grid.list-view .product-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 0 !important;
    }
    
    /* Info prodotto a destra - NO OVERFLOW */
    .products-grid.list-view .product-info {
        flex: 1 !important;
        padding: 0.75rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* Allinea in alto */
        height: 100% !important;
        box-sizing: border-box !important;
        min-width: 0 !important; /* Evita overflow */
        max-width: calc(100% - 110px) !important; /* Non supera spazio disponibile */
        overflow: hidden !important; /* Contiene tutto */
        width: auto !important;
    }
    
    /* Titolo prodotto - DEVE ESSERE VISIBILE */
    .products-grid.list-view .product-title,
    .products-grid.list-view h3 {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        margin: 0 0 0.5rem 0 !important;
        line-height: 1.3 !important;
        color: #333 !important;
        display: block !important; /* Forza visibilità */
        width: 100% !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        order: 1 !important; /* Primo elemento */
    }
    
    /* Nascondi descrizione in vista lista - RISPARMIA SPAZIO */
    .products-grid.list-view .product-description,
    .products-grid.list-view p {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    
    /* Dettagli prodotto compatti */
    .products-grid.list-view .product-details {
        display: flex !important;
        gap: 0.5rem !important;
        margin: 0.5rem 0 !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        order: 2 !important; /* Secondo elemento dopo titolo */
        width: 100% !important;
        overflow: hidden !important;
    }
    
    .products-grid.list-view .product-details .category,
.products-grid.list-view .product-details .material,
.products-grid.list-view .product-details .color,
.products-grid.list-view .product-details .gender {
    font-size: 0.75rem !important;
    color: #666 !important;
    background-color: #f8f9fa !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
    white-space: nowrap !important;
    border: 1px solid #e9ecef !important;
}

.products-grid.list-view .product-details .category i,
.products-grid.list-view .product-details .material i,
.products-grid.list-view .product-details .color i,
.products-grid.list-view .product-details .gender i {
    font-size: 0.7rem !important;
    margin-right: 4px !important;
    color: var(--secondary-color, #c4a661) !important;
}
    
    /* Prezzo e stock in linea */
    .products-grid.list-view .price-stock-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 0.5rem 0 !important;
        gap: 1rem !important;
        order: 3 !important; /* Terzo elemento */
        width: 100% !important;
        flex-shrink: 0 !important;
    }
    
    .products-grid.list-view .product-price {
        font-size: 1.1rem !important;
        font-weight: bold !important;
        color: var(--secondary-color, #c4a661) !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .products-grid.list-view .stock-indicator {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
        border-radius: 12px !important;
        position: static !important;
        background-color: #e8f5e8 !important;
        color: #2d7d2d !important;
        border: 1px solid #c3e6c3 !important;
        white-space: nowrap !important;
    }
    
    /* Pulsanti azioni orizzontali - VISIBILI */
    .products-grid.list-view .product-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        margin-top: 0.5rem !important;
        width: 100% !important;
        justify-content: space-between !important;
        flex-shrink: 0 !important; /* Non si rimpiccioliscono */
        order: 4 !important; /* Ultimo elemento */
        margin-top: auto !important; /* Spinge in basso */
    }
    
    .products-grid.list-view .details-btn,
    .products-grid.list-view .add-to-cart {
        flex: 1 !important;
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        min-height: 32px !important;
        border-radius: 6px !important;
        white-space: nowrap !important; /* Testo su una riga */
        text-overflow: ellipsis !important;
        overflow: hidden !important;
    }
    
    /* Badge in evidenza */
    .products-grid.list-view .featured-badge {
        position: absolute !important;
        top: 4px !important;
        left: 4px !important;
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
        border-radius: 3px !important;
        z-index: 2 !important;
    }
    
    /* Nascondi elementi non necessari in vista lista */
    .products-grid.list-view .image-navigation,
    .products-grid.list-view .nav-btn {
        display: none !important;
    }
    
    /* PREVIENI OVERFLOW ORIZZONTALE SU TUTTA LA PAGINA */
    @supports (overflow-x: clip) {
        .products-page .products-section .products-grid.list-view {
            overflow-x: clip !important;
        }
    }
    
    .products-page .products-section {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
}

/* ============================================
   🔍 SEARCH FUNCTIONALITY STYLES
   ============================================ */

.search-group {
    margin-bottom: 2rem !important;
    padding-bottom: 2rem !important;
    border-bottom: 2px solid #f0f0f0 !important;
}

.search-group h3 {
    color: #333 !important;
    font-size: 1.2rem !important;
    margin-bottom: 1rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.search-group h3 i {
    color: #555 !important;
}

.search-container {
    position: relative !important;
    margin-bottom: 1rem !important;
}

.search-input {
    width: 100% !important;
    padding: 12px 45px 12px 15px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    background: #f8f9fa !important;
    box-sizing: border-box !important;
}

/* Rimuovi la X nativa del browser */
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
    -webkit-appearance: none !important;
    display: none !important;
}

.search-input::-ms-clear,
.search-input::-ms-reveal {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.search-input:focus {
    outline: none !important;
    border-color: #1a73e8 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1) !important;
}

.search-input:not(:placeholder-shown) {
    background: white !important;
    border-color: #1a73e8 !important;
}

.search-clear {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #f0f0f0 !important;
    border: none !important;
    color: #666 !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    display: none !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
}

.search-clear:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
}

.search-clear.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-suggestions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    align-items: center !important;
}

.suggestion-label {
    font-size: 12px !important;
    color: #666 !important;
    font-weight: 600 !important;
    margin-right: 0.5rem !important;
}

.suggestion-tag {
    background: #f0f2f5 !important;
    border: 1px solid #e1e5e9 !important;
    padding: 4px 10px !important;
    border-radius: 15px !important;
    font-size: 11px !important;
    color: #555 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
}

.suggestion-tag:hover {
    background: #1a73e8 !important;
    color: white !important;
    border-color: #1a73e8 !important;
    transform: translateY(-1px) !important;
}

.suggestion-tag:active {
    transform: translateY(0) !important;
}

/* Search results info */
.search-results-info {
    background: #e8f5e8 !important;
    border: 1px solid #c3e6c3 !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
    font-size: 14px !important;
    color: #2e7d32 !important;
    display: none !important;
}

.search-results-info.show {
    display: block !important;
}

.search-results-info i {
    margin-right: 0.5rem !important;
}

/* No results message */
.no-search-results {
    text-align: center !important;
    padding: 2rem !important;
    color: #666 !important;
    background: #f8f9fa !important;
    border-radius: 12px !important;
    border: 2px dashed #ddd !important;
    margin: 2rem 0 !important;
}

.no-search-results i {
    font-size: 3rem !important;
    color: #ccc !important;
    margin-bottom: 1rem !important;
}

.no-search-results h3 {
    margin-bottom: 0.5rem !important;
    color: #333 !important;
}

.no-search-results p {
    margin-bottom: 1rem !important;
}

.search-suggestions-alter {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
}

/* ============================================
   📋 SORT DROPDOWN STYLES
   ============================================ */

.sort-section {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: white !important;
    padding: 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
    margin-bottom: 2rem !important;
    border: 1px solid #f0f0f0 !important;
}

.sort-left {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

.sort-left label {
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 15px !important;
    margin: 0 !important;
}

.sort-select {
    padding: 12px 40px 12px 15px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 25px !important;
    font-size: 14px !important;
    background: #f8f9fa !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-width: 200px !important;
    font-weight: 500 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 16px !important;
}

.sort-select:focus {
    outline: none !important;
    border-color: #1a73e8 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1) !important;
}

.sort-select:hover {
    border-color: #1a73e8 !important;
    background: white !important;
}

.sort-select option {
    padding: 10px !important;
    background: white !important;
    color: #333 !important;
    font-weight: 500 !important;
}

/* Mobile search styles */
@media (max-width: 768px) {
    .search-input {
        padding: 14px 45px 14px 15px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .suggestion-tag {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .search-suggestions {
        justify-content: center !important;
    }
    
    .suggestion-label {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Sort section mobile */
    .sort-section {
        flex-direction: column !important;
        gap: 15px !important;
        padding: 15px !important;
    }
    
    .sort-left {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .sort-left label {
        font-size: 14px !important;
    }
    
    .sort-select {
        width: 100% !important;
        min-width: auto !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 14px 40px 14px 15px !important;
    }
    
    /* Sottocategorie extra small mobile */
    .subcategories-bar {
        margin: 0.5rem !important;
        padding: 0.75rem !important;
    }
    
    .subcategory-tabs-small {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }
    
    .subcategory-tab-small {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.8rem !important;
        min-width: auto !important;
        border-radius: 15px !important;
    }
}