/* ─────────────────────────────────────
   cart-frontend.css — Montote Devis
   Badge panier, modal, boutons panier
   ───────────────────────────────────── */

/* ── BADGE PANIER (sticky bottom-right, desktop + mobile) ── */
.montote-cart-badge {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 58px;
    height: 58px;
    display: none; /* Affiché par JS (display:flex) quand count > 0 */
    align-items: center;
    justify-content: center;
    background: var(--c-cta, #1A3A2F);
    border: 2.5px solid var(--c-gold, #D4A54A);
    border-radius: 999px;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(26, 58, 47, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.montote-cart-badge:hover,
.montote-cart-badge:focus-visible {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(26, 58, 47, 0.45);
    outline: none;
}

.montote-cart-badge__icon {
    position: static;
    width: 26px;
    height: 26px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.montote-cart-badge__icon svg {
    width: 100%;
    height: 100%;
    stroke: #FFFFFF;
}

/* Compteur : pastille dorée en haut à droite du badge */
.montote-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--c-gold, #D4A54A);
    color: var(--c-ink, #0A0A0A);
    border: 2px solid #FFFFFF;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ── MODAL OVERLAY ── */
.montote-cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.55);
    z-index: 9999;
    display: none; /* Affiché par JS */
    align-items: center;
    justify-content: center;
}

.montote-cart-modal[aria-hidden="false"] {
    display: flex;
}

/* ── MODAL CONTENT ── */
.montote-cart-modal__content {
    background: var(--c-surface, #FFFFFF);
    border: 2px solid var(--c-cta, #1A3A2F);
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.montote-cart-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1.5px solid var(--c-border, #0A0A0A);
    background: var(--c-cta, #1A3A2F);
    color: white;
}

.montote-cart-modal__title {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.montote-cart-modal__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.montote-cart-modal__close:hover {
    color: white;
}

.montote-cart-modal__body {
    padding: 16px 20px;
}

/* ── TABLE ITEMS ── */
.montote-cart-modal__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.montote-cart-modal__table thead th {
    font-family: 'Syne', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--c-muted, #8A8580);
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1.5px solid var(--c-border, #0A0A0A);
}

.montote-cart-modal__table tbody td {
    padding: 8px 8px;
    border-bottom: 1px solid var(--c-bsoft, #D8D4CE);
    vertical-align: middle;
}

.montote-cart-modal__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--c-muted, #8A8580);
    font-weight: 600;
    width: 28px;
    text-align: center;
}

.montote-cart-modal__desc {
    font-weight: 500;
    color: var(--c-ink, #0A0A0A);
}

.montote-cart-modal__tech {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--c-soft, #3A3A3A);
}

.montote-cart-modal__qty {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    text-align: center;
}

.montote-cart-modal__price {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--c-cta, #1A3A2F);
    white-space: nowrap;
}

.montote-cart-modal__del {
    width: 32px;
    text-align: center;
}

.montote-cart-modal__btn-del {
    background: none;
    border: 1px solid var(--c-bsoft, #D8D4CE);
    color: var(--c-muted, #8A8580);
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.montote-cart-modal__btn-del:hover {
    border-color: var(--c-err, #C13B37);
    color: var(--c-err, #C13B37);
    background: #fdf2f2;
}

.montote-cart-modal__empty {
    text-align: center;
    padding: 30px 0;
    color: var(--c-muted, #8A8580);
    font-style: italic;
    font-size: 14px;
}

/* ── TOTAL ── */
.montote-cart-modal__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px;
    margin-top: 4px;
    border-top: 2px solid var(--c-cta, #1A3A2F);
}

.montote-cart-modal__total span {
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-soft, #3A3A3A);
}

.montote-cart-modal__total strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--c-cta, #1A3A2F);
}

/* ── ACTIONS ── */
.montote-cart-modal__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--c-bsoft, #D8D4CE);
}

.montote-cart-modal__btn-clear {
    background: none;
    border: 1.5px solid var(--c-bsoft, #D8D4CE);
    padding: 8px 16px;
    font-family: 'Syne', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-muted, #8A8580);
    cursor: pointer;
    transition: all 0.15s;
}

.montote-cart-modal__btn-clear:hover {
    border-color: var(--c-err, #C13B37);
    color: var(--c-err, #C13B37);
}

.montote-cart-modal__btn-proceed {
    background: var(--c-cta, #1A3A2F);
    border: none;
    padding: 10px 20px;
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
}

.montote-cart-modal__btn-proceed:hover {
    background: #142e24;
}

/* ── BOUTONS ÉTAPE 4 (Résumé) ── */
.montote-devis__cart-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.montote-devis__btn-add-cart {
    padding: 12px 24px;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--c-gold, #D4A54A);
    color: var(--c-ink, #0A0A0A);
    border: 2px solid var(--c-gold, #D4A54A);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.15s, border-color 0.15s;
    /* Pulse doux pour attirer l'œil — 1 pulse toutes les 2.4s */
    animation: montote-cart-pulse 2.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(212, 165, 74, 0.55);
    will-change: transform, box-shadow;
}

.montote-devis__btn-add-cart:hover {
    background: #c49940;
    border-color: #c49940;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 14px rgba(212, 165, 74, 0.45);
    animation-play-state: paused;
}

.montote-devis__btn-add-cart:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.06s;
}

/* Pulse : léger scale + halo doré qui s'estompe */
@keyframes montote-cart-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(212, 165, 74, 0.55);
    }
    50% {
        transform: scale(1.035);
        box-shadow: 0 0 0 10px rgba(212, 165, 74, 0);
    }
}

/* Feedback "ajouté !" — à appliquer via JS après clic (classe .is-added) */
.montote-devis__btn-add-cart.is-added {
    animation: montote-cart-bounce 0.5s ease;
}

@keyframes montote-cart-bounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.15); background: #4CAF50; border-color: #4CAF50; color: #fff; }
    60%  { transform: scale(0.96); background: #4CAF50; border-color: #4CAF50; color: #fff; }
    100% { transform: scale(1); }
}

/* Respect de la préférence d'accessibilité "moins d'animations" */
@media (prefers-reduced-motion: reduce) {
    .montote-devis__btn-add-cart,
    .montote-devis__btn-add-cart.is-added {
        animation: none;
    }
}

.montote-devis__btn-proceed {
    padding: 12px 24px;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--c-cta, #1A3A2F);
    color: white;
    border: 2px solid var(--c-cta, #1A3A2F);
    cursor: pointer;
    transition: all 0.15s;
}

.montote-devis__btn-proceed:hover {
    background: #142e24;
    border-color: #142e24;
}

/* ── TOAST NOTIFICATION ── */
.montote-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    background: var(--c-cta, #1A3A2F);
    color: white;
    padding: 12px 20px;
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border-left: 4px solid var(--c-gold, #D4A54A);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(60px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.montote-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

/* ── PRINT : masquer badge + modal ── */
@media print {
    .montote-cart-badge,
    .montote-cart-modal,
    .montote-toast,
    .montote-devis__cart-actions {
        display: none !important;
    }
}

/* ── RESPONSIVE ── */
@media ( max-width: 600px ) {
    .montote-cart-modal__content {
        width: 95%;
        max-height: 90vh;
    }

    .montote-cart-modal__actions {
        flex-direction: column;
    }

    .montote-devis__cart-actions {
        flex-direction: column;
    }

    .montote-cart-badge {
        bottom: 18px;
        right: 18px;
        width: 54px;
        height: 54px;
    }

    .montote-cart-badge__icon {
        width: 24px;
        height: 24px;
    }

    .montote-cart-count {
        min-width: 22px;
        height: 22px;
        font-size: 11px;
        top: -7px;
        right: -7px;
    }
}
