/* Commerce bridge — favoris, panier, toasts, modale auth */
:root {
    --ci-brand-red: #D90429;
    --ci-brand-dark: #1b1b1b;
    --ci-brand-grey: #333333;
    --ci-card-btn-h: 44px;
}

/* ── Cœur favoris ── */
.ci-fav-heart {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 24;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
    transition: transform 0.15s ease, color 0.15s ease;
    pointer-events: auto;
}

.gpc-image-container .ci-fav-heart,
.promo-image-container .ci-fav-heart {
    top: 8px;
    left: 8px;
    z-index: 24;
}

.ci-fav-heart:hover {
    transform: scale(1.1);
    background: transparent;
}

.ci-fav-heart.is-active,
.ci-fav-heart.is-active i {
    color: var(--ci-brand-red);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

/* ── Actions carte ── */
.ci-card-actions {
    margin-top: auto;
    width: 100%;
}

.ci-card-actions--secondary {
    margin-top: 8px;
}

.ci-card-actions--buy {
    margin-top: 8px;
    width: 100%;
}

.ci-btn-acheter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--ci-card-btn-h);
    height: var(--ci-card-btn-h);
    padding: 0 12px;
    background: #fff;
    color: var(--ci-brand-dark);
    border: 2px solid #b8bcc4;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ci-btn-acheter:hover {
    border-color: var(--ci-brand-grey);
    background: #f9fafb;
    color: var(--ci-brand-dark);
}

.ci-card-actions > .ci-btn-acheter {
    margin-top: 8px;
}

.ci-card-actions-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.ci-card-actions-row--cart .ci-btn-cart {
    width: 100%;
}

.ci-card-actions-row--secondary .ci-btn-paypal {
    flex: 1 1 0;
    min-width: 0;
    margin-top: 0;
    height: var(--ci-card-btn-h);
    min-height: var(--ci-card-btn-h);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ci-card-actions-row--secondary .ci-btn-paypal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ci-card-actions-row--secondary .ci-btn-view {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    height: var(--ci-card-btn-h);
    min-height: var(--ci-card-btn-h);
}

.ci-btn-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--ci-card-btn-h);
    height: var(--ci-card-btn-h);
    padding: 0 10px;
    background: var(--ci-brand-red);
    color: #fff;
    border: 2px solid var(--ci-brand-red);
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    min-width: 0;
    box-sizing: border-box;
}

.ci-btn-cart span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ci-btn-cart:hover {
    background: #fff;
    color: var(--ci-brand-red);
}

.ci-btn-cart svg path {
    fill: currentColor;
}

.ci-btn-cart--inline {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 9rem);
    font-size: 0.78rem;
}

.gpc-checkout-actions .ci-cart-icon-btn {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    height: var(--ci-card-btn-h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--ci-brand-red);
    border-radius: 6px;
    background: var(--ci-brand-red);
    color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

/* Icône panier sur l'image (coin bas-droit) */
.ci-cart-icon-btn--image {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 24;
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--ci-brand-red);
    border-radius: 4px;
    background: var(--ci-brand-red);
    color: #fff;
    cursor: pointer;
    box-sizing: border-box;
    overflow: visible;
    pointer-events: auto;
    transition: background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.ci-cart-icon-btn--image svg,
.ci-cart-icon-btn--image .ci-cart-icon-svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ci-cart-icon-btn--image svg path {
    fill: currentColor;
}

.ci-cart-icon-btn--image:hover,
.ci-cart-icon-btn--image:active,
.ci-cart-icon-btn--image:focus-visible {
    background: var(--ci-brand-red);
    border-color: var(--ci-brand-red);
    color: #fff;
    filter: brightness(0.88);
    transform: none;
}

.ci-cart-icon-btn--image:hover svg,
.ci-cart-icon-btn--image:active svg,
.ci-cart-icon-btn--image:focus-visible svg {
    transform: none;
}

.ci-cart-icon-btn--image .ci-cart-icon-btn__tip {
    position: absolute;
    left: auto;
    right: 0;
    bottom: calc(100% + 10px);
    transform: translateY(4px);
    background: var(--ci-brand-dark);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 40;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.ci-cart-icon-btn--image .ci-cart-icon-btn__tip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    left: auto;
    transform: none;
    border: 5px solid transparent;
    border-top-color: var(--ci-brand-dark);
}

.ci-cart-icon-btn--image:hover .ci-cart-icon-btn__tip,
.ci-cart-icon-btn--image:focus-visible .ci-cart-icon-btn__tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/** @deprecated — ancien emplacement ligne livraison */
.ci-cart-icon-btn--shipping {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: 1px;
    margin-left: auto;
    border: 2px solid var(--ci-brand-red);
    border-radius: 4px;
    background: #fff;
    color: var(--ci-brand-red);
    cursor: pointer;
    box-sizing: border-box;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ci-cart-icon-btn--shipping svg {
    width: 18px;
    height: 18px;
    display: block;
    transition: transform 0.15s ease, color 0.2s ease;
}

.ci-cart-icon-btn--shipping svg path {
    fill: currentColor;
}

.ci-cart-icon-btn--shipping:hover,
.ci-cart-icon-btn--shipping:active,
.ci-cart-icon-btn--shipping:focus-visible {
    border-color: var(--ci-brand-red);
    background: var(--ci-brand-red);
    color: #fff;
    transform: none;
}

.ci-cart-icon-btn--shipping:hover svg,
.ci-cart-icon-btn--shipping:active svg,
.ci-cart-icon-btn--shipping:focus-visible svg {
    transform: scale(1.08);
}

.ci-cart-icon-btn--shipping .ci-cart-icon-btn__tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: var(--ci-brand-dark);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 30;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.ci-cart-icon-btn--shipping .ci-cart-icon-btn__tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ci-brand-dark);
}

