/* Drawer Cart Etoilium — off-canvas panier optimisé conversion */

.edc {
    --edc-violet: #676EB2;
    --edc-text: #7371B4;
    --edc-violet-light: #7B82C8;
    --edc-bg: #F5F5FA;
    --edc-orange: #F39200;
    --edc-border: #E8E9F2;
    --edc-title-font: 'jaf-domus-titling-web', 'Nunito', sans-serif;
    --edc-ease: cubic-bezier(0.22, 1, 0.36, 1);
    color: var(--edc-text);
    font-family: 'Nunito', sans-serif;
}

/* RESET complet de tous les boutons du drawer : aucun style
   Elementor/natif ne peut passer (spécificité 0-3-0) */
.edc .edc-panel button {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    text-shadow: none;
    outline: none;
    transform: none;
    transition: none;
    color: inherit;
    font-family: 'Nunito', sans-serif;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* États : on ne neutralise que la typo — les couleurs/fonds/transforms
   sont gérés par les règles spécifiques de chaque bouton (0-4-x) */
.edc .edc-panel button:hover,
.edc .edc-panel button:focus,
.edc .edc-panel button:focus-visible,
.edc .edc-panel button:active {
    font-family: 'Nunito', sans-serif;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
}

.edc input,
.edc select,
.edc textarea {
    font-family: 'Nunito', sans-serif;
}

/* Garde-fou : nos display ne doivent jamais annuler l'attribut hidden */
.edc [hidden] {
    display: none !important;
}

/* ---------- Overlay ---------- */

.edc-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    visibility: hidden;
    pointer-events: none;
    /* visibility ne bascule qu'après la transition de sortie du panel */
    transition: visibility 0s linear 0.65s;
}

.edc-overlay.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.edc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 20, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.5s var(--edc-ease);
}

.edc-overlay.is-open .edc-backdrop {
    opacity: 1;
}

/* ---------- Panel ---------- */

.edc-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(430px, 100%);
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(10, 8, 20, 0.18);
    transform: translateX(100%);
    transition: transform 0.6s var(--edc-ease);
    will-change: transform;
}

.edc-overlay.is-open .edc-panel {
    transform: translateX(0);
}

/* ---------- Header ---------- */

.edc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px 16px;
    border-bottom: 1px solid var(--edc-border);
    flex: none;
}

.edc-header-title {
    font-family: var(--edc-title-font);
    font-size: 19px;
    font-weight: 700;
    color: var(--edc-text);
}

.edc-header-title em {
    font-style: normal;
    color: var(--edc-violet);
}

.edc .edc-panel .edc-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: var(--edc-bg);
    color: var(--edc-text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.3s, transform 0.3s var(--edc-ease);
}

.edc .edc-panel .edc-close:hover,
.edc .edc-panel .edc-close:focus {
    background: var(--edc-border);
    color: var(--edc-text);
    transform: rotate(90deg);
    box-shadow: none;
}

/* ---------- Livraison offerte ---------- */

.edc-ship {
    padding: 16px 30px;
    background: var(--edc-bg);
    border-bottom: 1px solid var(--edc-border);
    flex: none;
}

.edc-ship-text {
    font-size: 13px;
    color: var(--edc-text);
    margin-bottom: 9px;
}

.edc-ship-text strong {
    color: var(--edc-violet);
}

.edc-ship-bar {
    height: 8px;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}

.edc-ship-fill {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--edc-violet-light), var(--edc-violet));
    position: relative;
    transition: width 0.8s var(--edc-ease);
}

.edc-ship-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    animation: edc-shine 2.2s infinite;
}

@keyframes edc-shine {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

.edc-ship.is-complete .edc-ship-fill {
    background: linear-gradient(90deg, #6FCF7B, #3D8B4F);
}

/* ---------- Zone scrollable ---------- */

.edc-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.edc-items {
    padding: 8px 30px;
    transition: opacity 0.25s ease;
}

.edc.is-loading .edc-items,
.edc.is-loading .edc-cross {
    opacity: 0.45;
    pointer-events: none;
}

/* ---------- Empty state ---------- */

.edc-empty {
    padding: 60px 30px;
    text-align: center;
}

.edc-empty-text {
    font-size: 15px;
    color: var(--edc-text);
    margin-bottom: 16px;
}

.edc .edc-empty-cta,
.edc .edc-empty-cta:hover,
.edc .edc-empty-cta:focus {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 24px;
    background: var(--edc-violet);
    color: #fff !important;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    box-shadow: none;
}

/* ---------- Items ---------- */

.edc-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--edc-border);
    animation: edc-item-in 0.5s var(--edc-ease) both;
}

@keyframes edc-item-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}

.edc .edc-item-thumb {
    flex: none;
    text-decoration: none;
}

