.product-card {
    /* max-width: 18rem; */
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;

    display: grid;
    --product-media-height: clamp(150px, 22vw, 210px);
    grid-template-rows: var(--product-media-height) auto;
}

.product-card .product-media {
    width: 100%;
    height: var(--product-media-height);
    background: rgba(241, 241, 248, 0.7);
    border-bottom: 1px solid var(--border);

    display: grid;
    overflow: hidden;
}

.product-card .product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content area */
.product-card .product-content {
    padding: 0.95rem 0.95rem 1rem;
    display: grid;
    gap: 0.65rem;
}

/* Header row: title + price */
.product-card .product-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    align-items: start;
}

.product-card .product-title {
    margin: 0;
    font-size: var(--font-size-base);
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1.2;
}

.product-card .product-price {
    font-weight: var(--font-weight-bold);
    color: var(--text);
    white-space: nowrap;
    justify-self: end;
}

.product-card .price-tax-note {
    color: #9aa0a6;
    font-size: var(--font-size-xxs);
}

.product-card .product-subtitle {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--secondary-text);
}

/* Meta row: rating / tag / stock */
.product-card .product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    align-items: center;
}

.product-card .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.65);
    color: var(--secondary-text);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.product-card .badge.primary {
    border-color: rgba(49, 145, 219, 0.25);
    background: rgba(49, 145, 219, 0.10);
    color: var(--primary);
}

.product-card .badge.positive {
    border-color: rgba(137, 187, 148, 0.25);
    background: rgba(137, 187, 148, 0.12);
    color: var(--positive);
}

.product-card .badge.negative {
    border-color: rgba(200, 97, 97, 0.25);
    background: rgba(200, 97, 97, 0.10);
    color: var(--negative);
}

.product-card .badge.warning {
    border-color: rgba(189, 135, 0, 0.35);
    background: rgba(189, 135, 0, 0.18);
    color: var(--warning);
}

/* Description (optional) */
.product-card .product-desc {
    margin: 0;
    color: var(--secondary-text);
    font-size: var(--font-size-sm);
    line-height: 1.35;
}

/* Actions */
.product-card .product-actions {
    margin-top: 0.2rem;
}

.product-card .product-form {
    display: grid;
    gap: 0.6rem;
    min-width: 0;
}

.product-card .purchase-field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.product-card .field-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--secondary-text);
}

