﻿/* =====================================================
   CONFIGURATORE VARIANTI
   ===================================================== */

.filter-configurator {
    display: block;
    width: 100%;
}

.filter-configurator-card {
    width: 100%;
    /*padding: 20px;*/
    /*border: 1px solid #d1d1d1;*/
    border-radius: 4px;
    background: #fff;
}

.filter-configurator-title {
    margin: 0 0 24px;
    color: #111;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Sempre una colonna */
.filter-configurator-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 24px;
}

.filter-group {
    display: block;
    width: 100%;
    min-width: 0;
    transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    /* Separatore tra gruppi */
    .filter-group + .filter-group {
        padding-top: 24px;
        /*border-top: 1px solid #e5e5e5;*/
    }

.filter-group-heading {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
    margin-bottom: 10px;
    color: #222;
    font-size: 1rem;
    line-height: 1.3;
}

.filter-current-value.is-missing-selection {
    color: #9a5b00;
    text-decoration: underline dotted rgba(154, 91, 0, .55);
    text-underline-offset: 2px;
}

.filter-current-value.is-missing-selection:empty {
    display: inline;
}

.filter-current-value.is-missing-selection::after {
    content: " da scegliere";
    font-weight: 600;
    font-style: italic;
}

.filter-group-label {
    font-weight: 500;
}

.filter-current-value {
    font-weight: 700;
}

    .filter-current-value:empty {
        display: none;
    }


/* =====================================================
   RICERCA VARIANTI
   ===================================================== */

.filter-variant-tools {
    margin-bottom: 10px;
}

.filter-variant-search {
    width: 100%;
    min-height: 38px;
    border-color: #cfcfcf;
    border-radius: 3px;
    font-size: .925rem;
}

    .filter-variant-search:focus {
        border-color: var(--bs-primary);
        box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .12);
    }


/* =====================================================
   OPZIONI
   ===================================================== */

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.filter-option {
    min-width: 64px;
    min-height: 38px;
    padding: 7px 14px;
    border: 1px solid #b8b8b8;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-size: .925rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, opacity .15s ease;
}

    .filter-option:hover,
    .filter-option:focus {
        border-color: var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), .07);
        color: #111;
        box-shadow: none;
    }


    /* Variante selezionata */

    .filter-option.active,
    .filter-option.active:hover,
    .filter-option.active:focus {
        border-color: #120C14;
        background: #120C14;
        box-shadow: none;
    
    }


    /*
 * Variante attualmente visualizzata.
 * Resta visibile e selezionata, ma non scatena
 * un nuovo aggiornamento.
 */

    .filter-option.is-current {
        cursor: default;
    }


    /*
 * Opzioni incompatibili
 */

    .filter-option.is-unavailable {
        opacity: .35;
        cursor: not-allowed;
        pointer-events: none;
    }

    .filter-option.is-search-match {
        border-color: var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), .11);
    }

    .filter-option.is-search-mismatch {
        opacity: .82;
    }

.filter-option.is-search-hidden {
    display: none !important;
}

.filter-option.variant-ui-hidden {
    display: none !important;
}


/* =====================================================
   MOSTRA ALTRE VARIANTI
   ===================================================== */

.filter-options-toggle-wrap {
    margin-top: 10px;
}

