/* =====================================================
   BD PRODUCT CARD
   ===================================================== */

.bd-product-card {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #ececec;
    box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.05 );
    list-style: none;
    transition: box-shadow 0.25s, transform 0.25s;
    display: flex;
    flex-direction: column;
}

.bd-product-card:hover {
    box-shadow: 0 14px 40px rgba( 0, 0, 0, 0.11 );
    transform: translateY( -4px );
}

/* ── Discount badge ─────────────────────────── */
.bd-disc-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba( 10, 16, 40, 0.82 );
    color: #fff;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    z-index: 4;
    letter-spacing: 0.03em;
    backdrop-filter: blur( 4px );
}

/* ── Wishlist button ────────────────────────── */
.bd-product-card > .bd-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba( 255, 255, 255, 0.88 );
    color: #b0b8c9;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    backdrop-filter: blur( 6px );
    box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.1 );
}

.bd-product-card > .bd-wishlist-btn.in-wishlist,
.bd-product-card > .bd-wishlist-btn:hover {
    color: #ff4da6;
    background: #fff;
}

/* ── Image area ─────────────────────────────── */
.bd-card-img-wrap {
    position: relative;
    overflow: hidden;
    background: #f4f5f8;
    flex-shrink: 0;
}

.bd-card-img-link { display: block; }

.bd-card-img-wrap img {
    width: 100% !important;
    height: 280px !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.35s ease;
}

.bd-product-card:hover .bd-card-img-wrap img {
    transform: scale( 1.05 );
}

/* ── Quick Add overlay ──────────────────────── */
.bd-quick-add {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient( 90deg, #ff4da6 0%, #8b5cf6 50%, #2563eb 100% );
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transform: translateY( 100% );
    transition: transform 0.28s cubic-bezier( 0.34, 1.1, 0.64, 1 );
    z-index: 3;
    letter-spacing: 0.02em;
}

.bd-product-card:hover .bd-quick-add {
    transform: translateY( 0 );
}

.bd-quick-add.bd-out-of-stock {
    background: rgba( 100, 116, 139, 0.85 );
    cursor: not-allowed;
}

/* ── Card body ──────────────────────────────── */
.bd-card-body {
    padding: 15px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

/* Title */
.bd-card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    min-height: 2.9em;
}

.bd-card-title a {
    text-decoration: none;
    color: #111827;
    transition: color 0.2s;
}

.bd-card-title a:hover { color: #ff4da6; }

/* Rating */
.bd-card-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 18px;
}

/* Font Awesome star icons */
.bd-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
}

.bd-stars .fas.fa-star,
.bd-stars .fas.fa-star-half-stroke {
    color: #f59e0b;
    font-size: 13px;
}

.bd-stars .far.fa-star {
    color: #d1d5db;
    font-size: 13px;
}

.bd-rating-num {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

/* Price */
.bd-card-price { margin-top: 2px; }

/* WooCommerce price with sale */
.bd-card-price .price {
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.bd-card-price .price ins {
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.bd-card-price .price del {
    font-size: 13px;
    color: #b0b8c9;
    font-weight: 500;
}

/* Price without sale */
.bd-card-price .price .woocommerce-Price-amount {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.bd-card-price .price del .woocommerce-Price-amount {
    font-size: 13px;
    font-weight: 500;
    color: #b0b8c9;
}

/* Action buttons */
.bd-card-actions {
    display: flex;
    gap: 9px;
    margin-top: 4px;
}

.bd-act-buy {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: linear-gradient( 90deg, #ff4da6, #2563eb );
    color: #fff !important;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none !important;
    transition: opacity 0.2s, transform 0.2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.bd-act-buy:hover { opacity: 0.88; transform: translateY( -1px ); }

.bd-act-cart {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    color: #374151 !important;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none !important;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.bd-act-cart:hover {
    border-color: #ff4da6;
    color: #ff4da6 !important;
}

/* Loading state when WC AJAX fires */
.bd-act-cart.loading::after,
.bd-quick-add.loading::after {
    display: none !important;  /* hide WC default spinner */
}

.bd-act-cart.added { border-color: #10b981; color: #10b981 !important; }

.bd-act-unavailable {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    background: #f3f4f6;
    color: #9ca3af;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
}

/* ── WooCommerce "added to cart" notice ────── */
.woocommerce-message {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    color: #065f46;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
}

.woocommerce-message a.button {
    margin-left: auto;
    padding: 8px 18px;
    background: #10b981;
    color: #fff;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.woocommerce-message a.button:hover { background: #059669; }

/* ── Dark mode ───────────────────────────────── */
body.dark-mode .bd-product-card {
    background: #1e293b;
    border-color: rgba( 255, 255, 255, 0.07 );
}

body.dark-mode .bd-card-img-wrap { background: #0f172a; }

body.dark-mode .bd-card-title a { color: #e2e8f0; }
body.dark-mode .bd-card-title a:hover { color: #ff4da6; }

body.dark-mode .bd-card-price .price ins,
body.dark-mode .bd-card-price .price .woocommerce-Price-amount { color: #e2e8f0; }

body.dark-mode .bd-act-cart {
    border-color: rgba( 255, 255, 255, 0.12 );
    color: #cbd5e1 !important;
}

body.dark-mode .bd-act-cart:hover { border-color: #ff4da6; color: #ff4da6 !important; }

body.dark-mode .bd-product-card > .bd-wishlist-btn { background: rgba( 15, 23, 42, 0.85 ); }

body.dark-mode .bd-rating-num { color: #64748b; }

/* ── Related / upsell product cards: compact layout ──── */
.bd-related-grid .bd-act-buy,
.bd-related-grid .bd-act-cart {
    font-size: 12px;
    padding: 9px 10px;
    gap: 4px;
}

/* Responsive: shop grid at small widths */
@media ( max-width: 1200px ) {
    ul.products { grid-template-columns: repeat( 3, 1fr ) !important; }
}
