/* Header cart button in navbar */
.header-cart-wrap {
    flex-shrink: 0;
}

.header-cart-btn {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    z-index: 2;
}

.header-cart-btn .badge {
    font-size: 0.65rem;
    min-width: 1.15rem;
    line-height: 1.15rem;
    padding: 0 0.3rem;
}

.header-cart-btn.header-cart-pulse {
    animation: headerCartPulse 0.55s ease;
}

.cart-action-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    z-index: 2147483001;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: min(360px, calc(100vw - 2rem));
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 12px;
    background: #087f5b;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 14px 30px rgba(15,23,42,.2);
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity .2s ease, transform .2s ease;
}

.cart-action-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.cart-action-toast--error {
    background: #b42318;
}

.cart-action-toast i {
    flex: 0 0 auto;
}

@keyframes headerCartPulse {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.22);
    }
    70% {
        transform: scale(0.94);
    }
    100% {
        transform: scale(1);
    }
}

.navbar .header-cart-wrap .navbar-toggler {
    border-color: rgba(12, 15, 58, 0.25);
}

.navbar .header-cart-wrap .navbar-toggler-icon {
    filter: invert(1) brightness(0.25);
}

@media (min-width: 1200px) {
    .header-cart-wrap .navbar-toggler {
        display: none;
    }
}

/* Flying product clone — always above sticky header */
.fly-to-cart-clone {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483000;
    pointer-events: none;
    overflow: visible;
    border-radius: 12px;
    box-shadow:
        0 0 0 3px rgba(209, 0, 36, 0.35),
        0 14px 36px rgba(12, 15, 58, 0.35),
        0 0 28px rgba(209, 0, 36, 0.35);
    will-change: transform, opacity, width, height;
    background: #fff;
    isolation: isolate;
}

.fly-to-cart-clone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
    position: relative;
    z-index: 1;
}

.fly-to-cart-ring {
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    border: 2px solid rgba(209, 0, 36, 0.55);
    box-shadow: 0 0 18px rgba(209, 0, 36, 0.45);
    animation: flyToCartRingPulse 0.7s ease-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes flyToCartRingPulse {
    0% {
        transform: scale(0.92);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-cart-btn.header-cart-pulse {
        animation: none;
    }

    .fly-to-cart-ring {
        animation: none;
        display: none;
    }

    .cart-action-toast {
        transition: none;
    }
}

/* Keep card action forms aligned with sibling buttons */
.product-card-actions > form {
    display: contents;
}
