/**
 * Jida Market — Page panier custom
 * Fichier : goya-child/assets/css/cart-adhesion.css
 */

/* ════════════════════════════════════════════════════════════
   VARIABLES (cohérentes avec sidecart.css)
   ════════════════════════════════════════════════════════════ */
.jm-cart-page {
    --jmc-green:        #254636;
    --jmc-green-light:  #2e5542;
    --jmc-green-deep:   #1A3026;
    --jmc-green-pale:   #E2EBE5;
    --jmc-orange:       #e8601c;
    --jmc-orange-mid:   #D85A10;
    --jmc-orange-pale:  #FFE8D8;
    --jmc-beige:        #f5efe6;
    --jmc-beige-dark:   #ece4d8;
    --jmc-cream:        #FFFDF8;
    --jmc-sand:         #E8DCC8;
    --jmc-text:         #1F1A14;
    --jmc-text-mid:     #4E3A20;
    --jmc-muted:        #6B6660;
    --jmc-muted-light:  #A8A294;
    --jmc-white:        #ffffff;
    --jmc-savings:      #1A7A4A;
    --jmc-savings-pale: #E2F2EA;
    --jmc-savings-line: #C8E0C8;
    --jmc-shadow:       0 4px 24px rgba(37,70,54,.10);
    --jmc-shadow-sm:    0 2px 10px rgba(37,70,54,.07);
    --jmc-radius:       14px;
    --jmc-radius-sm:    8px;
}

/* Reset défaut WooCommerce sur la page panier */
.woocommerce-cart .woocommerce { background: transparent; }
.woocommerce-cart .cart-empty,
.woocommerce-cart .return-to-shop { display: none; } /* on gère nous-mêmes */

/* ════════════════════════════════════════════════════════════
   LAYOUT GLOBAL
   ════════════════════════════════════════════════════════════ */

.jm-cart-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 24px 60px;
    font-family: inherit;
    color: var(--jmc-text);
    line-height: 1.6;
    font-size: 15px;
}
.jm-cart-page *,
.jm-cart-page *::before,
.jm-cart-page *::after {
    box-sizing: border-box;
}

.jm-cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

/* ════════════════════════════════════════════════════════════
   FIX OVERFLOW WRAPPER GOYA POUR PERMETTRE LE STICKY
   ────────────────────────────────────────────────────────────
   Le theme Goya applique overflow:hidden sur #wrapper.open ce qui
   casse position:sticky de tous ses descendants (cf. spec CSS :
   un ancêtre avec overflow non visible devient le containing block
   du sticky et le contraint à sa hauteur).
   On override uniquement sur la page panier en desktop pour ne
   rien impacter ailleurs sur le site.
   ════════════════════════════════════════════════════════════ */
@media (min-width: 981px) {
    body.woocommerce-cart #wrapper.open {
        overflow: visible;
    }
}

/* ════════════════════════════════════════════════════════════
   DDM PRODUIT
   ════════════════════════════════════════════════════════════ */
.jm-cart-item-ddm {
    font-size: 12px;
    color: var(--jmc-muted-light);
    margin-top: 4px;
    margin-bottom: 4px;
}

/* ════════════════════════════════════════════════════════════
   BANDEAU LIVRAISON
   ════════════════════════════════════════════════════════════ */

.jm-cart-banner {
    background: var(--jmc-savings-pale);
    border: 1px solid var(--jmc-savings-line);
    border-radius: var(--jmc-radius);
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #1A5028;
}
.jm-cart-banner-icon {
    font-size: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.jm-cart-banner-icon svg {
    display: block;
}
.jm-cart-banner-text {
    flex: 1;
}
.jm-cart-banner-text strong {
    font-weight: 700;
}
.jm-cart-banner-text .jm-banner-secondary {
    color: var(--jmc-savings);
    font-weight: 700;
}
.jm-cart-progress {
    width: 100%;
    height: 6px;
    background: #fff;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}
.jm-cart-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--jmc-orange) 0%, var(--jmc-savings) 100%);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Variante : panier au-delà du seuil de livraison gratuite (adhérent uniquement) */
.jm-cart-banner.is-free {
    background: var(--jmc-savings-pale);
}
.jm-cart-banner.is-free .jm-cart-banner-text strong {
    color: var(--jmc-savings);
}

/* ════════════════════════════════════════════════════════════
   COLONNE GAUCHE : ARTICLES
   ════════════════════════════════════════════════════════════ */

