/**
 * File: assets/css/frontend/catalog/product-card.css
 * Purpose: Styles the single global HyperDAF product card used across commerce listings.
 * Scope: Product-card media, metadata, price and actions only.
 * Related PHP: src/Product/Catalog/Frontend/ProductCardRenderer.php
 * Related CSS: assets/css/frontend/header-widgets/widgets.css
 * Related JS: None
 * Package: HyperDAF Engine
 */

.hdf-product-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hdf-engine-color-admin-border-subtle);
    border-radius: 14px;
    background: var(--hdf-engine-color-surface);
    box-shadow: 0 2px 8px rgb(16 24 40 / 4%);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.hdf-product-card:hover {
    border-color: color-mix(in srgb, var(--hdf-engine-color-primary-strong) 28%, var(--hdf-engine-color-admin-border));
    box-shadow: 0 12px 30px rgb(16 24 40 / 9%);
    transform: translateY(-2px);
}

.hdf-product-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--hdf-engine-color-surface);
}

.hdf-product-card__media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hdf-product-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right top;
    transform: scale(1.015);
    transform-origin: top right;
    transition: transform .22s ease;
}

.hdf-product-card:hover .hdf-product-card__image {
    transform: scale(1.04);
}

.hdf-product-card__placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: linear-gradient(145deg, var(--hdf-engine-color-admin-canvas), var(--hdf-engine-color-admin-border-subtle));
}

.hdf-product-card__placeholder span {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    place-items: center;
    border-radius: var(--hdf-engine-radius-round);
    background: var(--hdf-engine-color-surface);
    color: var(--hdf-engine-color-primary-strong, var(--hdf-engine-color-primary-strong));
    font-weight: 800;
}

.hdf-product-card__badge {
    position: absolute;
    z-index: 2;
    top: .55rem;
    left: .55rem;
    padding: .28rem .48rem;
    border-radius: var(--hdf-engine-radius-pill);
    background: var(--hdf-engine-color-text);
    color: var(--hdf-engine-color-surface);
    font-size: .65rem;
    font-weight: 750;
}

