/* Shared commerce card layer. Loaded only on pages with product cards. */

.product-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(180deg, #fbf9f5 0%, #f1ebe3 100%);
    z-index: 1;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.product-card__media-track {
    height: 90%;
    display: flex;
    transition: transform 260ms ease;
    will-change: transform;
    touch-action: pan-y;
    gap: 0;
}

.product-card__media-track img {
    flex: 0 0 100%;
}

.product-card__media-dots {
    position: absolute;
    left: 50%;
    bottom: 0.65rem;
    transform: translateX(-50%);
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem 0.35rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 4;
}

.product-card__media-dot {
    width: 0.36rem;
    height: 0.36rem;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.product-card__media-dot.is-active {
    background: rgba(255, 255, 255, 0.92);
}

.product-card__media--placeholder img {
    display: none;
}

.product-card__media--placeholder::after {
    content: attr(data-placeholder-text);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: rgba(33, 29, 27, 0.35);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
    background: #e9e9ea;
}

.product-card__favorite svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}

.product-card__favorite.icon-button {
    align-items: center;
    justify-content: center;
}

.product-card__media--placeholder img {
    object-fit: contain;
    transform: none;
}

.product-card:hover .product-card__media img {
    transform: scale(1.03);
}

.product-card:hover .product-card__media--placeholder img {
    transform: none;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
}

.product-card__overlay-link {
    position: absolute;
    inset: 0;
    z-index: 0;
    cursor: pointer;
    pointer-events: none;
}

.product-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.46rem;
    height: auto;
    position: relative;
    z-index: 3;
    padding: 1.05rem 1rem 0.95rem;
}

.product-card__title {
    display: -webkit-box;
    overflow: hidden;
    font-family: var(--font-body);
    line-height: 1.15;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: clamp(0.98rem, 1.25vw, 1.12rem);
}

.product-card__details {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: -0.25rem;
}

.product-card__details+.product-card__summary {
    margin-top: -0.35rem;
}

.product-card__summary {
    color: var(--color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.36;
    min-height: calc(1.36em * 3);
    font-size: 0.92rem;
}

.product-card__footer {
    margin-top: auto;
    padding-top: 0.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    border-top: 1px solid rgba(33, 29, 27, 0.08);
}

.product-card__price-wrap {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    overflow: hidden;
}

.product-card__price {
    font-family: var(--font-body);
    line-height: 0.96;
    font-size: clamp(0.96rem, 1.3vw, 1.22rem);
    margin-bottom: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    font-variant-numeric: tabular-nums;
}

.product-card__price--compact {
    font-size: clamp(0.82rem, 1vw, 0.96rem);
    letter-spacing: 0.01em;
    max-width: 7rem;
}

.product-card__stock {
    font-size: 0.54rem;
    letter-spacing: 0.15em;
}

.product-card__popularity {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: var(--color-muted);
}

/* Home recommendations: keep spacing from next sections and never show empty-state placeholders */
.products#products {
    padding-bottom: 8rem;
}

.products#products .products__grid {
    margin-bottom: 2rem;
}

.products#products .catalog-results__empty {
    display: none;
}

.products#products .product-card__summary {
    display: none;
}

.products#products .product-card__details,
.products#products .product-card__sizes {
    display: none;
}

.product-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    min-width: max-content;
}

.product-card__cta {
    white-space: nowrap;
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    min-height: 2.2rem;
    padding: 0.55rem 0.74rem;
    font-size: 0.56rem;
    letter-spacing: 0.12em;
}

.product-card__favorite {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 4;
}

.product-card__cart {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    align-self: center;
    width: 2.2rem;
    height: 2.2rem;
}

.product-card__cart.is-loading,
.product-card__cart.is-added,
.product-card__cart.is-error {
    border-color: rgba(33, 29, 27, 0.18);
}

.product-card__cart.is-added {
    color: var(--color-accent);
}

.product-card__cart.is-error {
    color: #a53a3a;
}

/* Keep every price inside the space left by the card actions. */
.product-card__footer {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    max-width: 100%;
}

.product-card__price-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    container-type: inline-size;
}

.product-card__price-wrap .product-card__price {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    white-space: nowrap;
    text-wrap: nowrap;
    overflow: hidden;
    overflow-wrap: normal;
    word-break: keep-all;
}

.product-card__price-wrap .product-card__price--compact {
    font-size: clamp(0.5rem, 12cqi, 0.92rem);
    line-height: 1;
    letter-spacing: -0.025em;
}

.product-card__footer:has(.product-card__price--compact) {
    gap: 0.3rem;
}

.product-card__footer:has(.product-card__price--compact) .product-card__actions {
    gap: 0.25rem;
}

@supports not (font-size: 1cqi) {
    .product-card__price-wrap .product-card__price--compact {
        font-size: 0.5rem;
    }
}