.jm-cart-articles {
    /* Wrapper transparent — chaque item est sa propre carte */
    /* Sticky desktop : la colonne articles (courte si peu de produits) reste
       visible pendant qu'on scrolle la colonne droite plus longue.
       En mobile (< 981px), le sticky est annulé dans le media query plus bas. */
    position: sticky;
    top: 90px;
    align-self: start;
}
.jm-cart-articles-header {
    background: var(--jmc-green);
    color: #fff;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--jmc-radius);
    margin-bottom: 12px;
    box-shadow: var(--jmc-shadow-sm);
}
.jm-cart-articles-header .jm-count {
    font-weight: 400;
    opacity: .65;
    font-size: 13px;
    margin-left: 6px;
}

.jm-cart-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--jmc-sand);
    border-radius: var(--jmc-radius);
    margin-bottom: 10px;
    align-items: center;
    transition: all 0.15s ease;
    box-shadow: var(--jmc-shadow-sm);
}
.jm-cart-item:hover {
    border-color: rgba(37, 70, 54, 0.2);
    box-shadow: 0 2px 8px rgba(31, 26, 20, 0.06);
}
.jm-cart-item:last-child {
    margin-bottom: 0;
}

.jm-cart-item-img {
    width: 72px;
    height: 72px;
    background: var(--jmc-beige);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}
.jm-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.jm-cart-item-info {
    min-width: 0;
}
.jm-cart-item-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--jmc-green);
    margin: 0 0 6px;
    text-decoration: none;
}
.jm-cart-item-name:hover {
    color: var(--jmc-orange);
}
.jm-cart-item-meta {
    font-size: 13px;
    color: var(--jmc-muted);
    margin-bottom: 10px;
}

/* Contrôle quantité */
.jm-cart-qty {
    display: inline-flex;
    align-items: center;
    background: var(--jmc-beige);
    border: 1.5px solid var(--jmc-beige-dark);
    border-radius: 6px;
    overflow: hidden;
    height: 32px;
}
.jm-cart-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--jmc-green);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.jm-cart-qty-btn:hover { background: var(--jmc-beige-dark); }
.jm-cart-qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.jm-cart-qty-val {
    min-width: 30px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--jmc-text);
    user-select: none;
}

.jm-cart-item-remove {
    background: transparent;
    border: none;
    color: var(--jmc-muted-light);
    cursor: pointer;
    font-size: 13px;
    margin-left: 12px;
    text-decoration: underline;
    padding: 0;
}
.jm-cart-item-remove:hover {
    color: var(--jmc-orange);
}

/* Prix */
.jm-cart-item-prices {
    text-align: right;
    font-size: 14px;
    line-height: 1.5;
    min-width: 130px;
}
.jm-cart-item-price-standard {
    color: var(--jmc-green);
    font-weight: 700;
    font-size: 17px;
    display: block;
}
.jm-cart-item-price-member {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--jmc-muted);
}
.jm-cart-item-price-member strong {
    color: var(--jmc-orange-mid);
    font-weight: 700;
    font-size: 13.5px;
}

/* Pour adhérent : prix standard barré, prix adhérent mis en avant */
.jm-cart-item-prices.is-member .jm-cart-item-price-standard {
    color: var(--jmc-muted-light);
    text-decoration: line-through;
    font-size: 13px;
    font-weight: 400;
}
.jm-cart-item-prices.is-member .jm-cart-item-price-member {
    margin-top: 2px;
}
.jm-cart-item-prices.is-member .jm-cart-item-price-member strong {
    font-size: 17px;
}

/* ════════════════════════════════════════════════════════════
   COLONNE DROITE : RÉCAP + ADHÉSION
   ════════════════════════════════════════════════════════════ */

