/* Agrinutriment — retour visuel d'ajout au panier (repris de Master Inputs S731 1.3.2). */

/* Notification premium : un seul portail fixe, sans verrou de défilement ni décalage du contenu. */
.agr-cf-toast {
    --agr-cf-ink: #21383b;
    --agr-cf-green: #257b48;
    --agr-cf-pale: #eff5eb;
    position: fixed;
    z-index: 2147483000;
    right: calc(20px + env(safe-area-inset-right, 0px));
    /* Au-dessus du bouton « Assistance », fixé en bas à droite. */
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 44px;
    gap: 12px;
    align-items: center;
    width: min(440px, calc(100vw - 32px));
    min-height: 92px;
    padding: 14px 14px 14px 16px;
    border: 1px solid #3c5558;
    border-radius: 16px;
    background: var(--agr-cf-ink);
    color: #fff;
    box-shadow: 0 14px 38px rgba(20, 38, 40, .26);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
}
.agr-cf-toast[hidden] { display: none !important; }
.agr-cf-toast__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--agr-cf-pale);
    color: var(--agr-cf-green);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.agr-cf-toast__copy { min-width: 0; }
.agr-cf-toast__title {
    display: block;
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agr-cf-toast__detail,
.agr-cf-toast__amount {
    display: block;
    margin-top: 2px;
    color: #dbe6e1;
    font-size: 13px;
    line-height: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agr-cf-toast__amount { color: #fff; font-weight: 650; }
.agr-cf-toast__amount:empty { display: none; }
.agr-cf-toast__actions {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding-left: 12px;
    border-left: 1px solid rgba(239, 245, 235, .22);
}
.agr-cf-toast .agr-cf-toast__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}
.agr-cf-toast .agr-cf-toast__close {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.agr-cf-toast .agr-cf-toast__close:hover { background: rgba(255, 255, 255, .08); }
.agr-cf-toast :is(a, button):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 480px) {
    .agr-cf-toast {
        right: calc(12px + env(safe-area-inset-right, 0px));
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        width: calc(100vw - 24px);
        grid-template-columns: 30px minmax(0, 1fr) auto 40px;
        gap: 8px;
        padding: 10px;
    }
    .agr-cf-toast__icon { width: 30px; height: 30px; font-size: 18px; }
    .agr-cf-toast__actions { padding-left: 8px; }
    .agr-cf-toast__title { font-size: 14px; }
    .agr-cf-toast__detail,
    .agr-cf-toast__amount,
    .agr-cf-toast .agr-cf-toast__link { font-size: 12px; }
    .agr-cf-toast .agr-cf-toast__close { width: 40px; min-width: 40px; }
}

.agr-cf-announcement {
    position: fixed;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    pointer-events: none;
}

/* Vignette qui vole du bouton jusqu'au panier. */
.agr-cf-fly {
    position: fixed;
    z-index: 2147483005;
    width: 60px !important;
    height: 60px !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid #d3e0ce;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 6px 20px rgba(20, 38, 40, .2);
    pointer-events: none;
    transform-origin: center;
    will-change: transform, opacity;
    contain: layout style paint;
}

/* Bouton pendant l'ajout : même hauteur, même couleur, roue à la place de l'icône. */
.agr-cf-loading.agr-cf-loading {
    height: var(--agr-cf-height) !important;
    min-height: var(--agr-cf-height) !important;
    max-height: var(--agr-cf-height) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    opacity: 1 !important;
    cursor: wait !important;
}
.agr-cf-loading > svg,
.agr-cf-loading.loading::after { display: none !important; }
.agr-cf-loading .ab-btn-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.agr-cf-spinner {
    display: inline-block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-inline-end: 8px;
    vertical-align: -3px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: agr-cf-spin .6s linear infinite;
}
@keyframes agr-cf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .agr-cf-spinner { animation-duration: 1.4s; }
}