.filter-options-toggle {
    color: var(--bs-primary);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

    .filter-options-toggle:hover,
    .filter-options-toggle:focus {
        color: var(--bs-primary);
        text-decoration: underline;
        box-shadow: none;
    }


/* =====================================================
   RESET SELEZIONE
   ===================================================== */

.filter-configurator-reset {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.btn-filter-trash {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #777;
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: none;
}

    .btn-filter-trash:hover,
    .btn-filter-trash:focus {
        color: var(--bs-primary);
        text-decoration: none;
        box-shadow: none;
    }

.filter-reset-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
}


/* =====================================================
   STATO VARIANTE DISPONIBILE
   ===================================================== */

.filter-variant-status {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(var(--bs-success-rgb), .22);
    border-radius: 4px;
    background: rgba(var(--bs-success-rgb), .06);
}

    .filter-variant-status.d-none {
        display: none !important;
    }

.filter-variant-status-icon {
    display: flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bs-success);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.filter-variant-status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

    .filter-variant-status-content strong {
        color: #333;
        font-size: .95rem;
        font-weight: 700;
        line-height: 1.25;
    }

.filter-variant-status-selection {
    color: #666;
    font-size: .875rem;
    line-height: 1.35;
}

.filter-variant-quick-cart {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    margin-top: 14px;
}

    .filter-variant-quick-cart.d-none {
        display: none !important;
    }

.filter-variant-qty-group {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 320px;
}

.filter-variant-qty-step {
    flex: 0 0 40px;
    min-width: 40px;
    padding-left: 0;
    padding-right: 0;
}

.filter-variant-qty {
    flex: 1 1 auto;
    min-width: 68px;
    text-align: center;
    border-left: 0;
    border-right: 0;
}

.filter-variant-price {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 120px;
    color: #111;
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
}

.btn-filter-add-to-cart {
    flex: 0 0 auto;
    min-width: 100px;
    min-height: 46px;
    font-weight: 700;
}

.btn-filter-cart-go {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    min-width: 0;
    font-size: 1.15rem;
}


/* =====================================================
   AZIONE PRINCIPALE
   ===================================================== */

.filter-configurator-actions {
    display: block;
    width: 100%;
    margin-top: 18px;
}

.btn-filter-find {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding-left: 18px;
    padding-right: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.filter-find-arrow {
    font-size: 1.3rem;
    line-height: 1;
}


/* Stato disabilitato */

.btn-filter-find:disabled,
.btn-filter-find.disabled {
    cursor: not-allowed;
    opacity: .5;
}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 767.98px) {

    .filter-configurator-card {
        padding: 16px;
    }

    .filter-configurator-title {
        margin-bottom: 20px;
        font-size: 1.35rem;
    }

    .filter-configurator-grid {
        gap: 20px;
    }

    .filter-group + .filter-group {
        padding-top: 20px;
    }

    .filter-options {
        gap: 7px;
    }

    .filter-option {
        min-height: 40px;
        padding: 8px 12px;
    }

    .filter-configurator-reset {
        margin-top: 16px;
    }

    .filter-variant-status {
        margin-top: 18px;
        padding: 12px 14px;
    }

    .filter-variant-status-icon {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .filter-configurator-actions {
        margin-top: 16px;
    }

    .btn-filter-find {
        width: 100%;
        min-height: 48px;
    }
}


/* =====================================================
   LOADING OVERLAY
   ===================================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .35);
    cursor: wait;
}

    .loading-overlay .spinner-grow {
        width: 3rem;
        height: 3rem;
    }



/* Variante selezionata */

.filter-option.active,
.filter-option.active:hover,
.filter-option.active:focus {
    position: relative;
    border-color: #120C14;
    background: #120C14;
    color: #fff;
    box-shadow: none;
}

    .filter-option.active::after {
        content: "";
        position: absolute;
        top: -9px;
        right: -9px;
        width: 20px;
        height: 20px;
        border: 2px solid #120C14;
        border-radius: 50%;
        background-color: #fff;
        /* X perfettamente centrata */
        background-image: linear-gradient(45deg, transparent calc(50% - 1px), #120C14 calc(50% - 1px), #120C14 calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(-45deg, transparent calc(50% - 1px), #120C14 calc(50% - 1px), #120C14 calc(50% + 1px), transparent calc(50% + 1px));
        background-size: 7px 7px;
        background-position: center;
        background-repeat: no-repeat;
        box-sizing: border-box;
        z-index: 2;
    }

    .filter-option.active:hover::after {
        background-color: #120C14;
        background-image: linear-gradient(45deg, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(-45deg, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px));
    }