.jm-cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ── Récap ─────────────────────────────────────────────── */
.jm-cart-recap {
    background: #fff;
    border: 1px solid var(--jmc-sand);
    border-radius: var(--jmc-radius);
    padding: 24px;
    box-shadow: var(--jmc-shadow-sm);
}
.jm-cart-recap-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--jmc-green);
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--jmc-beige-dark);
}
.jm-cart-recap-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: var(--jmc-muted);
}
.jm-cart-recap-line strong {
    color: var(--jmc-green);
    font-weight: 700;
}
.jm-cart-recap-line.is-free {
    color: var(--jmc-savings);
    font-weight: 700;
}
.jm-cart-recap-line.is-savings {
    color: var(--jmc-savings);
    font-weight: 700;
    background: var(--jmc-savings-pale);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 6px 0;
}
.jm-cart-recap-line.is-savings strong {
    color: var(--jmc-savings);
}
.jm-cart-recap-shipping-note {
    font-size: 12.5px;
    color: var(--jmc-muted-light);
    font-style: italic;
}
.jm-cart-recap-shipping-free {
    color: #1B7F3A;
    font-weight: 700;
    font-size: 14px;
}
.jm-cart-recap-divider {
    height: 1px;
    background: var(--jmc-beige-dark);
    margin: 10px 0;
}
.jm-cart-recap-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 18px;
    font-weight: 700;
    color: var(--jmc-green);
    padding-top: 14px;
    border-top: 2px solid var(--jmc-green);
    margin-top: 6px;
}
.jm-cart-recap-total-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--jmc-orange-mid);
}

/* Bouton "Passer commande" (uniquement adhérent) */
.jm-cart-checkout-btn {
    display: block;
    width: 100%;
    background: var(--jmc-green);
    color: #fff;
    border: none;
    border-radius: var(--jmc-radius-sm);
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 18px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s;
    font-family: inherit;
}
.jm-cart-checkout-btn:hover {
    background: var(--jmc-green-deep);
    color: #fff;
}

/* ── Bloc adhésion (non-adhérent uniquement) ─────────── */
.jm-cart-adhesion {
    background: var(--jmc-green-pale);
    border: 1px solid #B8D4C2;
    border-radius: var(--jmc-radius);
    padding: 22px;
    box-shadow: var(--jmc-shadow-sm);
}
.jm-cart-adhesion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.jm-cart-adhesion-icon {
    width: 32px;
    height: 32px;
    background: var(--jmc-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
}
.jm-cart-adhesion-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--jmc-green);
    line-height: 1.3;
}
.jm-cart-adhesion-pitch {
    font-size: 13.5px;
    color: var(--jmc-muted);
    line-height: 1.6;
    margin: 0 0 14px;
}
.jm-cart-adhesion-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--jmc-green);
    line-height: 1.1;
    margin-bottom: 4px;
}
.jm-cart-adhesion-price-suffix {
    font-size: 13px;
    font-weight: 400;
    color: var(--jmc-muted);
    margin-left: 4px;
}
.jm-cart-adhesion-price-detail {
    font-size: 12px;
    color: var(--jmc-muted);
    margin-bottom: 14px;
}
/* ── Encart économies (intégré au bloc adhésion, sans fond) ── */
.jm-cart-adhesion-savings {
    margin: 4px 0 16px;
    padding: 12px 0;
    border-top: 1px dashed var(--jmc-green-light, rgba(37, 70, 54, 0.2));
    border-bottom: 1px dashed var(--jmc-green-light, rgba(37, 70, 54, 0.2));
}
.jm-cart-adhesion-savings-total {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--jmc-green-deep);
    font-weight: 600;
    line-height: 1.35;
}
.jm-cart-adhesion-savings-total strong {
    color: var(--jmc-orange);
    font-weight: 800;
    font-size: 15px;
}
.jm-cart-adhesion-savings-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Détail (produits + livraison) */
.jm-cart-adhesion-savings-title {
    margin: 10px 0 4px;
    padding-left: 28px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--jmc-green-deep, #1F1A14);
    opacity: 0.7;
}
.jm-cart-adhesion-savings-breakdown {
    list-style: none;
    margin: 0;
    padding: 0 0 0 28px;
}
.jm-cart-adhesion-savings-breakdown li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--jmc-muted, #756B5F);
    padding: 2px 0;
}
.jm-cart-adhesion-savings-breakdown .jm-sav-dot {
    color: var(--jmc-green);
    font-weight: 700;
    flex-shrink: 0;
}
.jm-cart-adhesion-savings-breakdown .jm-sav-label {
    flex: 1;
}
.jm-cart-adhesion-savings-breakdown .jm-sav-value {
    color: var(--jmc-green-deep, #1F1A14);
    font-weight: 700;
    white-space: nowrap;
}

/* ── Boutons CTA et skip ──────────────────────────────── */
.jm-cart-adhesion-cta,
.jm-cart-adhesion-skip {
    display: block;
    width: 100%;
    border-radius: var(--jmc-radius-sm);
    padding: 14px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    line-height: 1.3;
    font-family: inherit;
    text-decoration: none;
}
.jm-cart-adhesion-cta {
    background: var(--jmc-green);
    color: #fff;
    border: 2px solid var(--jmc-green);
    margin-bottom: 10px;
}
.jm-cart-adhesion-cta:hover {
    background: var(--jmc-green-deep);
    border-color: var(--jmc-green-deep);
    color: #fff;
}
.jm-cart-adhesion-cta:disabled {
    opacity: 0.6;
    cursor: wait;
}
.jm-cart-adhesion-skip {
    background: #fff;
    border: 2px solid var(--jmc-green);
    color: var(--jmc-green);
    font-weight: 700;
}
.jm-cart-adhesion-skip:hover {
    background: var(--jmc-green);
    color: #fff;
}

/* ── Bloc économies cumulées (adhérent) ───────────────── */
.jm-cart-cumul {
    background: var(--jmc-green);
    color: #fff;
    border-radius: var(--jmc-radius);
    padding: 20px;
    box-shadow: var(--jmc-shadow-sm);
}
.jm-cart-cumul-title {
    font-size: 12.5px;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.jm-cart-cumul-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--jmc-orange);
    line-height: 1.1;
}
.jm-cart-cumul-since {
    font-size: 12px;
    color: rgba(255,255,255,.6);
    margin-top: 6px;
}
.jm-cart-cumul-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: #fff;
    text-decoration: underline;
    font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   PANIER VIDE
   ════════════════════════════════════════════════════════════ */

