/* =====================================================================
   DriveOnly — Panier (étape 1 du tunnel)
   Chargé après checkout.css, uniquement sur la page panier (body#cart) :
   cf. templates/layouts/layout-checkout.tpl. Réutilise les variables --co-*.
   ===================================================================== */

/* stepper : étape 1 courante, 2 et 3 à venir */
body#cart .co-step--cart {
    color: var(--co-ink);
}
body#cart .co-step--cart .co-dot {
    background: var(--co-red);
}
body#cart .co-step--cart .co-n {
    display: block;
}
body#cart .co-step--cart .co-ck {
    display: none;
}
body#cart .co-step--cart::after {
    background: var(--co-line);
}
body#cart .co-step--delivery {
    color: #9ca3af;
}
body#cart .co-step--delivery .co-dot {
    background: #d1d5db;
}

/* liste des produits */
body#cart .cart-container {
    margin: 0;
    padding: 4px 20px;
    border: 0;
    border-radius: var(--co-r);
    background: #fff;
    box-shadow: var(--co-shadow);
}
body#cart .cart-overview .cart-items {
    margin: 0;
    padding: 0;
    list-style: none;
}
body#cart .cart-item {
    margin: 0;
    padding: 20px 0;
    border-bottom: 1px solid var(--co-line);
}
body#cart .cart-item:last-child {
    border-bottom: 0;
}
body#cart .cart-overview .no-items {
    display: block;
    padding: 24px 0;
    color: var(--co-muted);
}

body#cart .product-line-grid {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 8px 20px;
    align-items: center;
    margin: 0;
}
body#cart .product-line-grid > .clearfix {
    display: none;
}
body#cart .product-line-grid > [class*="col-"] {
    width: auto;
    max-width: none;
    float: none;
    padding: 0;
}
body#cart .product-line-grid-left .product-image {
    display: block;
    width: 96px;
    height: 96px;
    overflow: hidden;
    border: 1px solid var(--co-line);
    border-radius: 10px;
    background: #fff;
}
body#cart .product-line-grid-left .product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
body#cart .product-line-info {
    margin: 0;
}
body#cart .product-line-info .label_name {
    display: block;
    color: var(--co-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    text-decoration: none;
}
body#cart .product-line-info .label_name:hover {
    text-decoration: underline;
}
body#cart .product-line-grid-body br {
    display: none;
}
body#cart .product-line-grid-body .product-price {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--co-muted);
}
body#cart .product-line-grid-body .product-price .price,
body#cart .product-line-grid-body .product-price .price_red {
    font-size: 13px;
    font-weight: 600;
}
body#cart .product-line-grid-body .regular-price {
    color: #9ca3af;
    text-decoration: line-through;
}
body#cart .product-line-grid-body .product-line-info:not(.product-price) .label,
body#cart .product-line-grid-body .product-line-info:not(.product-price) .value {
    font-size: 12.5px;
    color: var(--co-muted);
}

/* quantité | total ligne | supprimer : on aplatit la grille bootstrap imbriquée */
body#cart .product-line-grid-right {
    display: flex;
    align-items: center;
    gap: 22px;
}
body#cart .product-line-grid-right .row,
body#cart .product-line-grid-right .row > [class*="col-"],
body#cart .product-line-grid-right .row > [class*="col-"] > .row {
    display: contents;
}
body#cart .product-line-grid-right .hidden-md-up {
    display: none;
}
body#cart .product-line-grid-right .qty {
    order: 1;
}
body#cart .product-line-grid-right .price {
    order: 2;
    min-width: 84px;
    text-align: right;
}
body#cart .product-line-grid-right .price strong {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}
body#cart .product-line-grid-right .text-xs-right {
    order: 3;
}

/* sélecteur de quantité (TouchSpin) en − [ n ] + */
body#cart .bootstrap-touchspin {
    display: inline-flex;
    align-items: stretch;
    width: auto;
    height: 42px;
    border: 1.5px solid var(--co-line-strong);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
body#cart .bootstrap-touchspin .input-group-addon {
    display: none !important;
}
body#cart .bootstrap-touchspin input.js-cart-line-product-quantity {
    width: 44px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}
body#cart .bootstrap-touchspin .input-group-btn-vertical {
    display: contents;
}
body#cart .bootstrap-touchspin .btn-touchspin {
    position: static;
    display: block;
    width: 38px;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #f3f4f6;
    color: var(--co-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    box-shadow: none;
}
body#cart .bootstrap-touchspin .btn-touchspin:hover {
    background: var(--co-line);
}
body#cart .bootstrap-touchspin .btn-touchspin i {
    display: none;
}
body#cart .bootstrap-touchspin .bootstrap-touchspin-down {
    order: -1;
}
body#cart .bootstrap-touchspin .bootstrap-touchspin-down::before {
    content: "\2212";
}
body#cart .bootstrap-touchspin .bootstrap-touchspin-up {
    order: 2;
}
body#cart .bootstrap-touchspin .bootstrap-touchspin-up::before {
    content: "+";
}

