/* ====================================
   Decanto Homepage Styles
   CSS per filtri e componenti nella home
   ==================================== */

/* ====================================
   Filtri Tassonomie (Unified)
   ==================================== */

.decanto-filter-selection {
    display: flex;
    gap: 20px 10px;
}

/* Default desktop: wrap */
.desktop-layout-wrap > .decanto-filter-selection {
    flex-wrap: wrap;
}

/* Desktop swipe mode */
.desktop-layout-swipe > .decanto-filter-selection {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 5px;
    margin-bottom: -5px;
}

.desktop-layout-swipe > .decanto-filter-selection::-webkit-scrollbar {
    display: none;
}

.desktop-layout-swipe > .decanto-filter-selection {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.desktop-layout-swipe .decanto-filter-single {
    flex-shrink: 0;
    scroll-snap-align: start;
}

.decanto-filter-single {
    display: inline-block;
}

.decanto-filter-wrapper .decanto-filter-single a {
    display: inline-block;
    border: 1px solid #a3a3a3;
    padding: 3px 14px 6px 14px;
    border-radius: 20px;
    font-family: 'HK Grotesk', sans-serif;
    text-decoration: none;
    color: #000000;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.decanto-filter-single a:hover {
    background-color: #242e50;
    border-color: #242e50;
    color: #ffffff;
}

.decanto-filter-count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 4px;
}

/* ====================================
   Filter Popup
   ==================================== */

.decanto-filter-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.decanto-filter-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.decanto-filter-popup {
    background: #ffffff;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.decanto-filter-popup-overlay.active .decanto-filter-popup {
    transform: scale(1);
}

.decanto-filter-popup-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.decanto-filter-popup-header h3 {
    margin: 0;
    font-family: 'HK Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #242e50;
}

.decanto-filter-popup-close {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
}

.decanto-filter-popup-close:hover {
    background: #f0f0f0;
    color: #242e50;
}

.decanto-filter-popup-content {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.decanto-filter-popup-content::-webkit-scrollbar {
    width: 8px;
}

.decanto-filter-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.decanto-filter-popup-content::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.decanto-filter-popup-content::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.decanto-filter-selection-full {
    gap: 12px;
}

.decanto-filter-popup-content .decanto-filter-selection {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
}

/* ====================================
   Responsive
   ==================================== */

@media (max-width: 768px) {
    .mobile-layout-wrap > .decanto-filter-selection {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .mobile-layout-swipe > .decanto-filter-selection {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 5px;
        margin-bottom: -5px;
    }

    .mobile-layout-swipe > .decanto-filter-selection::-webkit-scrollbar {
        display: none;
    }

    .mobile-layout-swipe > .decanto-filter-selection {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .mobile-layout-swipe .decanto-filter-single {
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .decanto-filter-popup-content .decanto-filter-selection {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        gap: 12px;
    }

    .decanto-filter-popup {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .decanto-filter-popup-header {
        padding: 20px;
    }

    .decanto-filter-popup-header h3 {
        font-size: 20px;
    }

    .decanto-filter-popup-content {
        padding: 20px;
    }

    .decanto-filter-single a {
        padding: 2px 12px 5px 12px;
    }

    .decanto-filter-popup-close {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .decanto-filter-popup-header {
        padding: 15px;
    }

    .decanto-filter-popup-header h3 {
        font-size: 18px;
    }

    .decanto-filter-popup-content {
        padding: 15px;
    }
}
