/* ============================================================
   Product card - gaming PC / electronics store
   Compact catalog-tile layout: image, name, spec line, price row
   (current + strikethrough + % off), star rating, add-to-cart row.
   ============================================================ */
.product-card {
    --pc-primary: #1A0ACB;
    --pc-primary-hover: #150891;
    --pc-text: #0F172A;
    --pc-muted: #475569;
    --pc-border: #E2E8F0;
    --pc-rate: #F59E0B;
    --pc-offer: #DC2626;
    --pc-danger: #DC2626;

    position: relative;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    color: var(--pc-text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    transform: translateY(-2px);
}

/* Wishlist toggle - sits beside the Add to cart button */
.wishlist-form { margin: 0; flex-shrink: 0; }

.wishlist-toggle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1px solid var(--pc-border);
    border-radius: 4px;
    color: var(--pc-muted);
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
}

.wishlist-toggle:hover { color: var(--pc-danger); border-color: var(--pc-danger); }
.wishlist-toggle.is-active { color: var(--pc-danger); border-color: var(--pc-danger); }
.wishlist-toggle.is-active iconify-icon { fill: currentColor; }

/* Media */
.pc-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; }

.pc-media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #FFFFFF;
    padding: 10px;
}

.pc-media img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Out of stock */
.pc-oos-tag {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
}

.pc-oos-tag span {
    background: var(--pc-text);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 4px;
}

.product-card.is-oos .pc-media img { filter: grayscale(0.6); opacity: 0.6; }

/* Body */
.pc-body { padding: 4px 12px 6px; display: flex; flex-direction: column; gap: 4px; }

.pc-brand {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pc-muted);
}

.pc-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--pc-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.28em;
    transition: color 150ms ease;
}

.product-card:hover .pc-name { color: var(--pc-primary-hover); }

/* Price block: current price on its own line, MRP + % off badge
   together on the line below - so badges align evenly across cards
   regardless of whether a discount is present. */
.pc-price { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; min-height: 44px; }
.pc-price-sub { display: flex; align-items: center; gap: 6px; }

.pc-now {
    font-variant-numeric: tabular-nums;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pc-primary);
}

.pc-mrp {
    color: var(--pc-muted);
    text-decoration: line-through;
    font-size: 0.85rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.pc-off {
    display: inline-flex;
    align-items: center;
    background: var(--pc-offer);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.4;
}

/* Star rating line */
.pc-meta { display: flex; align-items: center; gap: 6px; }
.pc-meta .stars { font-size: 0.8rem; }
.pc-meta .stars iconify-icon { font-size: 14px; width: 14px; height: 14px; }
.pc-meta .stars-fill { color: var(--pc-rate); }
.pc-rate-count { font-size: 0.78rem; color: var(--pc-muted); font-weight: 500; }

/* Actions: Add to cart + wishlist */
.pc-actions { margin-top: auto; padding: 8px 12px 12px; }

.pc-buy { display: flex; gap: 8px; align-items: stretch; }

.pc-add {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 10px;
    background: var(--pc-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.pc-add:hover { background: var(--pc-primary-hover); }
.pc-add:active { transform: translateY(1px); }
.pc-add:disabled { opacity: 0.75; cursor: default; }
.pc-add-ico { display: none; }

.pc-add-out {
    width: 100%;
    height: 38px;
    background: #F1F5F9;
    color: var(--pc-muted);
    border: 1px solid var(--pc-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: not-allowed;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
    .product-card { border-radius: 8px; }

    .pc-body { padding: 4px 10px 6px; gap: 3px; }
    .pc-name { font-size: 0.83rem; min-height: 2.2em; }
    .pc-now { font-size: 0.98rem; }
    .pc-actions { padding: 6px 10px 10px; }

    .pc-buy { gap: 6px; }
    .wishlist-toggle { width: 36px; height: 36px; }

    .pc-off { font-size: 0.74rem; }
    .pc-rate { font-size: 0.78rem; }
    .pc-rate-count { font-size: 0.74rem; }
}