.product-card .purchase-field input,
.product-card .purchase-field select {
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font-weight: var(--font-weight-bold);
    padding: 0 0.75rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.saudi-riyal-select,
.saudi-riyal-select option {
    font-family: "Saudi Riyal", "saudi_riyal", "saudi-riyal", sans-serif;
}

.product-card .qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.product-card .qty button {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: var(--secondary-text);
    cursor: pointer;
    font-weight: var(--font-weight-bold);
    transition: background var(--td-fast) ease, color var(--td-fast) ease;
}

.product-card .qty button:hover {
    background: rgba(49, 145, 219, 0.08);
    color: var(--text);
}

.product-card .qty input,
.product-card .qty span {
    width: 46px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-inline: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-weight: var(--font-weight-bold);
    text-align: center;
}

/* Primary CTA */
.product-card .btn-primary {
    min-height: 38px;
    height: auto;
    padding: 0 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(49, 145, 219, 0.35);
    background: linear-gradient(180deg,
            rgba(49, 145, 219, 0.95),
            rgba(49, 145, 219, 0.82));
    color: var(--white);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: transform var(--td-fast) ease, filter var(--td-fast) ease;
    white-space: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.product-card .btn-primary:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.product-card .btn-primary:active {
    transform: translateY(0);
}

/* Secondary (outline) */
.product-card .btn-outline {
    min-height: 38px;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: transform var(--td-fast) ease, border-color var(--td-fast) ease;
    text-decoration: none;
    padding: 0.4rem 0.9rem;
    white-space: normal;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.product-card .btn-outline:hover {
    border-color: rgba(49, 145, 219, 0.35);
    transform: translateY(-1px);
}

.product-card .btn-outline:active {
    transform: translateY(0);
}

/* hover / focus */
.product-card:hover {
    border-color: rgba(49, 145, 219, 0.25);
}

.product-card :is(button, a, input, select):focus-visible {
    outline: 3px solid rgba(49, 145, 219, 0.35);
    outline-offset: 2px;
}

/* Compact variant (optional) */
.product-card.compact .product-content {
    padding: 0.8rem 0.85rem;
    gap: 0.55rem;
}

@media (max-width: 520px) {
    .product-card .action-buttons {
        width: 100%;
    }

    .product-card .btn-primary,
    .product-card .btn-outline {
        width: 100%;
    }
}

/* --- variants --- */
.product-card.is-list {
    grid-template-rows: 1fr;
    grid-template-columns: 260px 1fr;
}

.product-card.is-list .product-media {
    border-bottom: 0;
    border-inline-end: 1px solid var(--border);
    aspect-ratio: auto;
    min-height: 100%;
}

.product-card.is-list .product-content {
    padding: 1rem 1rem 1rem;
}

.product-card.compact .product-desc {
    display: none;
}

/* --- clickable helpers --- */
.product-link,
.product-title-link {
    text-decoration: none;
    color: inherit;
}

/* --- image hover --- */
.product-image-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--td-fast) ease;
}

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

/* --- wishlist icon --- */
.product-media {
    position: relative;
}

.wishlist-btn {
    position: absolute;
    top: 0.65rem;
    inset-inline-end: 0.65rem;

    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.75);
    color: var(--secondary-text);
    cursor: pointer;

    display: grid;
    place-items: center;

    transition:
        transform var(--td-fast) ease,
        border-color var(--td-fast) ease,
        color var(--td-fast) ease,
        background var(--td-fast) ease;
}

.wishlist-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(49, 145, 219, 0.35);
    color: var(--text);
}

.wishlist-btn[aria-pressed="true"] {
    color: var(--primary);
    border-color: rgba(49, 145, 219, 0.35);
    background: rgba(49, 145, 219, 0.10);
}

/* --- actions layout tweak (to allow two buttons) --- */
.product-card .action-buttons {
    display: flex;
    justify-content: stretch;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.product-card .action-buttons .btn-outline,
.product-card .action-buttons .btn-primary {
    flex: 1;
    width: 100%;
    min-width: 0;
}

@media (max-width: 520px) {
    .product-card.is-list {
        grid-template-columns: 1fr;
    }

    .product-card.is-list .product-media {
        border-inline-end: 0;
        border-bottom: 1px solid var(--border);
        min-height: auto;
    }

    .product-card .action-buttons {
        width: 100%;
        justify-content: stretch;
    }

    .product-card .action-buttons .btn-outline,
    .product-card .action-buttons .btn-primary {
        width: 100%;
    }
}

/* --- skeleton loader --- */
.product-card.is-loading {
    pointer-events: none;
}

.skeleton {
    border-radius: 12px;
    background: rgba(230, 231, 241, 0.7);
}

.skeleton-media {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.skeleton-line {
    height: 14px;
}

.skeleton-line.title {
    height: 18px;
    width: 70%;
}

.skeleton-line.price {
    height: 18px;
    width: 70px;
    justify-self: end;
}

.skeleton-line.subtitle {
    width: 55%;
}

.skeleton-line.desc {
    width: 92%;
}

.skeleton-line.desc.short {
    width: 70%;
}

.skeleton-pill {
    height: 26px;
    width: 92px;
    border-radius: 999px;
}

.skeleton-btn {
    height: 38px;
    border-radius: 12px;
}

/* match media skeleton in both variants */
.product-card.is-loading .product-media {
    display: grid;
    place-items: stretch;
}