body.modal-open {
    overflow: hidden;
}

#cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#cart-modal {
    background: white;
    border-radius: 10px;
    width: 90vw;
    height: 90vh;
    padding: 0 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
	color: #000;
}

#cart-modal h1 {
    margin: 0;
    padding: 20px 0 10px;
}

#cart-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 12;
}

/* Footer mobile (CTA + total) — masqué par défaut, visible en mobile uniquement. */
#cart-mobile-footer {
    display: none;
}

#cart-close:hover {
    color: #e6494d;
    transform: scale(1.2);
}

/* --- Contenu principal --- */
#cart-content {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 30px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#cart-left {
    flex: 1;
    overflow-y: auto;
    padding-right: 50px;
    border-right: 1px solid #ccc;
}

#cart-right {
    width: 330px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-height: 100%;
    overflow-y: auto;
}

/* Desktop : CTA sticky-top et résumé sticky-bottom dans la colonne droite. */
#cart-right > .cart-actions:first-of-type {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
    padding-top: 10px;
    padding-bottom: 8px;
}

#cart-right > .cart-actions:last-of-type {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #fff;
    margin-top: auto;
    padding-top: 8px;
    padding-bottom: 10px;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.05);
}

#cart-right .cart-title {
    display: flex;
    justify-content: flex-end;
    font-size: 1.8em;
    margin: 0 0 20px 0;
    font-weight: bold;
}

/* --- Items Panier --- */
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 15px 0 0 10px;
    padding: 16px 20px;
    background-color: #f4efef;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Bandeau d'avertissement stock — en pied de la cart-item, pleine largeur. */
.cart-item-stock-warning {
    flex-basis: 100%;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
}

.cart-item.is-stock-warning .cart-item-stock-warning,
.cart-item.is-stock-rupture .cart-item-stock-warning {
    display: flex;
    flex-wrap: wrap;
}

.cart-item.is-stock-warning .cart-item-stock-warning {
    background: #fff4e0;
    border: 1px solid #ffd28a;
    color: #6b3a00;
}

.cart-item.is-stock-rupture .cart-item-stock-warning {
    background: #fde8e8;
    border: 1px solid #f6b1b1;
    color: #6b1414;
}

.cart-item.is-stock-warning,
.cart-item.is-stock-rupture {
    background-color: #faf6f0;
}

.cart-item.is-stock-rupture .cart-item-info,
.cart-item.is-stock-rupture .cart-price-qty-container .cart-price {
    opacity: 0.55;
}

.cart-item-stock-warning .warning-text {
    flex: 1 1 auto;
    min-width: 200px;
}

.cart-item-stock-warning .warning-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cart-item-stock-warning .warning-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.cart-item-info img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 3px;
    flex-shrink: 0;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 6px;
}

.cart-item-garbage {
    margin-top: 10px;
    cursor: pointer;
}

.cart-item-garbage img {
    width: 18px;
    height: 18px;
    background: none;
}

.cart-item-garbage img:hover {
    transform: translateY(-.1px) scale(1.1);
}

.cart-price-qty-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 150px;
}

.cart-qty-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-price {
    display: flex;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    white-space: nowrap;
    margin: 0 0 10px 10px;
    width: 100%;
}
.cart-price-off {
    text-decoration: line-through;
    margin-right: 20px;
    color: blueviolet;
    font-weight: 400;
}

.cart-item-ref        {
    font-size: 12px;
    color: #888;
}
.cart-item-unit-price {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.cart-item-qty {
    font-size: 0.85em;
    color: #555;
}

.cart-item-qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 6px;
}

.cart-qty-btn{
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 999px;
    text-align: center;
    padding: 0;
    line-height: 1;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    cursor: pointer;
    font-size: 18px;
    transition: transform .12s ease;
}

#cart-summary {
    display: flex;
    flex-direction: column;
    align-items: end;
    font-size: 16px;
    line-height: 1.5em;
    margin: 4px 0 5px 0;
}

