/* =========================================================
   NUBE AMARILLA - CARRITO AJAX PARA JETENGINE
========================================================= */

.na-ajax-cart-button {
    --na-cart-green: #365b3d;
    --na-cart-green-dark: #213f2a;
    --na-cart-green-soft: #edf5ec;
    --na-cart-white: #ffffff;
    --na-cart-muted: #a8aea9;

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-height: 54px;
    padding: 13px 22px;

    overflow: hidden;

    color: var(--na-cart-white) !important;
    background: var(--na-cart-green);
    border: 1px solid var(--na-cart-green);
    border-radius: 999px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;

    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;

    box-shadow: 0 11px 25px rgba(33, 63, 42, 0.18);

    transition:
        transform 0.22s ease,
        background-color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease,
        color 0.22s ease;
}

.na-ajax-cart-button:hover,
.na-ajax-cart-button:focus {
    color: var(--na-cart-white) !important;
    background: var(--na-cart-green-dark);
    border-color: var(--na-cart-green-dark);
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 15px 32px rgba(33, 63, 42, 0.25);
}

.na-ajax-cart-button:focus-visible {
    outline: 3px solid rgba(54, 91, 61, 0.22);
    outline-offset: 3px;
}

.na-ajax-cart-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.na-ajax-cart-button__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.na-ajax-cart-button__text {
    position: relative;
    z-index: 1;
}

.na-ajax-cart-button__spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: naCartSpin 0.75s linear infinite;
}

.na-ajax-cart-button.is-loading {
    cursor: wait;
    pointer-events: none;
}

.na-ajax-cart-button.is-loading .na-ajax-cart-button__icon {
    opacity: 0;
}

.na-ajax-cart-button.is-loading .na-ajax-cart-button__spinner {
    position: static;
    opacity: 1;
}

.na-ajax-cart-button.is-added {
    background: #2f7841;
    border-color: #2f7841;
}

.na-ajax-cart-button--options,
.na-ajax-cart-button--view {
    color: var(--na-cart-green-dark) !important;
    background: var(--na-cart-white);
    border-color: var(--na-cart-green);
    box-shadow: none;
}

.na-ajax-cart-button--options:hover,
.na-ajax-cart-button--options:focus,
.na-ajax-cart-button--view:hover,
.na-ajax-cart-button--view:focus {
    color: var(--na-cart-white) !important;
    background: var(--na-cart-green);
    border-color: var(--na-cart-green);
}

.na-ajax-cart-button--disabled,
.na-ajax-cart-button--disabled:hover,
.na-ajax-cart-button--disabled:focus {
    color: #ffffff !important;
    background: var(--na-cart-muted);
    border-color: var(--na-cart-muted);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.76;
    transform: none;
}

/* =========================================================
   ALERTA FLOTANTE
========================================================= */

.na-ajax-cart-toast-region {
    position: fixed;
    z-index: 999999;
    top: 24px;
    right: 24px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    width: min(390px, calc(100vw - 32px));

    pointer-events: none;
}

.na-ajax-cart-toast {
    position: relative;

    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 96px;
    padding: 16px 14px 17px 16px;

    overflow: hidden;

    color: #ffffff;
    background: var(--na-toast-background, #365b3d);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 17px;

    box-shadow: 0 18px 48px rgba(24, 45, 30, 0.28);

    opacity: 0;
    transform: translate3d(28px, 0, 0) scale(0.97);

    pointer-events: auto;

    transition:
        opacity 0.26s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.na-ajax-cart-toast--success {
    --na-toast-background: #365b3d;
}

.na-ajax-cart-toast--error {
    --na-toast-background: #a83f3f;
}

.na-ajax-cart-toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.na-ajax-cart-toast.is-hiding {
    opacity: 0;
    transform: translate3d(28px, 0, 0) scale(0.97);
}

.na-ajax-cart-toast__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;
    padding: 10px;

    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 13px;
}

.na-ajax-cart-toast__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.na-ajax-cart-toast__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.na-ajax-cart-toast__content strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.na-ajax-cart-toast__product {
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.na-ajax-cart-toast__message {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    line-height: 1.4;
}

.na-ajax-cart-toast__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    padding: 0;

    color: rgba(255, 255, 255, 0.76);
    background: transparent;
    border: 0;
    border-radius: 50%;

    font-size: 23px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.na-ajax-cart-toast__close:hover,
.na-ajax-cart-toast__close:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.na-ajax-cart-toast__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;

    height: 3px;

    background: rgba(255, 255, 255, 0.78);

    transform-origin: left center;

    animation: naCartToastProgress 3.5s linear forwards;
}

@keyframes naCartSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes naCartToastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 767px) {
    .na-ajax-cart-button {
        min-height: 50px;
        padding: 12px 17px;
        font-size: 13px;
    }

    .na-ajax-cart-toast-region {
        top: auto;
        right: 16px;
        bottom: 18px;
        left: 16px;
        width: auto;
    }

    .na-ajax-cart-toast {
        grid-template-columns: 42px minmax(0, 1fr) 28px;
        min-height: 88px;
        padding: 14px 12px 15px 14px;
        transform: translate3d(0, 24px, 0) scale(0.97);
    }

    .na-ajax-cart-toast.is-visible {
        transform: translate3d(0, 0, 0) scale(1);
    }

    .na-ajax-cart-toast.is-hiding {
        transform: translate3d(0, 24px, 0) scale(0.97);
    }

    .na-ajax-cart-toast__icon {
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .na-ajax-cart-button,
    .na-ajax-cart-toast,
    .na-ajax-cart-toast__progress,
    .na-ajax-cart-button__spinner {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