.jm-cart-page--empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jm-cart-empty {
    max-width: 580px;
    width: 100%;
    margin: 40px auto;
    text-align: center;
    background: #fff;
    border: 1px solid var(--jmc-sand);
    border-radius: 20px;
    padding: 56px 48px;
    box-shadow: 0 4px 24px rgba(31, 26, 20, 0.06);
    position: relative;
    overflow: hidden;
}

/* Touche décorative : un dégradé subtil en haut */
.jm-cart-empty::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #FE6D18 0%, #254636 50%, #FE6D18 100%);
}

.jm-cart-empty-illustration {
    width: 160px;
    height: 160px;
    margin: 0 auto 24px;
    animation: jm-empty-float 4s ease-in-out infinite;
}
.jm-cart-empty-illustration svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes jm-empty-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.jm-cart-empty-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--jmc-green-deep, #1F1A14);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.jm-cart-empty-text {
    font-size: 15px;
    color: var(--jmc-muted, #756B5F);
    margin: 0 0 32px;
    line-height: 1.6;
}

.jm-cart-empty-ctas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    max-width: 340px;
    margin: 0 auto;
}

.jm-cart-empty-btn {
    display: block;
    width: 100%;
    border-radius: var(--jmc-radius-sm, 10px);
    padding: 15px 24px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s ease;
    box-sizing: border-box;
    line-height: 1.3;
}

