/* -------------
    SOMMAIRE
------------- */

/*
    @AUTHOR : Nicolas BOUDOT

    MOLÉCULE : Widgets header
    Style des widgets de l'en-tête
*/

/*
    00 - GÉNÉRAL
    01 - WOOCOMMERCE
        Mon compte
        Mon panier
    02 - LANGUES
*/



/* -------------------------
    00 - GÉNÉRAL
------------------------- */

.molecule_widgets-header {
    display: flex;
    align-items: center;
}

    @media (min-width: 992px) {
        .molecule_widgets-header {
            margin-left: 16px;
        }
    }

/* Widgets frères */
.molecule_widgets-header .widget_block + .widget_block {
    margin-left: 6px;
    padding-left: 6px;
}

/* Mon compte + Mon panier (surcharge de Woocommerce) */
.wc-block-mini-cart__button,
.wp-block-woocommerce-customer-account {
    cursor: pointer;
    padding: 0;
}

.wc-block-mini-cart__quantity-badge,
.wp-block-woocommerce-customer-account a {
    display: flex;
    align-items: center;
    text-align: center;
    padding: 0;
}

    /* Icon */
    .wc-block-mini-cart__quantity-badge::before,
    .wp-block-woocommerce-customer-account a::before {
        color: var(--white);
        font-size: 2.2rem;
        font-family: 'icomoon';
        line-height: 1;
        margin-right: 6px;
    }

        @media (max-width: 991px) {
            .wc-block-mini-cart__quantity-badge::before,
            .wp-block-woocommerce-customer-account a::before {
                font-size: 1.6rem;
            }
        }

    /* Icon par défaut */
    .wc-block-mini-cart__quantity-badge svg,
    .wp-block-woocommerce-customer-account a svg {
        display: none;
    }

/* Label */
.wc-block-mini-cart__badge,
.wp-block-woocommerce-customer-account a .label {
    position: absolute;
    top: -10px;
    right: -5px;
    left: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--c-primary);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1;
    margin: 0;
    padding: 0;
    width: 16px;
    aspect-ratio: 1 / 1;
    height: auto;
    transform: none;
    transition: background-color .4s;
}

    @media (max-width: 991px) {
        .wp-block-woocommerce-customer-account a .label {
            display: none;
        }
    }

    /* Hover */
    .wc-block-mini-cart__button:hover .wc-block-mini-cart__badge,
    .wp-block-woocommerce-customer-account a:hover .label {
        background-color: var(--c-tertiary);
    }



/* -------------------------
    01 - WOOCOMMERCE
        Mon compte (surcharge de Woocommerce)
------------------------- */

.molecule_widgets-header .widget_block:has(.wc-block-mini-cart__button[disabled]) {
    display: none;
}

/* Hover */
.wp-block-woocommerce-customer-account a:hover {
    text-decoration: none !important;
}

/* Icon */
.wp-block-woocommerce-customer-account a::before {
    content: "\e90c";
    margin: 0;
}

.wp-block-woocommerce-customer-account a .label {
    display: none;
}



/* -------------------------
    01 - WOOCOMMERCE
        Mon panier (surcharge de Woocommerce)
------------------------- */

/* Hover */
.wc-block-mini-cart__button:hover:not([disabled]) {
    opacity: 1;
}

    @media (max-width: 991px) {
        .wc-block-mini-cart__quantity-badge {
            margin-right: 20px;
        }
    }

/* Icon */
.wc-block-mini-cart__quantity-badge::before {
    content: "\e90b";
}

/* Label */
@media (max-width: 991px) {
    .wc-block-mini-cart__badge {
        position: absolute;
        top: -7px;
        right: -3px;
        font-size: 1.1rem;
    }
}



/* -------------------------
    02 - LANGUES
------------------------- */

.widget_polylang {
    position: relative;
    margin-left: 12px;
    padding-left: 12px;
}

    @media (max-width: 991px) {
        .widget_polylang {
            padding-right: 20px;
        }
    }

    /* Before */
    .widget_polylang::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        background-color: var(--white);
        width: 1px;
        height: 14px;
        transform: translateY(-50%);
    }

.widget_polylang ul {
    position: absolute;
    top: -9px;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.widget_polylang ul li {
    cursor: pointer;
    padding: 0;
}

    /* Current */
    .widget_polylang ul li.current-lang {
        order: -1;
        margin-top: 0;
    }

        /* Current when Active */
        .widget_polylang.active ul li.current-lang {
            pointer-events: none;
        }

    /* Not current */
    .widget_polylang:not(.active) ul li:not(.current-lang) {
        display: none;
    }

    /* Before */
    .widget_polylang ul li::before {
        content: none;
    }

    /* Frères */
    .widget_polylang ul li + li {
        margin-top: 5px;
    }

.widget_polylang ul li a {
    color: var(--white);
    font-weight: 700;
}

    /* Not active */
    .widget_polylang:not(.active) ul li a {
        pointer-events: none;
    }

    /* Current */
    .widget_polylang ul li.current-lang a {
        pointer-events: none;
    }
