/* ================= CART PILL (product page) =================
   Add to cart ke baad bottom bar ke upar floating pill dikhta hai:
   items count + running total + free-delivery progress ring.
   ============================================================ */

.cart-pill {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    z-index: 1029;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px 9px 14px;
    border-radius: 22px;
    background: linear-gradient(135deg, #2D2421 0%, #4a352e 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(45, 36, 33, 0.35), inset 0 0 0 1px rgba(212, 175, 55, 0.25);
    overflow: hidden;
    transform: translateY(140%) scale(0.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, visibility 0s linear 0.55s;
}

.cart-pill.is-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, visibility 0s;
}

.cart-pill:hover,
.cart-pill:focus {
    color: #fff;
}

/* gold shimmer jo har add par ek baar guzarta hai */
.cart-pill::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(212, 175, 55, 0.35), transparent);
    transform: skewX(-20deg);
    pointer-events: none;
}

.cart-pill.is-shimmer::after {
    animation: cartPillShimmer 0.9s ease-out;
}

@keyframes cartPillShimmer {
    from { left: -60%; }
    to { left: 130%; }
}

.cart-pill.is-bump {
    animation: cartPillBump 0.45s ease;
}

@keyframes cartPillBump {
    0% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-5px) scale(1.025); }
    100% { transform: translateY(0) scale(1); }
}

/* thumbnails ko pop animation (add hone par) */
.cart-pill-thumbs.is-pop {
    animation: cartIconPop 0.5s ease;
}

@keyframes cartIconPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ---------- text ---------- */
.cart-pill-info {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.cart-pill-amount {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
}

/* cart items ki compressed thumbnails */
.cart-pill-thumbs {
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.cart-pill-thumb {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-left: -8px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 1.5px solid #D4AF37;
    box-shadow: 0 0 0 1.5px #3a2c27;
}

.cart-pill-thumb.is-empty {
    background: rgba(255, 255, 255, 0.25);
}

.cart-pill-thumb-more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #D4AF37;
    color: #2D2421;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.cart-pill-cta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    height: 40px;
    padding: 0 14px 0 16px;
    border-radius: 16px;
    background: #D4AF37;
    color: #2D2421;
    font-size: 14px;
    font-weight: 700;
}

.cart-pill-cta i {
    font-size: 13px;
    transition: transform 0.25s ease;
}

.cart-pill:hover .cart-pill-cta i {
    transform: translateX(3px);
}

/* ---------- fly-to-cart image ---------- */
.cart-pill-fly {
    position: fixed;
    z-index: 3000;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #D4AF37;
    background: #fff center / cover no-repeat;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* ---------- desktop: bottom bar ke upar center me ---------- */
@media (min-width: 992px) {
    .cart-pill {
        left: 50%;
        right: auto;
        width: 600px;
        max-width: calc(100vw - 32px);
        bottom: 104px;
        margin-left: -300px;
    }
}

/* chhoti screens */
@media (max-width: 360px) {
    .cart-pill-amount { font-size: 11.5px; }
    .cart-pill-cta { padding: 0 11px 0 12px; font-size: 13px; }
}

/* page ke neeche padding taaki pill content na dhake */
body.has-cart-pill .product-details-container {
    padding-bottom: 150px;
}

@media (prefers-reduced-motion: reduce) {
    .cart-pill,
    .cart-pill.is-visible {
        transition: opacity 0.2s ease;
    }
    .cart-pill.is-shimmer::after,
    .cart-pill.is-bump,
    .cart-pill-thumbs.is-pop {
        animation: none;
    }
}