
/* ============================================================
   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.3);
    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: 488px;
    height: calc(100% - 32px);
    margin: 16px;
    padding: 20px 0 16px 0;
    background-color: white;
    border-radius: 8px;
    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 30px;
}

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

/* Header top avec fermeture et titre */
.header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.cart-sidebar .header__top .close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    opacity: 1;
}

/* Titre du panier */
.cart-sidebar__title {
    font-size: 25px;
    margin-bottom: 0;
    color: var(--primary);
    font-weight: bold;
}

.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(--primary);
    border-radius: 50%;
    color: white;
    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(--grey-2);
}

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

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

.cart-sidebar .body::-webkit-scrollbar {
    display: none;
}

/* 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
============================================================ */
/* Article individuel */
.cart-sidebar .body .cart-item {
    padding: 0;
}

.cart-sidebar .body .cart-item:first-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Grille du produit */
.cart-sidebar .body .cart-item > .product-line-grid {
    padding-top: 0;
    padding-bottom: 30px;
    border-bottom: 1px solid #d9d9d9;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px 20px;
}

/* .cart-sidebar .body .cart-item > .product-line-grid:first-child {
    border-bottom: none;
    margin-bottom: 0;
} */

.cart-sidebar .product-miniature .product-description .product-price-and-shipping {
    justify-content: center!important;
}

.cart-sidebar .product-miniature .product-description .product-title {
    min-height: 66px!important;
}

.cart-sidebar .body .cart-item > .product-line-grid .product-line-grid-left:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

/* Images des produits */
.cart-sidebar .cart-item .product-image,
.cart-sidebar .body .product-line-grid-left img {
    width: 100%;
    height: auto;
}

.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;
}

/* Informations produit */
.cart-sidebar .cart-item .product-line-info span {
    font-size: 14px;
    color: var(--color-black);
}

.cart-sidebar .cart-item .product-line-info span.value {
    font-weight: 600;
}

/* Corps de la ligne produit */
.cart-sidebar .product-line-grid-body {
    display: flex;
    gap: 20px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.cart-sidebar-wrapper .product-line-grid-right .cart-line-product-actions .remove-from-cart {
    color: transparent;
}

/* ============================================================
   QUANTITÉ ET CONTRÔLES - GESTION DES PRODUITS
============================================================ */
/* Quantité de base */
.cart-sidebar .body .cart-item > .product-line-grid .qty {
    grid-column: 2/3;
    grid-row: 2/3;
    margin: 0;
    display: block;
    float: none;
    padding-inline: 32px;
    width: fit-content;
    /* border: solid 1px var(--color-light-grey); */
    height: 40px;
}

.cart-sidebar .cart-item .product-line-qty {
    margin-top: 10px;
}

/* Input de quantité optimisé */
.cart-sidebar .js-cart-line-product-quantity {
    width: 32px !important;
    height: 38px !important;
    border: none !important;
    text-align: center;
    background: none;
}

/* Contrôles de quantité Bootstrap TouchSpin */
.cart-sidebar .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up {
    right: -32px !important;
}

.cart-sidebar .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down {
    left: -32px !important;
}

.cart-sidebar .bootstrap-touchspin .input-group-btn-vertical i {
    font-size: 1.3125rem !important;
}

/* Contrôles TouchSpin dans product-line-grid-right */
.cart-sidebar .body .product-line-grid-right .qty .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down,
.cart-sidebar .body .product-line-grid-right .qty .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up {
    width: 20px;
    height: 20px;
    top: calc(50% - 10px);
}

.cart-sidebar .body .product-line-grid-right .qty .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down {
    left: -25px;
}

.cart-sidebar .body .product-line-grid-right .qty .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up {
    right: -25px;
}

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

.cart-item-opener::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 1px;
    background: #d9d9d9;
}

.cart-item-opener span {
    position: relative;
    z-index: 3;
    background: white;
    padding: 8px 30px;
    border-radius: 100px;
    border: 1px solid #d9d9d9;
    font-size: 13px;
    color: #959595;
    width: 285px;
    text-align: center;
}

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

/* ============================================================
   CONTRÔLES AVANCÉS - LAYOUT PRODUIT
============================================================ */
/* Layout de la grille produit droite */
.cart-sidebar .body .product-line-grid-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

.cart-sidebar .body .product-line-grid-right .qty {
    margin-left: 25px;
    margin-right: 25px;
}

/* Input form-control pour bootstrap-touchspin */
.cart-sidebar .body .product-line-grid-right .qty .bootstrap-touchspin input.form-control {
    width: 40px;
    height: 30px;
    border: 1px solid var(--grey-3);
    border-radius: 40px;
    text-align: center;
    font-size: 14px;
}

/* ============================================================
   ZONE PRODUIT - ACTIONS ET PRIX
============================================================ */
/* Prix et remises */
.product-line-grid-body.price .regular-price {
    font-weight: 800;
    font-size: 12px;
    text-decoration: line-through;
    text-decoration-thickness: 0.07rem;
    opacity: 0.6;
}

/* Ligne produit droite */
.cart-sidebar .product-line-right,
.cart-sidebar .cart-product-line-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: end;
    gap: 10px;
}

.cart-sidebar .cart-product-line-right {
    gap: 15px;
}

/* Actions produit */
.cart-sidebar .product-line-actions {
    justify-content: end;
}

/* ============================================================
   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(--primary);
    color: black;
}

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

.cart-sidebar span.btn.btn-secondary.close {
    background-color: var(--color-white) !important;
    color: var(--color-black) !important;
    border: 1px solid var(--color-black)!important;
    text-shadow: none !important;
}

.cart-sidebar span.btn.btn-secondary.close:hover {
    background-color: var(--color-black) !important;
    color: var(--color-white) !important;
    border-color: var(--color-black) !important;
}

/* 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-light-grey);
    font-size: 10px;
    text-align: center;
    line-height: 1.4em;
}

.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-bottom: 25px;
}

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

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

.shttGamification__grid.gamification-one {
    grid-template-columns: repeat(5, 1fr);
}

.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: var(--primary);
    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(--primary);
}

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

/* 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: 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%);
        border-radius: 30px 30px 0 0;
    }
    
    /* Espacement mobile */
    .cart-sidebar .header {
        padding: 0 20px;
    }
    
    .cart-sidebar .body {
        padding: 0 20px;
    }
    
    .cart-item-opener {
        margin-inline: 12px;
    }
}