
/* ============================================================
   VARIABLES CSS
============================================================ */
:root {
    --primary: var(--primary-green-1);
}

/* ============================================================
   RÉINITIALISATION ET UTILITAIRES
============================================================ */
#blockcart-modal,
.modal-backdrop.in {
    display: none !important;
}

/* ============================================================
   PANIER SIDEBAR - STRUCTURE PRINCIPALE
============================================================ */
/* Wrapper du panier sidebar */
.cart-sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0 0 0 / 0.4);
    display: flex;
    justify-content: flex-end;
    z-index: 999;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-sidebar-wrapper.active {
    pointer-events: initial;
    opacity: 1;
}

.cart-sidebar-wrapper.active .cart-sidebar {
    transform: translateX(0);
}

/* Panier sidebar principal */
.cart-sidebar {
    width: 500px;
    height: 100%;
    padding: 0px 0 16px 0;
    background-color: var(--color-white);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: relative;
}

/* ============================================================
   PANIER SIDEBAR - HEADER
============================================================ */
.cart-sidebar .header {
    padding: 0;
}

.cart-sidebar .blockcart .header {
    padding: 0;
}

/* Header top avec fermeture et titre */
.cart-sidebar .header__top {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.cart-sidebar .header__top .close {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary);
    opacity: 1;
}

/* Titre du panier */
.cart-sidebar__title {
    font-size: 23px;
    line-height: normal;
    margin-bottom: 0;
    color: var(--color-black);
    font-weight: bold;
    text-transform: uppercase;
    text-align: center;
}

.cart-sidebar .header .title {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 20px;
    -webkit-font-smoothing: auto;
    text-align: start;
}