.edc-item-thumb img,
.edc-item-img {
    width: 92px;
    height: 92px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--edc-bg);
    display: block;
}

.edc-item-body {
    flex: 1;
    min-width: 0;
}

.edc .edc-item-name,
.edc .edc-item-name:hover,
.edc .edc-item-name:focus {
    display: block;
    font-family: var(--edc-title-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--edc-text) !important;
    line-height: 1.3;
    margin-bottom: 4px;
    text-transform: uppercase;
    text-decoration: none;
    border: 0;
    box-shadow: none;
    background: none;
}

.edc-item-meta dl {
    margin: 0 0 6px;
    font-size: 11.5px;
    color: var(--edc-text);
    opacity: 0.75;
}

.edc-item-meta dt,
.edc-item-meta dd {
    display: inline;
    margin: 0;
}

.edc-item-meta dd {
    margin-right: 6px;
}

.edc-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edc-qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--edc-border);
    border-radius: 20px;
    overflow: hidden;
}

.edc .edc-panel .edc-qty-btn {
    width: 28px;
    height: 28px;
    border: 0;
    background: none;
    font-size: 15px;
    color: var(--edc-violet);
    cursor: pointer;
    font-weight: 800;
    padding: 0;
    line-height: 1;
    transition: background 0.2s ease, transform 0.15s ease;
}

.edc .edc-panel .edc-qty-btn:hover {
    background: var(--edc-bg);
    color: var(--edc-violet);
    box-shadow: none;
}

.edc .edc-panel .edc-qty-btn:active {
    transform: scale(0.85);
}

.edc-qty-val {
    min-width: 26px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--edc-text);
}

.edc-item-price {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--edc-text);
}

.edc .edc-panel .edc-item-rm {
    border: 0;
    background: none;
    color: var(--edc-text);
    opacity: 0.7;
    font-size: 11.5px;
    cursor: pointer;
    margin-top: 6px;
    padding: 0;
    text-decoration: underline;
}

.edc .edc-panel .edc-item-rm:hover {
    color: #EE2A7B;
    opacity: 1;
    background: none;
    box-shadow: none;
}

/* ---------- Cross-sell ---------- */

.edc-cross {
    padding: 14px 30px 6px;
    border-bottom: 1px solid var(--edc-border);
    transition: opacity 0.25s ease;
}

.edc-cross:empty {
    display: none;
}

.edc-cross-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--edc-text);
    opacity: 0.75;
    margin-bottom: 10px;
}

.edc-cross-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.edc-cross-scroll::-webkit-scrollbar {
    display: none;
}

.edc-xs {
    flex: 0 0 132px;
    border: 1.5px solid var(--edc-border);
    border-radius: 14px;
    padding: 8px;
    text-align: center;
    scroll-snap-align: start;
}

.edc-xs-img {
    display: block;
}

.edc-xs-img img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 9px;
    background: var(--edc-bg);
    display: block;
}

.edc-xs-name {
    font-family: var(--edc-title-font);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--edc-text);
    margin: 7px 0 3px;
    line-height: 1.25;
    min-height: 28px;
}

.edc-xs-price {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--edc-violet);
    margin-bottom: 7px;
}