.ci-cart-icon-btn--shipping:hover .ci-cart-icon-btn__tip,
.ci-cart-icon-btn--shipping:focus-visible .ci-cart-icon-btn__tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.gpc-checkout-row > .ci-btn-acheter--checkout,
.gpc-checkout-actions .ci-btn-acheter--checkout {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin-top: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: none;
    background: var(--ci-brand-red);
    color: #fff;
    border: 2px solid var(--ci-brand-red);
    transition: filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.gpc-checkout-row > .ci-btn-acheter--checkout:hover,
.gpc-checkout-row > .ci-btn-acheter--checkout:active,
.gpc-checkout-row > .ci-btn-acheter--checkout:focus-visible,
.gpc-checkout-actions .ci-btn-acheter--checkout:hover,
.gpc-checkout-actions .ci-btn-acheter--checkout:active,
.gpc-checkout-actions .ci-btn-acheter--checkout:focus-visible {
    background: var(--ci-brand-red);
    color: #fff;
    border-color: var(--ci-brand-red);
    filter: brightness(0.88);
}

.gpc-checkout-actions .ci-cart-icon-btn svg {
    width: 23px;
    height: 23px;
    display: block;
    transition: transform 0.15s ease;
}

.gpc-checkout-actions .ci-cart-icon-btn:hover {
    background: #fff;
    color: var(--ci-brand-red);
    transform: none;
    opacity: 1;
}

.gpc-checkout-actions .ci-cart-icon-btn:hover svg {
    transform: scale(1.08);
}

.gpc-checkout-actions .ci-cart-icon-btn svg path {
    fill: currentColor;
}

.gpc-checkout-actions .ci-cart-icon-btn__tip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: var(--ci-brand-dark);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 30;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.gpc-checkout-actions .ci-cart-icon-btn__tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--ci-brand-dark);
}

.gpc-checkout-actions .ci-cart-icon-btn:hover .ci-cart-icon-btn__tip,
.gpc-checkout-actions .ci-cart-icon-btn:focus-visible .ci-cart-icon-btn__tip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.ci-btn-view {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: var(--ci-card-btn-h);
    min-height: var(--ci-card-btn-h);
    border: 2px solid #b8bcc4;
    border-radius: 6px;
    color: var(--ci-brand-dark);
    background: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    padding: 0;
}

.ci-btn-view:hover {
    border-color: var(--ci-brand-grey);
    background: #f9fafb;
    color: var(--ci-brand-dark);
}

.ci-btn-paypal {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: opacity 0.2s ease;
    box-sizing: border-box;
}

.ci-card-actions-row--secondary .ci-btn-paypal {
    margin-top: 0;
}

.ci-btn-paypal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    border-radius: 6px;
    transition: background 0.2s ease;
    pointer-events: none;
}

