/* ==========================================================================
   Mini panier (reproduction du widget menu-cart d'Elementor Pro, B-17).
   Bouton : 48 x 48, fond primaire, bordure 6 px #F4F7F4, icone 20 px
   blanche, pastille du nombre d'articles 16 px a 10 px du coin. Panneau
   lateral : voir la seconde partie (ouverture par assets/js/cart.js).
   ========================================================================== */

.hpt-cart {
    position: relative;
}

.hpt-cart .hpt-cart__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    width: auto;
    margin: 0;
    padding: 8px;
    border: 6px solid #F4F7F4;
    border-radius: 100px;
    background-color: var( --e-global-color-primary );
    color: #69727D;
    font-family: var( --e-global-typography-primary-font-family ), Sans-serif;
    font-size: var( --e-global-typography-primary-font-size );
    font-weight: var( --e-global-typography-primary-font-weight );
    line-height: var( --e-global-typography-primary-line-height );
    text-align: center;
    cursor: pointer;
    transition: all .3s;
}

.hpt-cart .hpt-cart__toggle:hover,
.hpt-cart .hpt-cart__toggle:focus {
    border-color: var( --e-global-color-7fc161d );
    background-color: var( --e-global-color-primary );
    color: #69727D;
}

.hpt-cart .hpt-cart__icon {
    display: flex;
    position: relative;
    color: var( --e-global-color-26faf7d );
    font-size: 20px;
}

.hpt-cart .hpt-cart__icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.hpt-cart .hpt-cart__count {
    display: block;
    position: absolute;
    top: -10px;
    right: -10px;
    min-width: 1.6em;
    height: 1.6em;
    border-radius: 100%;
    background-color: var( --e-global-color-7fc161d );
    color: var( --e-global-color-text );
    font-size: 10px;
    line-height: 1.5em;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Panneau lateral (type "side-cart" d'Elementor Pro). Valeurs du widget :
   largeur 350 px, marges internes 20 / 30 px, ombre 0 0 20px, voile
   rgba(0,0,0,.25), croix accent 14 px, produits en grille 40 px + texte
   (CSS perso du widget), bouton de retrait 20 px au milieu, boutons de pied
   empiles (ecart 5 px, fond accent, marge interne 10 px).
   -------------------------------------------------------------------------- */

.hpt-cart .hpt-cart__overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
    width: 100vw;
    height: 100%;
    background-color: rgba( 0, 0, 0, .25 );
}

.hpt-cart .hpt-cart__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 350px;
    max-width: 100%;
    min-height: 200px;
    padding: 20px 30px;
    background-color: #FFFFFF;
    box-shadow: 0 0 20px rgba( 0, 0, 0, .2 );
    font-size: 14px;
    text-align: start;
}

.hpt-cart .hpt-cart__panel[hidden],
.hpt-cart .hpt-cart__overlay[hidden] {
    display: none;
}

.hpt-cart .hpt-cart__close {
    display: inline-block;
    position: relative;
    align-self: flex-end;
    width: 14px;
    height: 14px;
    margin: 0 0 20px auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    transition: .3s;
}

.hpt-cart .hpt-cart__close:hover,
.hpt-cart .hpt-cart__close:focus {
    background: transparent;
}

.hpt-cart .hpt-cart__close::before,
.hpt-cart .hpt-cart__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    margin-top: -1px;
    border-radius: 1px;
    background: var( --e-global-color-accent );
    transition: .3s;
}

.hpt-cart .hpt-cart__close::before {
    transform: rotate( 45deg );
}

.hpt-cart .hpt-cart__close::after {
    transform: rotate( -45deg );
}

.hpt-cart .widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hpt-cart .woocommerce-mini-cart__empty-message {
    color: var( --e-global-color-text );
    font-family: "Raleway", Sans-serif;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2em;
    text-align: start;
}

.hpt-cart .hpt-cart__products {
    max-height: calc( 100vh - 300px );
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hpt-cart .hpt-cart__product {
    display: grid;
    position: relative;
    /* 28 % comme l'ancien site : la regle "40px auto" du CSS perso du
       widget n'y prenait jamais effet (imprimee avant la feuille du widget,
       a specificite egale). Seules la taille de l'image et l'ecart de
       12 px s'appliquaient. */
    grid-template-columns: 28% auto;
    grid-template-rows: auto 75%;
    column-gap: 12px;
    padding-inline-end: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #D5D8DC;
}

.hpt-cart .hpt-cart__product:not(:first-of-type) {
    padding-top: 20px;
}

.hpt-cart .hpt-cart__product:last-child {
    border: none;
}

.hpt-cart .hpt-cart__product-image {
    grid-row-start: 1;
    grid-row-end: 3;
    width: 100%;
}

.hpt-cart .hpt-cart__product-image a,
.hpt-cart .hpt-cart__product-image img {
    display: block;
}

.hpt-cart .hpt-cart__product-image img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.hpt-cart .hpt-cart__product-name,
.hpt-cart .hpt-cart__product-price {
    grid-column-start: 2;
    grid-column-end: 3;
    padding-inline-start: 20px;
    font-size: 14px;
}

.hpt-cart .hpt-cart__product-name {
    margin: 0;
}

.hpt-cart .hpt-cart__product-name a {
    color: var( --e-global-color-text );
    font-family: "Raleway", Sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2em;
    transition: .3s;
}

.hpt-cart .hpt-cart__product-price {
    align-self: start;
    color: var( --e-global-color-text );
    font-family: "Raleway", Sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2em;
}

.hpt-cart .hpt-cart__product-price .product-quantity {
    color: var( --e-global-color-text );
}

.hpt-cart .hpt-cart__product-remove {
    position: absolute;
    inset-inline-end: 0;
    bottom: 50%;
    width: 20px;
    height: 20px;
    overflow: hidden;
    border: 1px solid var( --e-global-color-secondary );
    border-radius: 20px;
    color: #69727D;
    text-align: center;
    transform: translateY( 50% );
    transition: .3s;
}

.hpt-cart .hpt-cart__product-remove::before,
.hpt-cart .hpt-cart__product-remove::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 25%;
    z-index: 1;
    width: 50%;
    height: 1px;
    margin-top: -1px;
    background: var( --e-global-color-secondary );
    transition: .3s;
}

.hpt-cart .hpt-cart__product-remove::before {
    transform: rotate( 45deg );
}

.hpt-cart .hpt-cart__product-remove::after {
    transform: rotate( -45deg );
}

.hpt-cart .hpt-cart__product-remove > a {
    display: block;
    position: absolute;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0;
}

.hpt-cart .hpt-cart__subtotal {
    padding-top: 20px;
    padding-bottom: 20px;
    border: 0 solid #D5D8DC;
    color: var( --e-global-color-text );
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.hpt-cart .hpt-cart__footer-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 0;
    padding-top: 20px;
    font-size: 20px;
    text-align: center;
}

/* Theme 1.0.2 : memes boutons que "Valider la commande" (panier) et
   "Commander" (page de commande), au lieu de l'ancien style du widget
   Elementor (cadre gris de 6 px, angles droits, survol gris). */
.hpt-cart .hpt-cart__button {
    display: block;
    height: fit-content;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background-color: #2787C9;
    color: #FFFFFF;
    font-family: "Raleway", Sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2em;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s;
}

.hpt-cart .hpt-cart__button:hover,
.hpt-cart .hpt-cart__button:focus {
    background-color: #0E9EDE;
    color: #FFFFFF;
}