.jm-cart-empty-btn--primary {
    background: var(--jmc-green, #254636);
    color: #fff;
    border: 2px solid var(--jmc-green, #254636);
}
.jm-cart-empty-btn--primary:hover {
    background: var(--jmc-green-deep, #1F1A14);
    border-color: var(--jmc-green-deep, #1F1A14);
    color: #fff;
    transform: translateY(-1px);
}

.jm-cart-empty-btn--secondary {
    background: #fff;
    color: var(--jmc-orange, #FE6D18);
    border: 2px solid var(--jmc-orange, #FE6D18);
}
.jm-cart-empty-btn--secondary:hover {
    background: var(--jmc-orange, #FE6D18);
    color: #fff;
}

/* Identité visuelle "Jida Family" */
.jm-family {
    font-weight: 800;
    color: var(--jmc-orange, #FE6D18);
    letter-spacing: 0.005em;
    white-space: nowrap;
}
/* Quand utilisé dans le bouton vert plein, on garde le blanc sur blanc impossible : on bascule sur un orange clair pour rester lisible */
.jm-cart-adhesion-cta .jm-family {
    color: #FFD9C2;
}
/* Sur le bouton skip (fond blanc, texte vert) → orange normal qui ressort bien */
.jm-cart-adhesion-skip .jm-family {
    color: var(--jmc-orange, #FE6D18);
}

/* ════════════════════════════════════════════════════════════
   BLOC RÉASSURANCE
   ════════════════════════════════════════════════════════════ */

.jm-cart-reassurance {
    margin-top: 16px;
    padding: 16px;
    background: #FFFDF8;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(31, 26, 20, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Ligne paiement sécurisé */
.jm-cart-reassurance-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--jmc-green-deep, #1F1A14);
}
.jm-cart-reassurance-secure svg {
    color: #1B7F3A;
    flex-shrink: 0;
}

/* 3 points clés en colonnes */
.jm-cart-reassurance-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.jm-cart-reassurance-points li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}
.jm-rp-icon {
    font-size: 20px;
    line-height: 1;
}
.jm-rp-label {
    font-size: 11px;
    color: var(--jmc-muted, #756B5F);
    line-height: 1.25;
    font-weight: 500;
}

/* Logos paiement (image SVG hébergée) */
.jm-cart-reassurance-payments {
    display: flex;
    justify-content: center;
    align-items: center;
}
.jm-cart-reassurance-payments img {
    max-width: 100%;
    height: auto;
    max-height: 22px;
    width: auto;
    display: block;
    opacity: 0.85;
}

/* Bloc avis (étoiles + note + nombre) */
.jm-cart-reassurance-reviews {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 0;
}
.jm-cart-reassurance-stars {
    display: inline-flex;
    gap: 1px;
}
.jm-rs-star {
    color: rgba(0, 0, 0, 0.12);
    font-size: 14px;
    line-height: 1;
}
.jm-rs-star.is-filled {
    color: #FE6D18;
}
.jm-cart-reassurance-reviews-text {
    font-size: 12.5px;
    color: var(--jmc-green-deep, #1F1A14);
    font-weight: 600;
}
.jm-cart-reassurance-reviews-text strong {
    font-weight: 800;
}
.jm-rs-count {
    color: var(--jmc-muted, #756B5F);
    font-weight: 500;
    margin-left: 2px;
}

/* ════════════════════════════════════════════════════════════
   FEEDBACK ETATS (loading / error)
   ════════════════════════════════════════════════════════════ */

.jm-cart-adhesion-cta.is-loading {
    position: relative;
    color: transparent !important;
}
.jm-cart-adhesion-cta.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jm-cart-spin 0.7s linear infinite;
}
@keyframes jm-cart-spin { to { transform: rotate(360deg); } }

.jm-cart-error {
    background: #FBE5E2;
    color: #931810;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 10px;
    border: 1px solid #F5BFB6;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 980px) {
    .jm-cart-layout {
        grid-template-columns: 1fr;
    }
    .jm-cart-sidebar {
        order: 2;
    }
    .jm-cart-articles {
        position: static; /* annule le sticky du desktop */
        top: auto;
    }
}

@media (max-width: 600px) {
    .jm-cart-page {
        padding: 16px 10px 40px;
    }

    .jm-cart-articles-header {
        padding: 12px 16px;
        font-size: 15px;
    }

    .jm-cart-item {
        grid-template-columns: 60px 1fr;
        gap: 14px;
        padding: 14px 14px;
    }

    .jm-cart-item-img {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }
    .jm-cart-item-prices {
        grid-column: 1 / -1;
        text-align: right;
        border-top: 1px dashed rgba(0, 0, 0, 0.08);
        padding-top: 10px;
        margin-top: 4px;
        min-width: 0;
    }

    .jm-cart-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        border-radius: 12px;
    }
    .jm-cart-empty {
        padding: 40px 24px;
        border-radius: 16px;
    }
    .jm-cart-empty-illustration {
        width: 130px;
        height: 130px;
        margin-bottom: 20px;
    }
    .jm-cart-empty-title {
        font-size: 22px;
    }
    .jm-cart-empty-text {
        font-size: 14px;
        margin-bottom: 24px;
    }
}

/* ════════════════════════════════════════════════════════════
   OVERLAY DE TRANSITION VERS LE CHECKOUT
   ────────────────────────────────────────────────────────────
   Affiché par cart-adhesion.js quand l'utilisateur clique sur
   un bouton qui redirige vers le checkout. Reste visible pendant
   l'AJAX d'ajout/skip adhésion ET le chargement de la page checkout
   (disparaît naturellement avec la navigation).
   ════════════════════════════════════════════════════════════ */
.jm-cart-transition {
    position: fixed;
    inset: 0;
    background: var(--jmc-cream, #FFFDF8);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.jm-cart-transition.is-active {
    display: flex;
    opacity: 1;
}
.jm-cart-transition-content {
    text-align: center;
    padding: 0 24px;
    max-width: 420px;
    animation: jmCartTransitionEnter 0.4s ease;
}
@keyframes jmCartTransitionEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spinner — 3 cercles orange concentriques qui pulsent en cascade */
.jm-cart-transition-loader {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 28px;
}
.jm-cart-transition-loader span {
    position: absolute;
    inset: 0;
    border: 3px solid var(--jmc-orange, #FE6D18);
    border-radius: 50%;
    opacity: 0;
    animation: jmCartLoaderPulse 1.8s linear infinite;
}
.jm-cart-transition-loader span:nth-child(2) {
    animation-delay: 0.6s;
}
.jm-cart-transition-loader span:nth-child(3) {
    animation-delay: 1.2s;
}
@keyframes jmCartLoaderPulse {
    0%   { transform: scale(0.3); opacity: 0; border-width: 4px; }
    25%  { opacity: 1; }
    100% { transform: scale(1); opacity: 0; border-width: 1px; }
}

.jm-cart-transition-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--jmc-green, #254636);
    margin: 0 0 8px;
    line-height: 1.3;
}
.jm-cart-transition-subtitle {
    font-size: 14px;
    color: var(--jmc-muted-light, #8a8a8a);
    line-height: 1.5;
}
/* Dots animés "…" à la fin du sous-titre */
.jm-cart-transition-dots {
    display: inline-block;
    width: 1em;
    text-align: left;
    overflow: hidden;
    vertical-align: bottom;
    animation: jmCartDots 1.4s steps(4) infinite;
}
@keyframes jmCartDots {
    0%   { width: 0; }
    100% { width: 1em; }
}

/* ═══════════════════════════════════════════════════════════
   PAGE PANIER MOBILE — Masquer le footer
   ───────────────────────────────────────────────────────────
   Sur mobile, le footer Goya prend beaucoup de place sous le
   panier et casse le flow panier → checkout. On le masque pour
   garder l'attention sur le bouton "Passer commande".
   Desktop inchangé.
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 980px) {
    body.woocommerce-cart footer,
    body.woocommerce-cart .site-footer,
    body.woocommerce-cart #site-footer,
    body.woocommerce-cart #footer,
    body.woocommerce-cart .et-l--footer,
    body.woocommerce-cart .et_pb_section.et_pb_section_footer {
        display: none !important;
    }
}


/* ── Suppression d'article : feedback visuel ─────────── */
.jm-cart-item {
    transition: opacity 200ms ease;
}

/* Pendant la requête AJAX : voile + spinner */
.jm-cart-item.is-removing {
    position: relative;
    opacity: 0.5;
    pointer-events: none;
}
.jm-cart-item.is-removing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-top-color: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    animation: jm-cart-remove-spin 700ms linear infinite;
    z-index: 2;
}
@keyframes jm-cart-remove-spin {
    to { transform: rotate(360deg); }
}

/* Après succès AJAX : la ligne se replie et disparaît */
.jm-cart-item.is-removed {
    overflow: hidden;
    animation: jm-cart-item-out 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
@keyframes jm-cart-item-out {
    0% {
        opacity: 0.5;
        transform: translateX(0);
    }
    40% {
        opacity: 0;
        transform: translateX(-24px);
    }
    100% {
        opacity: 0;
        height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
        border-width: 0;
        transform: translateX(-24px);
    }
}


/* ── Voile léger affiché pendant le reload ───────────── */
.jm-cart-reload-mask {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jm-cart-reload-mask.is-active {
    opacity: 1;
    pointer-events: auto;
}
.jm-cart-reload-mask-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.12);
    border-top-color: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    animation: jm-cart-remove-spin 700ms linear infinite;
}

/* ── Feedback sur le widget quantité pendant AJAX ────── */
.jm-cart-qty {
    position: relative;
    transition: opacity 200ms ease;
}
.jm-cart-qty.is-updating {
    opacity: 0.55;
    pointer-events: none;
}
.jm-cart-qty.is-updating .jm-cart-qty-val {
    visibility: hidden;
}
.jm-cart-qty.is-updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(0, 0, 0, 0.18);
    border-top-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    animation: jm-cart-remove-spin 700ms linear infinite;
    z-index: 2;
}



@media (max-width: 600px) {
    body.woocommerce-cart .site-content > .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    body.woocommerce-cart .jm-cart-page {
        padding-left: 0;
        padding-right: 0;
    }
}