.cart-summary div strong {
    font-size: 18px;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-actions .btn-check {
    background: var(--primary-yellow);
    color: black;
    padding: 10px 17px 14px 14px;
    font-weight: bold;
    border-radius: 25px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.cart-actions .btn-check:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.cart-actions .btn-check:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cart-actions .btn-check img {
    position: relative;
    top: 4px;
    width: 20px;
    height: 20px;
}

.cart-actions .btn-quote {
    position: relative;
    right: 5px;
    display: flex;
    justify-content: center;
    color: black;
    width: 80%;
    padding: 14px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cart-actions .btn-quote img {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.cart-actions .btn-quote:hover {
    text-decoration: underline;
}

.cart-actions .btn-quote:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cart-actions-first {
    margin-bottom: 20px;
}

.date-range {
    background: #f4fbf9;
    border: 1px solid #d9f0e9;
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.date-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.date-title img {
    width: 18px;
    height: 18px;
    position: relative;
    top: 2px;
}

#cart-calendar-container {
    margin: 8px auto 0;
}

.cart-actions-second {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* --- Transport --- */
.transport-options {
    margin-top: 40px;
    padding-top: 20px;
}

.transport-options label input {
    margin-bottom: 20px;
    cursor: pointer;
}

.transport-options h3 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
}

.category-title {
    font-weight: bold;
    font-size: 1em;
    border-bottom: 1px solid #aaa;
    padding: 20px 0 10px 0;
    text-transform: uppercase;
    color: #222;
}

.cart-actions-third {
    display: flex;
    width: 100%;
    justify-content: center;
}

/* --- Animation suppression item --- */
.cart-item-remove {
    animation: fadeOutSlideUp 0.8s ease forwards;
}

/*-- Panier vide --*/
#cart-left.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-weight: 700;
    color: #222;
    font-size: clamp(20px, 2.6vw, 28px);
    letter-spacing: 0.2px;
    text-align: center;
    animation: cartEmptyPop 240ms ease-out;
    user-select: none;
}

#cart-modal.is-empty #cart-right {
    display: none;
}

/* Petite animation d'apparition, douce */
@keyframes cartEmptyPop {
    from { opacity: 0; transform: translateY(6px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}


@keyframes fadeOutSlideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
        height: auto;
        margin: 15px 0;
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 960px) {
    #cart-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }

    /* Header sticky-top : titre + bouton de fermeture restent accessibles. */
    #cart-modal h1 {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        margin: 0 -20px;
        padding: 14px 50px 12px 20px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    #cart-close {
        position: fixed;
        top: 12px;
        right: 14px;
    }

    /* place pour le footer mobile fixe — appliqué au contenu, pas au modal */
    #cart-content {
        flex-direction: column;
        overflow-y: auto;
        padding-bottom: 88px;
    }

    #cart-left {
        flex: none;
        padding-right: 0;
        border-right: none;
        overflow-y: visible;
    }

    #cart-right {
        width: 100%;
        flex-shrink: 1;
        overflow-y: visible;
    }

    /* Sur mobile, on remet les sticky desktop en flux normal. */
    #cart-right > .cart-actions:first-of-type,
    #cart-right > .cart-actions:last-of-type {
        position: static;
        box-shadow: none;
    }

    /* Le CTA principal du panneau droit est masqué : remplacé par le footer mobile. */
    #cart-right #cart-submit {
        display: none;
    }

    .cart-item {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
        margin: 10px 0 0 0;
    }

    .cart-item-info img {
        width: 60px;
        height: 60px;
    }

    .cart-price-qty-container {
        width: auto;
    }

    /* Footer mobile : barre fixe avec total + CTA "Passer commande". */
    #cart-mobile-footer {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        background: #fff;
        padding: 10px 16px;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
    }

    #cart-mobile-total {
        font-size: 14px;
        line-height: 1.2;
        color: #333;
    }

    #cart-mobile-total .ttc-amount {
        display: block;
        font-size: 16px;
        font-weight: 700;
        color: #111;
    }

    #cart-submit-mobile {
        flex-shrink: 0;
    }
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top: 2px solid #000;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}



#cart-summary div {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 14px;
	color: #555;
	margin-bottom: 6px;
}

#cart-summary strong {
	font-weight: 600;
	color: #111;
	margin-left:15px;
}

#cart-summary div:last-child {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
	font-weight: 700;
	font-size: 16px;
	color: #000;
}

#cart-summary div:last-child strong {
	color: #16a34a; 
	margin-left:15px;
}


.cart-actions-zero	input, .cart-actions-zero	select	{
	width:90%;
	height:40px;
	border-radius:5px;
	border:1px solid grey;							
}
.utils-range	{							
	box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 6px;
	background: rgb(244, 251, 249);
	border-width: 1px;
	border-style: solid;
	border-color: rgb(217, 240, 233);
	border-image: initial;
	border-radius: 16px;
	padding: 14px;
}
.utils-title	{
	font-weight: 600;
	margin: 10px 0px 5px
}


#cart-modal h1 {
	font-size: 1.9em;
    color: #2b3c5f;
	border-bottom: 1px solid #e5e7eb;
}





.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
	margin-bottom:25px;
}

/* ===== Boutons ===== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn img {
    width: 16px;
    height: 16px;
}

/* CTA principal */
.btn.primary {
    background: #facc15;
    color: #000;
    font-weight: 600;
}

.btn.primary:hover {
    background: #eab308;
}

/* secondaire */
.btn.secondary {
    background: #f1f5f9;
    color: #111;
}

.btn.secondary:hover {
    background: #e2e8f0;
}

/* danger */
.btn.danger {
    background: #fee2e2;
    color: #991b1b;
}

.btn.danger:hover {
    background: #fecaca;
}

