/* ================================================================
   PRODUCT CARD PATCH — add to bottom of final.css
   Fixes: discount badge sizing, price colours, responsiveness
   ================================================================ */

/* ---------------------------------------------------------------
   1. DISCOUNT BADGE — auto-sizes with content, no fixed width
   --------------------------------------------------------------- */
.discount-badge {
    position: absolute;
    top: 12px;
    /* colour */
    background: #c0392b;
    color: #fff;
    /* typography */
    font-size: clamp(9px, 1.1vw, 12px);
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.3;
    /* padding auto-expands for longer text */
    padding: 4px 8px;
    white-space: nowrap;
    /* shape */
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.4);
    /* z / animation */
    z-index: 2;
    animation: badgePulse 2.5s ease-in-out infinite;
    /* remove any hard max-width from earlier rules */
    max-width: none;
    overflow: visible;
    text-overflow: unset;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}

/* ---------------------------------------------------------------
   2. PRICE COLOURS
   --------------------------------------------------------------- */
/* Current price when there IS a discount → red */
.current-price.has-discount {
    color: #c0392b !important;
    font-weight: 700;
}

/* Current price with NO discount → black (default) */
.current-price {
    color: #000;
    font-size: 20px;
    font-weight: 700;
}

/* Old / original price → grey strikethrough */
.old-price {
    color: #999 !important;
    text-decoration: line-through !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

/* ---------------------------------------------------------------
   3. PRODUCT CARD — ensure full responsiveness
   --------------------------------------------------------------- */
.product-card {
    position: relative;       /* needed for absolute children */
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
}

/* Image container — always 3:4 aspect ratio */
.card-image-container {
    position: relative;
    width: 100%;
    padding-top: 133.33%;   /* 3:4 */
    overflow: hidden;
    background: #f8f8f8;
    flex-shrink: 0;
}

.product-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-image {
    transform: scale(1.07);
}

/* Card text area */
.card-content {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    margin-bottom: 8px;
    flex: 1;
}
.product-title h3 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
    max-height: 40px;
}
.product-title a { color: #1a1a1a; text-decoration: none; }
.product-title a:hover { color: #8B7355; }

/* Price row */
.product-price { margin-top: auto; padding-top: 8px; }
.price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.price-left {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   4. WISHLIST BUTTON
   --------------------------------------------------------------- */
.wishlist-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.95);
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: scale(0.8);
}
.product-card:hover .wishlist-btn { opacity: 1; transform: scale(1); }
.wishlist-btn i { font-size: 15px; color: #666; transition: all 0.3s; }
.wishlist-btn:hover { border-color: #ff4757; box-shadow: 0 6px 20px rgba(255,71,87,0.3); }
.wishlist-btn:hover i { color: #ff4757; }
.wishlist-btn.active { background: #ff4757; border-color: #ff4757; opacity: 1; transform: scale(1); }
.wishlist-btn.active i { color: #fff; font-weight: 900; }

/* ---------------------------------------------------------------
   5. MOBILE — show add-to-cart, hide desktop hover
   --------------------------------------------------------------- */
@media (max-width: 991px) {
    .hover-actions.desktop-only { display: none !important; }
    .mobile-add-to-cart         { display: block !important; }
    /* always show wishlist on mobile */
    .wishlist-btn { opacity: 1 !important; transform: scale(1) !important; }
    /* badge font scales down on small screens */
    .discount-badge { font-size: 10px; padding: 3px 7px; }
}

@media (min-width: 992px) {
    .mobile-add-to-cart { display: none !important; }
}

/* Mobile card sizing */
@media (max-width: 767px) {
    .card-image-container { padding-top: 125%; }
    .card-content { padding: 12px 14px; }
    .product-title h3 { font-size: 13px; min-height: 36px; max-height: 36px; }
    .current-price { font-size: 17px !important; }
    .old-price     { font-size: 13px !important; }
    .discount-badge { font-size: 9px; padding: 3px 6px; }
}

@media (max-width: 374px) {
    .card-content { padding: 10px 12px; }
    .product-title h3 { font-size: 12px; min-height: 34px; max-height: 34px; }
    .current-price { font-size: 15px !important; }
}