.edc .edc-panel .edc-xs-add {
    display: block;
    width: 100%;
    padding: 7px 0;
    border: 0;
    border-radius: 16px;
    background: var(--edc-bg);
    color: var(--edc-violet);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.edc .edc-panel .edc-xs-add:hover,
.edc .edc-panel .edc-xs-add:focus {
    background: var(--edc-violet);
    color: #fff;
    box-shadow: none;
}

.edc .edc-panel .edc-xs-add.is-added {
    background: #3D8B4F;
    color: #fff;
}

/* ---------- Coupon ---------- */

.edc-coupon {
    padding: 12px 30px;
    flex: none;
}

.edc .edc-panel .edc-coupon-toggle {
    border: 0;
    background: none;
    color: var(--edc-violet);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
    text-transform: none;
    transition: color 0.3s ease, transform 0.3s var(--edc-ease);
}

.edc .edc-panel .edc-coupon-toggle:hover,
.edc .edc-panel .edc-coupon-toggle:focus {
    background: none;
    color: var(--edc-violet-light);
    text-decoration: none;
    box-shadow: none;
}

.edc-coupon-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.edc-coupon-chips:empty {
    margin: 0;
}

.edc-coupon-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 14px;
    background: #F2F9F1;
    color: #3D8B4F;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.edc .edc-panel .edc-coupon-chip button,
.edc .edc-panel .edc-coupon-chip button:hover,
.edc .edc-panel .edc-coupon-chip button:focus {
    border: 0;
    background: none;
    color: inherit;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

.edc-coupon-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.edc .edc-panel .edc-coupon-form input {
    flex: 1;
    border: 1.5px solid var(--edc-border) !important;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    color: var(--edc-text);
    background: #fff;
    box-shadow: none;
}

.edc-coupon-form input:focus {
    border-color: var(--edc-violet) !important;
}

.edc .edc-panel .edc-coupon-form button,
.edc .edc-panel .edc-coupon-form button:hover,
.edc .edc-panel .edc-coupon-form button:focus,
.edc .edc-panel .edc-coupon-form button:active {
    padding: 10px 18px;
    border: 0;
    border-radius: 10px;
    background: var(--edc-violet);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
    outline: none;
}

.edc .edc-panel .edc-coupon-form button:hover {
    background: var(--edc-violet-light);
    color: #fff;
}

.edc-coupon-msg {
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 700;
}

.edc-coupon-msg.is-ok { color: #3D8B4F; }
.edc-coupon-msg.is-error { color: #EE2A7B; }
.edc-coupon-msg:empty { margin: 0; }

/* ---------- Footer ---------- */

.edc-footer {
    padding: 16px 30px 20px;
    border-top: 1px solid var(--edc-border);
    background: #fff;
    flex: none;
}

.edc-totals > div {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--edc-text);
    padding: 3px 0;
}

.edc-totals .edc-muted {
    opacity: 0.7;
    font-size: 12.5px;
}

.edc-totals .edc-discount span:last-child {
    color: #3D8B4F;
    font-weight: 800;
}

.edc-grand {
    font-size: 20px;
    font-weight: 800;
    color: var(--edc-text);
    margin-top: 8px;
}

.edc-grand span:last-child {
    color: var(--edc-violet);
}

.edc .edc-cta {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 16px;
    border: 0;
    border-radius: 14px;
    background: var(--edc-orange) !important;
    color: #fff !important;
    font-family: var(--edc-title-font);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(243, 146, 0, 0.4);
    transition: transform 0.3s var(--edc-ease), box-shadow 0.3s;
    box-sizing: border-box;
}

.edc .edc-cta:hover,
.edc .edc-cta:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(243, 146, 0, 0.5);
    color: #fff !important;
}

.edc .edc-cart-link,
.edc .edc-cart-link:hover,
.edc .edc-cart-link:focus {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--edc-text);
    text-decoration: underline;
    box-shadow: none;
    transition: color 0.3s ease;
}

.edc .edc-cart-link:hover {
    color: var(--edc-violet);
}

/* Réassurance conditionnelle (produit 4807 dans le panier) */
.edc-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #F2F9F1;
    color: #3D8B4F;
    font-size: 12.5px;
    font-weight: 700;
}


/* ---------- Icône panier + badge compteur ---------- */

/* Double classe : l'icône vit hors de .edc-panel (header), il faut
   dépasser les styles globaux Elementor sur button et ses états */
.edc-icon.edc-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    text-shadow: none;
    outline: none;
    color: inherit;
    font-family: 'Nunito', sans-serif;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s var(--edc-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.edc-icon.edc-icon:hover,
.edc-icon.edc-icon:focus,
.edc-icon.edc-icon:focus-visible,
.edc-icon.edc-icon:active {
    padding: 0;
    margin: 0;
    border: 0;
    border-color: transparent;
    border-radius: 0;
    background: none;
    background-color: transparent;
    box-shadow: none;
    text-shadow: none;
    outline: none;
    color: inherit;
    text-decoration: none;
    transform: scale(1.08);
}

.edc-icon.edc-icon:focus-visible {
    outline: 2px solid var(--edc-violet, #676EB2);
    outline-offset: 3px;
    border-radius: 6px;
}

.edc-icon-img {
    display: block;
    width: 30px;
    height: auto;
}

.edc-icon-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8E9F2;
    color: #7371B4;
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
    pointer-events: none;
    box-sizing: border-box;
}

.edc-icon-badge.is-bump {
    animation: edc-badge-bump 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes edc-badge-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Scroll lock */
html.edc-lock,
html.edc-lock body {
    overflow: hidden;
}

/* Accessibilité : réduit les animations si demandé */
@media (prefers-reduced-motion: reduce) {
    .edc-backdrop,
    .edc-panel,
    .edc-item,
    .edc-close,
    .edc-cta,
    .edc-ship-fill {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}



/* ---------- Mobile ---------- */

@media (max-width: 480px) {
    .edc-panel {
        width: 100%;
    }

    .edc-icon-img {
        width: 22px;
    }

    .edc-icon-badge {
        top: -6px;
        right: -8px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        font-size: 10px;
    }

    /* Paddings latéraux plus resserrés sur mobile */
    .edc-header,
    .edc-ship,
    .edc-items,
    .edc-empty,
    .edc-cross,
    .edc-coupon,
    .edc-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .edc-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
}