.cart-sidebar .header .title-wrapper {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

/* Icône du panier */
.cart-sidebar .header .cart-sidebar-cart-icon {
    position: relative;
    width: 22px;
    height: 22px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="21.845" height="18.436" viewBox="0 0 21.845 18.436"><path id="Union_5" data-name="Union 5" d="M262.153,1991.435a3.533,3.533,0,0,1-3.38-2.539l-2.758-9.612a.41.41,0,0,1,.406-.52h3.807l2.6-5.53a.409.409,0,0,1,.755.035.407.407,0,0,1-.015.313l-2.436,5.179h11.592l-2.436-5.179a.41.41,0,0,1,.2-.544.409.409,0,0,1,.544.2l2.6,5.53h3.8a.409.409,0,0,1,.406.519l-2.748,9.6a3.55,3.55,0,0,1-3.38,2.551Zm-2.595-2.762a2.709,2.709,0,0,0,2.595,1.962H271.7a2.707,2.707,0,0,0,2.595-1.962l2.6-9.091H256.962Z" transform="translate(-256 -1973)"/></svg>');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.cart-sidebar .header .cart-sidebar-cart-icon span {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background-color: var(--color-primary);
    border-radius: 50%;
    color: var(--color-black);
    font-size: 10px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

/* Éléments cachés du header */
.cart-sidebar .blockcart a:not(.btn),
.cart-sidebar .header .cart-sidebar-footer,
.cart-sidebar .footer .cart-sidebar-header {
    display: none;
}

/* ============================================================
   GAMIFICATION - SYSTÈME DE PROGRESSION
============================================================ */
/* Livraison gratuite - wrapper */
.cart-sidebar .remaining-free-delivery-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.cart-sidebar .remaining-free-delivery-wrapper p {
    margin-bottom: 0;
}

.cart-sidebar .remaining-free-delivery {
    font-weight: 700;
}

/* Mètre de progression */
.cart-sidebar-meter-title {
    font-size: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-sidebar-meter-title p {
    margin: 0;
}

.cart-sidebar-meter {
    width: 100%;
    height: 4px;
    background-color: var(--color-light-grey);
}

.cart-sidebar-meter .meter {
    display: block;
    height: 100%;
    max-width: 100%;
    background-color: var(--color-primary);
}

/* ============================================================
   PANIER SIDEBAR - BODY (CONTENU PRINCIPAL)
============================================================ */
.cart-sidebar .body {
    overflow: auto;
    padding: 0;
    margin-block: 25px 16px;
}

/* Liste des produits */
ul.cart-items {
    display: flex;
    flex-direction: column-reverse;
}

/* Aperçu du panier */
.cart-overview {
    overflow: hidden;
    transition: 300ms;
}

.cart-overview:has(.no-items) {
    display: flex;
    justify-content: center;
    font-weight: bold;
}

.body:not(.open) .cart-overview .cart-item:last-child {
    border-bottom: 0;
    transition-delay: 150ms;
}

/* ============================================================
   ARTICLES DU PANIER - STRUCTURE ET LAYOUT
============================================================ */

.cart-sidebar .cart-item .product-image {
    aspect-ratio: 1;
}

/* ============================================================
   INFORMATIONS PRODUIT - TEXTE ET CONTENU
============================================================ */
/* Titre du produit */
.cart-sidebar .cart-item .title {
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    margin-bottom: 3px;
    display: block;
    text-align: start;
}

/* ============================================================
   BOUTON D'OUVERTURE DES ARTICLES
============================================================ */
.cart-item-opener {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-block: 30px;
}

.cart-item-opener::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 1px;
    background: var(--color-dark-grey);
}

.cart-item-opener span {
    position: relative;
    z-index: 3;
    background: var(--color-white);
    padding: 8px 30px;
    border-radius: 100px;
    border: 1px solid var(--color-dark-grey);
    font-size: 13px;
    color: var(--color-black);
    width: 285px;
    text-align: center;
}

.cart-item-opener--hide {
    display: none;
}


/* ============================================================
   PANIER SIDEBAR - FOOTER
============================================================ */
.cart-sidebar .footer {
    width: 100%;
    overflow: hidden;
    display: flex;
    padding: 0 32px;
    flex-direction: column;
    gap: 16px;
}

.cart-sidebar .footer .checkout {
    padding: 50px 30px 0 30px;
}

/* Boutons du footer */
.cart-sidebar .footer a.btn:hover {
    background-color: var(--color-primary);
    color: var(--color-black);
}

span.btn.btn-secondary {
    opacity: 1;
}

.cart-sidebar span.btn.btn-secondary.close {
    width: 100%;
    height: auto;
    font-size: 15px;
    padding: 14px;
    box-shadow: none !important;
    border: 1px solid var(--color-black);
    border-radius: 5px;
}

/* Animations des boutons */
.cart-sidebar .footer a.btn svg > g > path {
    animation: btn-arrow 0.8s linear infinite alternate-reverse;
}

.cart-sidebar .footer a.btn svg > g > path:nth-child(2) {
    animation-delay: 0.2s;
}

.cart-sidebar .footer a.btn svg > g > path:nth-child(3) {
    animation-delay: 0.4s;
}

/* Texte du footer */
.cart-sidebar .footer p {
    margin-top: 25px;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 300;
    text-align: center;
}

/* Disclaimer */
.cart-sidebar .disclaimer {
    color: var(--color-black);
    font-size: 11px;
    text-align: center;
    line-height: normal;
    display: block;
}

.shttCart-disclaimer {
    text-align: center;
}

/* Éléments cachés */
.cart-sidebar .shttAttributesAvailable {
    display: none;
}

/* ============================================================
   SYSTÈME DE GAMIFICATION - PROGRESSION ET RÉCOMPENSES
============================================================ */
/* Titre de la gamification */
p.shttGamification__title {
    font-size: 13px;
    text-align: center;
    margin-block: 12px;
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

p.shttGamification__title svg {
    margin-right: 5px;
}

p.shttGamification__title span {
    color: var(--color-primary);
    font-weight: 700;
    color: var(--color-black);
}

/* Grille de gamification */
.shttGamification__grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 100%;
}

.shttGamification__grid.gamification-one {
    grid-template-columns: 1fr !important;
}

.shttGamification__grid.gamification-one .shttGamification__freeGiftText {
    grid-column: 2/5;
}

/* Barres de progression */
.shttGamification__rode {
    height: 4px;
    width: 100%;
    background: #f2f2f2;
    align-self: center;
    grid-column: span 2;
}

.shttGamification__rodeInside {
    height: 100%;
    width: 0%;
    background-color: #5FB56E;
    display: block;
}

/* Icônes de gamification */
.shttGamification__icon {
    position: relative;
    display: flex;
    align-items: center;
}

.shttGamification__freeShipingIcon,
.shttGamification__freeGiftIcon {
    margin: 0 auto;
}

svg.shttGamification__iconCheck {
    position: absolute;
    right: -8px;
    top: -8px;
}

/* Textes de gamification */
.shttGamification__freeShipingText {
    grid-column: 2/5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shttGamification__freeGiftText {
    grid-column: 5/8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.shttGamification__rodeText {
    padding-top: 4px;
}

.shttGamification__rodeText p {
    margin: 0;
    font-size: 12px;
    line-height: 16px;
    color: #898989;
}

.shttGamification__rodeTextAmount {
    font-weight: bold;
}

.shttGamification__rodeTextCompleted p {
    color: var(--color-primary);
}

/* ============================================================
   RESPONSIVE DESIGN - MOBILE
============================================================ */
/* Popup mobile cachée par défaut */
.cart-sidebar-wrapper .cart-sidebar-mobile-popup {
    display: none;
}

.cart-sidebar .cart-item{
    padding-inline: 25px !important;
}

.header__gamification{
    margin-inline: 25px;
}

/* Media Query Mobile */
@media (max-width: 767px) {
    /* Wrapper responsive */
    .cart-sidebar-wrapper {
        width: 100vw;
        height: 100dvh;
        position: fixed;
        right: 0;
        left: unset;
        font-size: 12px;
        color: var(--color-black);
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
    }

    /* Popup mobile visible */
    .cart-sidebar-wrapper .cart-sidebar-mobile-popup {
        display: block;
    }
    
    /* Sidebar responsive */
    .cart-sidebar {
        margin: 0;
        bottom: 0;
        width: 100%;
        height: calc(100% - 52px);
        transform: translateY(100%);
    }
        
    .cart-sidebar .body {
        padding: 0 20px;
    }
    
    .cart-item-opener {
        margin-inline: 12px;
    }

    .cart-sidebar .cart-item{
        padding: 10px !important;
    }
}





