/* ============================================================
   SHARED PRODUCT CARD CSS
   ============================================================ */

.prod-card {
    background: var(--white);
    border: 1px solid var(--gray-100);
    border-radius: var(--r-md);
    padding: 12px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--sh-sm);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    contain: layout style;
}

.prod-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-md);
    border-color: var(--pink-light);
}

/* Square Image Wrapper */
.shimg-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--r-sm);
    background: var(--gray-50);
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
    contain: paint layout;
    will-change: transform;
}

.shimg-carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.shimg-carousel-container::-webkit-scrollbar {
    display: none;
}

@media (min-width: 769px) {
    .shimg-carousel-container {
        overflow-x: hidden;
        pointer-events: none;
    }
}

.shimg {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(1);
    will-change: transform;
}

.prod-card:hover .shimg {
    transform: scale(1.08);
}

/* Pagination indicator dots on hover */
.shimg-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.prod-card:hover .shimg-dots {
    opacity: 1;
}

.shimg-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.25s ease;
}

.shimg-dot.active {
    background: var(--white);
    transform: scale(1.2);
    width: 10px;
    border-radius: var(--r-full);
}

/* Badges inside Image */
.prod-card .badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    font-size: 8px;
    padding: 3px 8px;
    border-radius: var(--r-full);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: var(--sh-sm);
    color: var(--white);
}

.badge--best {
    background: var(--pink);
}

.badge--sale {
    background: var(--red);
}

/* Product Card Details */
.p-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.p-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--black);
    margin-bottom: 6px;
    height: auto;
    max-height: 36px;
    min-height: 18px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.p-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-100);
}

.p-price-box {
    display: flex;
    flex-direction: column;
}

.p-price-lbl {
    font-size: 9px;
    color: var(--gray-400);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1px;
}

.p-price-val {
    font-weight: 800;
    color: var(--primary);
    font-size: 15px;
}

/* Qty and Actions Box */
.qty-box {
    width: 72px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-btn {
    width: 100%;
    height: 100%;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--pink);
    background: var(--white);
    color: var(--pink);
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn:hover:not(:disabled) {
    background: var(--pink);
    color: var(--white);
    box-shadow: var(--sh-pink);
}

.add-btn:disabled {
    opacity: 0.5;
    border-color: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
}

.card-qty-control {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--pink);
    border-radius: var(--r-sm);
    padding: 0 4px;
    box-shadow: var(--sh-pink);
}

.card-qty-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s;
}

.card-qty-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.card-qty-val {
    color: var(--white);
    font-weight: 800;
    font-size: 13px;
    min-width: 16px;
    text-align: center;
}

/* ── Notify Me Button & Success Toast ── */
.notify-btn {
    width: 100%;
    height: 100%;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--gray-400);
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    white-space: nowrap;
}

.notify-btn:hover {
    background: var(--pink-soft);
    border-color: var(--pink);
    color: var(--pink);
}

#notify-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--white);
    border-left: 4px solid var(--pink);
    box-shadow: var(--sh-lg);
    border-radius: var(--r-sm);
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transform: translateY(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: var(--font);
}

#notify-toast.toast-show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 20px;
    animation: toastBellRing 0.8s ease;
}

.toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-title {
    font-weight: 800;
    color: var(--black);
    font-size: 13.5px;
}

.toast-desc {
    font-size: 12px;
    color: var(--gray-600);
}

@keyframes toastBellRing {
    0%,
    100% {
        transform: rotate(0deg);
    }
    15% {
        transform: rotate(-15deg);
    }
    30% {
        transform: rotate(10deg);
    }
    45% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

/* ── Fly to Cart Animation ── */
.cart-flyer {
    position: fixed;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--r-sm);
    z-index: 9999;
    pointer-events: none;
    box-shadow: var(--sh-md);
    border: 2px solid var(--white);
    transform: translate(-50%, -50%) scale(1);
    animation: flyToCartAnim 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes flyToCartAnim {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(calc(-50% + var(--delta-x)), calc(-50% + var(--delta-y))) scale(0.1) rotate(360deg);
        opacity: 0.1;
    }
}

/* Bounce/Spring animation for header cart icon */
#header-cart-btn.bounce {
    animation: cartBounceAnim 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes cartBounceAnim {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.85);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile overrides for reusable product cards */
@media (max-width: 768px) {
    .prod-card {
        padding: 8px;
        border-radius: var(--r-sm);
    }
    .shimg-wrap {
        margin-bottom: 8px;
    }
    .p-title {
        font-size: 12px;
        height: auto;
        max-height: 32px;
        min-height: 16px;
        margin-bottom: 4px;
    }
    .p-price-val {
        font-size: 13.5px;
    }
    .qty-box {
        width: 60px;
        height: 26px;
    }
    .add-btn {
        font-size: 11px;
    }
    .card-qty-val {
        font-size: 12px;
    }
    .card-qty-btn {
        width: 18px;
        height: 18px;
        font-size: 14px;
    }
    .shimg-dots {
        opacity: 1 !important;
    }
}