/* ===== Groupes ===== */
.action-group {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* bouton toggle */
.action-toggle {
    width: 100%;
    text-align: left;
    padding: 12px;
    background: #fff;
    border: none;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

/* petite flèche */
.action-toggle::after {
    content: "▾";
    position: absolute;
    right: 12px;
    transition: transform 0.2s;
}

/* contenu caché */
.action-content {
    display: none;
    padding: 10px;
    background: #f9fafb;
    flex-direction: column;
    gap: 8px;
}

/* état ouvert */
.action-group.open .action-content {
    display: flex;
}

.action-group.open .action-toggle::after {
    transform: rotate(180deg);
}/* ===== FORM ===== */
.action-content.form {
    gap: 14px;
}

/* groupe champ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* label */
.form-group label {
    font-size: 12px;
    color: #6b7280;
}

/* inputs + select */
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
}

/* focus propre */
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #facc15;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

/* hover léger */
.form-group input:hover,
.form-group select:hover {
    border-color: #d1d5db;
}

/* ===== SETTINGS INLINE ===== */
.cart-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* ligne */
.setting-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* label */
.setting-row label {
    font-size: 12px;
    color: #6b7280;
}

/* champs */
.setting-row select,
.setting-row input {
    width: 80%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
}

/* focus UX */
.setting-row select:focus,
.setting-row input:focus {
    outline: none;
    border-color: #facc15;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

/* hover */
.setting-row select:hover,
.setting-row input:hover {
    border-color: #d1d5db;
}

.cart-item-parent {
    flex-wrap: wrap;
}

.cart-subitems {
    width: 100%;
    margin: 10px 0 0 74px;
    padding-left: 14px;
    border-left: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-subitem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 10px;
    background: rgba(255,255,255,.65);
    border: 1px solid #edf0f4;
    border-radius: 10px;
}

.cart-subitem .cart-item-info img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.cart-subitem .cart-item-name {
    font-size: 13px;
    font-weight: 600;
}

.cart-subitem .cart-item-ref,
.cart-subitem .cart-item-unit-price {
    font-size: 11px;
    color: #6b7280;
}

.cart-subitem-price-container {
    flex: 0 0 auto;
}

.cart-subitem-price {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* bloc droite prix + qty */
.cart-price-qty-container {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
    flex-shrink: 0;
}

/* qty + stock sur une ligne */
.cart-price-qty-container .qty {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

/* stock inline */
.cart-price-qty-container .stock-data {
    white-space: nowrap;
    flex-shrink: 0;
}

/* recentrage vertical poubelle */
.cart-item-garbage {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin-left: 26px;
    flex-shrink: 0;
}

/* évite les retours ligne moches */
.cart-item {
    align-items: center;
}

/* responsive */
@media (max-width: 900px) {

    .cart-price-qty-container {
        gap: 10px;
    }

    .cart-item-garbage {
        margin-left: 12px;
    }

    .cart-price-qty-container .qty {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

@media (max-width: 500px) {

    #cart-modal {
        width: 100vw;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
        padding: 14px 10px 82px;
    }

    #cart-content {
        display: block !important;
    }

    #cart-left {
        width: 100%;
        padding: 0;
    }

    #cart-right {
        display: none;
    }

    #cart-items {
        padding: 0;
        overflow-x: hidden;
    }

    .cart-item {
        position: relative;
        display: grid;
        grid-template-columns: 58px 1fr;
        gap: 12px;
        padding: 14px;
        align-items: start;
    }

    .cart-item-info {
        display: contents;
    }

    .cart-item-info > img {
        grid-column: 1;
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

    .cart-item-info > div {
        grid-column: 2;
        min-width: 0;
    }

    .cart-item-name {
        font-size: 15px;
        line-height: 1.15;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .cart-item-ref,
    .cart-item-unit-price {
        font-size: 11px;
    }

    .cart-price-qty-container {
        grid-column: 1 / -1;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin: 8px 0 0;
    }

    .cart-price {
        font-size: 15px;
        white-space: nowrap;
    }

    .cart-price-qty-container .qty {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        margin-left: auto;
    }

    .qty-container {
        flex-shrink: 0;
    }

    .stock-data {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 12px;
    }

    .cart-item-garbage {
        position: absolute;
        right: 14px;
        top: 58px;
        margin: 0;
        width: 24px;
        height: 24px;
    }

    .cart-item-garbage img {
        width: 15px;
        height: 15px;
    }

    .cart-subitems {
        grid-column: 1 / -1;
        width: auto;
        margin: 12px 0 0 28px;
        padding-left: 10px;
    }

    .cart-subitem {
        display: grid;
        grid-template-columns: 44px 1fr auto;
        gap: 10px;
        align-items: center;
        padding: 10px;
    }

    .cart-subitem .cart-item-info {
        display: contents;
    }

    .cart-subitem .cart-item-info > img {
        grid-column: 1;
        width: 36px;
        height: 36px;
    }

    .cart-subitem .cart-item-info > div {
        grid-column: 2;
        min-width: 0;
    }

    .cart-subitem .cart-item-name {
        font-size: 13px;
        line-height: 1.15;
    }

    .cart-subitem-price-container {
        grid-column: 3;
        margin: 0;
    }

    .cart-subitem-price {
        font-size: 12px;
        white-space: nowrap;
    }

    #cart-mobile-footer {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
    }
}