.hdf-product-card__body {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.hdf-product-card__title {
    min-width: 0;
    margin: 0;
    padding: .78rem .82rem .42rem;
    overflow: hidden;
    font-size: .94rem;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hdf-product-card__title a {
    color: var(--hdf-engine-color-info-text);
    text-decoration: none;
    transition: color .18s ease, text-decoration-color .18s ease;
}

.hdf-product-card__title a:hover,
.hdf-product-card__title a:focus-visible {
    color: color-mix(in srgb, var(--hdf-engine-color-info-text) 74%, var(--hdf-engine-color-text));
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: .18em;
}

.hdf-product-card__insights {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .45rem;
    padding: 0 .82rem .72rem;
    color: var(--hdf-engine-color-text-muted);
    font-size: .67rem;
}

.hdf-product-card__author {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hdf-product-card__author strong {
    color: var(--hdf-engine-color-wp-action);
    font-weight: 500;
}

.hdf-product-card__sales {
    white-space: nowrap;
}

.hdf-product-card__rating {
    display: inline-flex;
    gap: .02rem;
    white-space: nowrap;
}

.hdf-product-card__star {
    color: transparent;
    -webkit-text-stroke: .85px var(--hdf-engine-color-rating);
    font-size: .9rem;
    line-height: 1;
}

.hdf-product-card__star.is-filled {
    color: var(--hdf-engine-color-rating);
    -webkit-text-stroke: .85px var(--hdf-engine-color-rating);
}

.hdf-product-card__footer {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-top: auto;
    padding: .58rem .82rem;
    border-top: 1px solid var(--hdf-engine-color-border-subtle);
}

.hdf-product-card__price {
    min-width: 0;
}

.hdf-price {
    display: grid;
    grid-template-columns: auto auto;
    align-items: baseline;
    justify-content: start;
    column-gap: .25rem;
    row-gap: .2rem;
}

.hdf-price__current {
    grid-column: 1;
    color: var(--hdf-engine-color-text);
    font-size: .95rem;
    font-weight: 750;
    letter-spacing: -.015em;
    line-height: 1.05;
}

.hdf-price del {
    grid-column: 1 / -1;
    grid-row: 1;
    color: var(--hdf-engine-color-danger);
    font-size: .7rem;
    line-height: 1;
}

.hdf-price--sale .hdf-price__current { grid-row: 2; }
.hdf-price--sale .hdf-price__billing { grid-row: 2; }

.hdf-price__billing,
.hdf-price--unavailable {
    color: var(--hdf-engine-color-text-muted);
    font-size: .68rem;
    line-height: 1.05;
}

.hdf-price--unavailable { display: inline-block; }

.hdf-product-card__purchase {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: .42rem;
}

.hdf-product-card__cart-form {
    margin: 0;
}

.hdf-product-card__cart-button,
.hdf-product-card__preview {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hdf-engine-color-border);
    border-radius: 0;
    background: var(--hdf-engine-color-surface);
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.hdf-product-card__cart-button {
    width: 36px;
    padding: 0;
    color: color-mix(in srgb, var(--hdf-engine-color-text) 72%, transparent);
    cursor: pointer;
}

.hdf-product-card__cart-button .hdf-engine-icon,
.hdf-product-card__cart-button svg {
    width: 18px;
    height: 18px;
}

.hdf-product-card__preview {
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    padding: .42rem .45rem;
    border-color: var(--hdf-engine-color-info);
    border-radius: 0;
    color: var(--hdf-engine-color-info-text);
    font-size: .7rem;
    font-weight: 600;
    white-space: nowrap;
}

.hdf-product-card__cart-button:hover,
.hdf-product-card__cart-button:focus-visible {
    border-color: var(--hdf-engine-color-primary-strong);
    background: var(--hdf-engine-color-surface);
    color: var(--hdf-engine-color-primary-strong);
}

.hdf-product-card__preview:hover,
.hdf-product-card__preview:focus-visible {
    border-color: var(--hdf-engine-color-info-text);
    background: var(--hdf-engine-color-info-text);
    color: var(--hdf-engine-color-surface);
}

.hdf-product-card .hdf-product-list-actions {
    top: auto;
    right: auto;
    bottom: .55rem;
    left: .55rem;
    flex-wrap: nowrap;
}

.hdf-product-card .hdf-product-list-action__button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-color: var(--hdf-engine-color-border);
    border-radius: var(--hdf-engine-radius-round);
    box-shadow: 0 2px 5px rgb(16 24 40 / 12%);
}

.hdf-product-card .hdf-product-list-action__button span {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.hdf-products-grid--list .hdf-product-card {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
}

.hdf-products-grid--list .hdf-product-card__media {
    height: 100%;
    min-height: 180px;
    aspect-ratio: auto;
}

.hdf-products-grid--list .hdf-product-card__title {
    padding-top: 1rem;
    font-size: 1.05rem;
    white-space: normal;
}

/* RC.13 commercial card geometry and AJAX cart interaction. */
.hdf-product-card,
.hdf-product-card:hover,
.hdf-product-card:focus-within {
    border-radius: 0;
}

.hdf-product-card:hover,
.hdf-product-card:focus-within {
    border-color: var(--hdf-engine-color-admin-border);
}

.hdf-product-card__cart-button .hdf-engine-icon--header-cart {
    width: 19px;
    height: 18px;
    fill: currentColor;
}

.hdf-product-card__cart-button.is-loading {
    color: var(--hdf-engine-color-text-muted);
    cursor: wait;
    opacity: .68;
}

.hdf-product-card__cart-button.is-added {
    border-color: var(--hdf-engine-color-primary-strong);
    color: var(--hdf-engine-color-primary-strong);
}

.hdf-product-card__cart-button.is-added .hdf-engine-icon {
    animation: hdf-cart-icon-confirm .42s ease;
}

@keyframes hdf-cart-icon-confirm {
    0% { transform: scale(.82); }
    55% { transform: scale(1.16); }
    100% { transform: scale(1); }
}


/* RC.14 equal action geometry, persistent cart confirmation and compact sale-price stack. */
.hdf-product-card__cart-button,
.hdf-product-card__preview,
.hdf-product-card__cart-button:hover,
.hdf-product-card__preview:hover,
.hdf-product-card__cart-button:focus-visible,
.hdf-product-card__preview:focus-visible {
    border-radius: 0;
}

.hdf-product-card__cart-icon {
    display: inline-grid;
    width: 19px;
    height: 19px;
    place-items: center;
}

.hdf-product-card__cart-icon--check { display: none; }

.hdf-product-card__cart-button.is-added {
    border-color: var(--hdf-engine-color-primary-strong);
    color: var(--hdf-engine-color-primary-strong);
}

.hdf-product-card__cart-button.is-added .hdf-product-card__cart-icon--cart { display: none; }
.hdf-product-card__cart-button.is-added .hdf-product-card__cart-icon--check { display: inline-grid; }

.hdf-product-card__cart-button.is-added .hdf-engine-icon--check {
    width: 18px;
    height: 18px;
    animation: hdf-cart-icon-confirm .42s ease;
}
