/* =============================================
   Add-to-Cart Feedback: Toast + Button + Badge
   ============================================= */

/* ---- Toast Container ---- */
.ald-toast-container {
    position: fixed;
    top: 86px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 360px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

/* ---- Toast Card ---- */
.ald-toast {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #16A34A;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(10, 37, 64, .16);
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .32s;
    position: relative;
}
.ald-toast.show { transform: translateX(0); opacity: 1; }
.ald-toast.hide { transform: translateX(120%); opacity: 0; }

.ald-toast-body {
    display: flex;
    gap: 12px;
    padding: 14px 14px 12px;
}
.ald-toast-check {
    width: 26px; height: 26px;
    border-radius: 100px;
    background: #ECFDF3;
    color: #16A34A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ald-toast-check svg { width: 14px; height: 14px; }
.ald-toast-main { flex: 1; min-width: 0; }
.ald-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: #0A2540;
    margin-bottom: 2px;
}
.ald-toast-prod {
    font-size: 12.5px;
    color: #64748B;
    line-height: 1.4;
}
.ald-toast-prod .code { color: #1E293B; font-weight: 600; }
.ald-toast-prod .qtybadge {
    display: inline-block;
    background: #0A2540;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    padding: 0 6px;
    margin-right: 5px;
}
.ald-toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 9px;
}
.ald-toast-cart {
    background: #1478D4;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}
.ald-toast-cart:visited { color: #fff; text-decoration: none; }
.ald-toast-cart:hover { color: #fff; text-decoration: none; }
.ald-toast-cart:active { color: #fff; text-decoration: none; }
.ald-toast-close {
    position: absolute;
    top: 8px; right: 8px;
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}
.ald-toast-close:hover { color: #64748B; }

/* progress bar */
.ald-toast-prog {
    height: 3px;
    background: #16A34A;
    opacity: .35;
    width: 100%;
    transform-origin: left;
    animation: ald-toast-prog 3s linear forwards;
}
@keyframes ald-toast-prog {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ---- Button Added State ---- */
.action.tocart.ald-added {
    background: #16A34A !important;
    border-color: #16A34A !important;
    color: #fff !important;
    cursor: default;
}
.action.tocart.ald-added span { color: #fff !important; }

/* ---- Cart Badge Pulse ---- */
.counter.qty.ald-pulse {
    animation: ald-badge-pulse .6s ease;
}
@keyframes ald-badge-pulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.55); }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ---- Cart Icon Bump ---- */
.action.showcart.ald-bump {
    animation: ald-cart-bump .5s ease;
}
@keyframes ald-cart-bump {
    0%, 100% { transform: translateY(0); }
    30%      { transform: translateY(-5px); }
    60%      { transform: translateY(2px); }
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .ald-toast-container {
        top: auto;
        bottom: calc(14px + env(safe-area-inset-bottom));
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
    .ald-toast {
        transform: translateY(150%);
    }
    .ald-toast.show { transform: translateY(0); }
    .ald-toast.hide { transform: translateY(150%); }
    .ald-toast-title { font-size: 15px; }
    .ald-toast-prod { font-size: 13px; }
    .ald-toast-cart {
        padding: 9px 16px;
        font-size: 13.5px;
    }
}