/* supprimer */
body#cart .cart-line-product-actions .remove-from-cart {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #9ca3af;
    transition: background .15s, color .15s;
}
body#cart .cart-line-product-actions .remove-from-cart:hover {
    background: #fdecee;
    color: var(--co-red);
}
body#cart .cart-line-product-actions .remove-from-cart i {
    float: none;
    margin: 0;
    font-size: 20px;
}

/* récapitulatif */
body#cart .cart-summary {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--co-r);
    background: #fff;
    box-shadow: var(--co-shadow);
}
body#cart .cart-summary hr.separator {
    display: none;
}
body#cart .co-card-title {
    margin: 0;
    padding: 20px 20px 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
}
body#cart .cart-detailed-totals .card-block {
    padding: 12px 20px 4px;
}
/* ligne « livraison » : le hook displayCheckoutSubtotalDetails ajoute un 3e enfant */
body#cart .cart-summary-line {
    flex-wrap: wrap;
}
body#cart .cart-summary-line > div {
    flex: 0 0 100%;
}
body#cart .cart-summary-line > div > small:empty {
    display: none;
}
/* le thème ajoute 30px de padding haut/gauche sur ce bloc : on l'annule pour aligner avec le titre */
body#cart .cart-detailed-totals {
    padding: 0;
}
body#cart .cart-detailed-totals .block-promo {
    padding: 0 20px 4px;
}
body#cart .cart-detailed-totals .cart-total {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--co-line);
}
body#cart .cart-detailed-totals .cart-total .label {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
}
body#cart .cart-detailed-totals .cart-total .value {
    font-size: 22px;
    font-weight: 800;
}
body#cart .cart-detailed-totals .card-block:last-of-type {
    padding-bottom: 12px;
}

/* code promo : champ toujours visible (pas de lien repliable) */
body#cart .cart-voucher .promo-code-button {
    display: none;
}
body#cart .cart-voucher .promo-code {
    display: block !important;
    margin: 0 0 8px;
}
body#cart .cart-voucher .promo-code form {
    display: flex;
    gap: 8px;
}
body#cart .cart-voucher .promo-code input.promo-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--co-line-strong);
    border-radius: 10px;
    font-family: inherit;
}
body#cart .cart-voucher .promo-code .btn {
    min-height: 44px;
    padding: 0 18px;
}
body#cart .cart-voucher .promo-code .alert {
    margin-top: 8px;
}
/* message d'erreur du code promo : caché tant que le JS du noyau ne l'affiche pas */
body#cart .cart-voucher .promo-code .js-error {
    display: none;
}
body#cart .cart-voucher .promo-name {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}
body#cart .cart-voucher .promo-highlighted,
body#cart .cart-voucher .promo-discounts {
    font-size: 12.5px;
    color: var(--co-muted);
}

/* bouton principal */
body#cart .cart-detailed-actions {
    padding: 8px 20px 20px;
}
body#cart .cart-detailed-actions .text-sm-center {
    text-align: center;
}
body#cart .cart-detailed-actions .btn.co-cta,
body#cart .cart-detailed-actions .btn.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    font-size: 16px;
}

/* panier vide */
body#cart .co-empty {
    max-width: 520px;
    margin: 32px auto 8px;
    padding: 40px 24px 36px;
    border-radius: var(--co-r);
    background: #fff;
    box-shadow: var(--co-shadow);
    text-align: center;
}
body#cart .co-empty .co-empty-ico {
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    fill: none;
    stroke: #9ca3af;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
body#cart .co-empty .co-title {
    margin-bottom: 6px;
}
body#cart .co-empty p {
    margin: 0 0 22px;
    color: var(--co-muted);
}
body#cart .co-empty .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
}

@media (max-width: 767px) {
    body#cart .cart-container {
        padding: 2px 14px;
    }
    body#cart .product-line-grid {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 10px 14px;
        align-items: start;
    }
    body#cart .product-line-grid-left .product-image {
        width: 76px;
        height: 76px;
    }
    body#cart .product-line-grid-right {
        grid-column: 1 / -1;
        justify-content: space-between;
        gap: 12px;
    }
    body#cart .product-line-grid-right .price {
        margin-left: auto;
    }
}
