/**
 * Universal Product Card CSS - 1:1 Reference Design
 * Matches Screenshot 1 (Desktop) & Screenshot 2 (Mobile)
 */

:root {
    --brand-primary: #ff1a58;
    --card-brand-cream: #bc9072;
}

/* Universal Card Container */
.universal-product-card,
.flash-product-card {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #f1f2f7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.product-card-inner,
.flash-product-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

/* Badges Container - Top Left */
.product-badges-container {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    pointer-events: none;
}

.product-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2.5px 8px;
    border-radius: 12px;
    color: #ffffff;
    letter-spacing: 0.03em;
    display: inline-block;
    width: fit-content;
    line-height: 1.35;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.product-badge.badge-best-selling {
    background-color: #ff1760 !important;
    color: #ffffff !important;
}

.product-badge.badge-new {
    background-color: #00c758 !important;
    color: #ffffff !important;
}

.product-badge.badge-on-sale {
    background: linear-gradient(90deg, #960063 0%, #ff1a58 100%) !important;
    color: #ffffff !important;
}

.product-badge.badge-top-rated {
    background-color: #FF5E2C !important;
    color: #ffffff !important;
}

.product-badge.badge-ai-pick {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

/* Product Image Link & Image */
.product-img-link,
.flash-product-img-wrap {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 10px;
    background: #ffffff;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    box-sizing: border-box;
}

.product-card-img,
.flash-product-img-wrap img {
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =======================================================
   OUT OF STOCK / WAITLIST BUTTON (1:1 Reference Design)
   Matches Screenshot 1 (Desktop) & Screenshot 2 (Mobile)
   ======================================================= */
.product-waitlist-wrap {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
    padding: 0 8px;
    box-sizing: border-box;
}

.product-waitlist-btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background-color: #000000;
    color: #ffffff !important;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.product-waitlist-btn .product-waitlist-icon {
    width: 17px;
    height: 12px;
    flex-shrink: 0;
    display: block;
    color: #ffffff;
}

.product-waitlist-btn .product-waitlist-icon path {
    stroke: currentColor;
}

.product-waitlist-btn .product-waitlist-text {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff !important;
    letter-spacing: -0.01em;
    line-height: 1;
    display: inline-block;
}

/* Hover state:
   When card or button is hovered, ONLY the button background smoothly transitions to caramel/bronze #bc9072 (Cream-500)
*/
.universal-product-card:hover .product-waitlist-btn,
.flash-product-card:hover .product-waitlist-btn,
.product-waitlist-btn:hover {
    background-color: #bc9072 !important;
    color: #ffffff !important;
}

.universal-product-card:hover .product-waitlist-btn .product-waitlist-icon,
.flash-product-card:hover .product-waitlist-btn .product-waitlist-icon,
.product-waitlist-btn:hover .product-waitlist-icon {
    color: #ffffff !important;
}

.universal-product-card:hover .product-waitlist-btn .product-waitlist-text,
.flash-product-card:hover .product-waitlist-btn .product-waitlist-text,
.product-waitlist-btn:hover .product-waitlist-text {
    color: #ffffff !important;
}

/* Stock-out cards:
   Image does NOT scale/zoom on hover
*/
.universal-product-card.is-stock-out .product-card-img,
.flash-product-card.is-stock-out .product-card-img {
    transition: none;
}

.universal-product-card.is-stock-out:hover .product-card-img,
.flash-product-card.is-stock-out:hover .product-card-img {
    transform: none !important;
}

.universal-product-card.is-stock-out:hover .product-add-cart-btn,
.flash-product-card.is-stock-out:hover .product-add-cart-btn {
    display: none !important;
}

/* Product Info Container */
.product-card-info,
.flash-product-body {
    padding: 8px 12px 12px !important;
    background: #ffffff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.product-brand-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--card-brand-cream, #bc9072);
    margin-bottom: 2px;
    text-decoration: none;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.product-brand-title:hover {
    color: #9d7355;
    text-decoration: none;
}

.product-title-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    color: inherit;
}

.product-title-link:hover {
    text-decoration: none;
}

.product-name,
.flash-product-name {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1e2939 !important;
    line-height: 1.35 !important;
    margin: 0 0 6px 0 !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 35px;
    height: 35px;
    transition: color 0.15s ease;
}

.product-title-link:hover .product-name {
    color: var(--brand-primary, #ff1a58) !important;
}

.product-price-row,
.flash-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.product-old-price,
.flash-price-old {
    font-size: 12px;
    color: #717171;
    text-decoration: line-through;
    font-weight: 400;
}

.product-new-price,
.flash-price-new {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
}

.product-new-price.has-discount {
    color: var(--brand-primary, #ff1a58) !important;
}

/* =======================================================
   DESKTOP VIEW (Screenshot 1)
   - On hover: image subtle zoom
   - On hover: top-right corner reveals brand-colored circle with white '+'
   ======================================================= */
@media (min-width: 641px) {
    .universal-product-card:hover,
    .flash-product-card:hover {
        box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.1);
    }

    .universal-product-card:hover .product-card-img,
    .flash-product-card:hover .product-card-img {
        transform: scale(1.08);
    }

    .product-add-cart-btn {
        position: absolute;
        top: -24px;
        right: -24px;
        width: 72px;
        height: 72px;
        border-radius: 50%;
        background-color: var(--brand-primary, #ff1a58);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        z-index: 11;
        cursor: pointer;
        opacity: 0;
        transform: scale(0.25);
        transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
        padding: 0;
        text-decoration: none;
        outline: none;
    }

    .product-add-cart-btn .cart-plus-icon {
        position: relative;
        top: -12px;
        left: -10px;
        width: 25px;
        height: 25px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-size: 18px;
        font-weight: 400;
        line-height: 1;
    }

    .universal-product-card:hover .product-add-cart-btn,
    .flash-product-card:hover .product-add-cart-btn {
        opacity: 1;
        transform: scale(1);
    }
}

/* =======================================================
   PHONE / MOBILE VIEW (Screenshot 2)
   - NO hover effect on image
   - Top-right has fixed always-visible circular (+) icon (black outline & +)
   ======================================================= */
@media (max-width: 640px) {
    .universal-product-card .product-card-img,
    .flash-product-card .product-card-img {
        transform: none !important;
    }

    .universal-product-card:hover,
    .flash-product-card:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    }

    .product-add-cart-btn {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: transparent !important;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 11;
        cursor: pointer;
        opacity: 1 !important;
        transform: none !important;
        border: none;
        padding: 0;
        text-decoration: none;
        outline: none;
    }

    .product-add-cart-btn .cart-plus-icon {
        position: static;
        width: 24px;
        height: 24px;
        border: 2px solid #000000;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #000000;
        font-size: 18px;
        font-weight: 400;
        line-height: 1;
    }

    .product-name,
    .flash-product-name {
        font-size: 12px !important;
        min-height: 32px;
        height: 32px;
    }

    .product-card-info,
    .flash-product-body {
        padding: 6px 8px 10px !important;
    }

    .product-new-price {
        font-size: 13px;
    }

    .product-waitlist-wrap {
        bottom: 8px;
        padding: 0 4px;
    }

    .product-waitlist-btn {
        gap: 5px;
        padding: 4.5px 11px;
    }

    .product-waitlist-btn .product-waitlist-icon {
        width: 15px;
        height: 10px;
    }

    .product-waitlist-btn .product-waitlist-text {
        font-size: 11px;
    }
}

/* Quick Add Button click animation */
.ajax-quick-add-btn.adding .cart-plus-icon {
    animation: quickAddSpin 0.4s linear infinite;
}

@keyframes quickAddSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}