.ci-btn-paypal:hover::after,
.ci-btn-paypal:focus-visible::after {
    background: rgba(0, 0, 0, 0.14);
}

.ci-btn-paypal img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.ci-btn-paypal:hover,
.ci-btn-paypal:focus {
    opacity: 1;
}

.ci-btn-paypal--fallback {
    background: #ffc439;
    color: #003087;
    font-weight: 800;
    padding: 0 10px;
    text-align: center;
    font-size: 0.9rem;
    min-height: var(--ci-card-btn-h);
    height: var(--ci-card-btn-h);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Toast — mobile: centre-bas ; desktop: sous icône panier ── */
.ci-toast-host {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    max-width: min(94vw, 480px);
    width: min(94vw, 480px);
}

@media (min-width: 901px) {
    .ci-toast-host {
        top: calc(var(--header-total-h, 72px) + 8px);
        right: 20px;
        bottom: auto;
        left: auto;
        transform: none;
        align-items: flex-end;
        width: auto;
        max-width: min(94vw, 480px);
    }
}

.ci-toast {
    pointer-events: auto;
    background: #fff;
    color: #111;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    opacity: 1;
    transition: opacity 0.45s ease, transform 0.45s ease;
    min-width: min(94vw, 320px);
    width: 100%;
    box-sizing: border-box;
}

.ci-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
}

@media (min-width: 901px) {
    .ci-toast.is-leaving {
        transform: translateY(-6px);
    }
}

.ci-toast__actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.ci-toast__btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--ci-brand-red);
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
}

.ci-toast__btn:hover {
    background: #b80322;
    color: #fff;
}

/* ── Modale auth ── */
body.ci-modal-open {
    overflow: hidden;
}

.ci-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ci-auth-modal[hidden] {
    display: none !important;
}

.ci-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ci-auth-modal__card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.ci-auth-modal__card--wide {
    max-width: 520px;
}

.ci-auth-modal__card--tall {
    max-width: 540px;
    text-align: left;
    max-height: min(90vh, 640px);
    overflow-y: auto;
}

.ci-auth-modal__card--tall .ci-auth-modal__title {
    text-align: left;
}

.ci-auth-modal__text--muted {
    color: #6b7280;
    font-size: 0.88rem;
}

.ci-auth-modal__text a {
    color: var(--ci-brand-red);
    font-weight: 700;
    text-decoration: underline;
}

.ci-auth-modal__text a:hover {
    color: #b80322;
}

.ci-auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: var(--ci-brand-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.ci-auth-modal__close:hover {
    border-color: var(--ci-brand-grey);
    background: #f9fafb;
}

.ci-auth-modal__title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ci-brand-dark);
    margin: 0 0 1rem;
    line-height: 1.35;
    padding-right: 2rem;
}

.ci-auth-modal__text {
    font-size: 0.92rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 0 0 0.85rem;
}

.ci-auth-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.25rem;
}

.ci-auth-modal__btn {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.ci-auth-modal__btn--primary {
    background: var(--ci-brand-red);
    color: #fff;
    border: 2px solid var(--ci-brand-red);
}

.ci-auth-modal__btn--primary:hover {
    background: #b80322;
    color: #fff;
}

.ci-auth-modal__btn--secondary {
    background: #fff;
    color: var(--ci-brand-dark);
    border: 2px solid var(--ci-brand-dark);
}

.ci-auth-modal__btn--secondary:hover {
    background: var(--ci-brand-dark);
    color: #fff;
}

/* Side-by-side on PC; stack only on phone. Must come after .ci-auth-modal__actions. */
.ci-auth-modal__actions.ci-auth-modal__actions--stack-sm {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
}

.ci-auth-modal__actions--stack-sm .ci-auth-modal__btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .ci-auth-modal__actions.ci-auth-modal__actions--stack-sm {
        flex-direction: column;
    }

    .ci-auth-modal__actions--stack-sm .ci-auth-modal__btn {
        flex: none;
        width: 100%;
        white-space: normal;
        padding: 10px 14px;
        font-size: 0.86rem;
    }
}

.ci-auth-modal__payments-text {
    font-size: 0.82rem;
    color: #4b5563;
    line-height: 1.55;
    margin: 1.1rem 0 0.65rem;
    text-align: left;
}

.ci-checkout-gate__payments {
    display: block;
    max-width: 72%;
    height: auto;
    margin: 0.35rem auto 0;
}
