/* ═════════════════════════════════════════════════════════════════════════════
   recent.css — the "Recently viewed" row (assets/js/recent-viewed.js).
   Linked on the homepage and the product page. Tokens only; both pages load the tokens
   (index via style.css, product via product.css).
   ═════════════════════════════════════════════════════════════════════════════ */

/* Homepage placement: aligned with the carousels below it. */
.recent-section {
    max-width: var(--page-max);
    margin: var(--space-12) auto 0;
    padding: 0 var(--page-gutter);
}

.recent-section .recent-head h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.01em;
}

.recent-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.recent-head h2 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: 600;
    line-height: var(--leading-tight, 1.2);
    color: var(--color-fg-default);
}

.recent-clear {
    padding: var(--space-1) 0;
    background: none;
    border: 0;
    font: inherit;
    font-size: var(--text-ui);
    font-weight: 500;
    color: var(--color-fg-muted);
    text-decoration: underline;
    text-decoration-color: var(--color-border-strong);
    text-underline-offset: 4px;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .recent-clear:hover { color: var(--color-fg-default); }
}

/* One scrolling row, like the app. */
.recent-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 9.5rem;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.recent-card {
    display: block;
    min-width: 0;
    overflow: hidden;
    scroll-snap-align: start;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: inherit;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .recent-card:hover { border-color: var(--color-border-input); text-decoration: none; }
}

.recent-ph {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg-muted);
}

.recent-ph img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--color-bg-surface); }

/* Neutral, not red: a discount is not a problem state. */
.recent-off {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    padding: 0 0.3125rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-bg-surface);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--color-fg-default);
}

.recent-name {
    display: block;
    padding: var(--space-2) var(--space-2) 0;
    overflow: hidden;
    font-size: var(--text-small);
    line-height: 1.35;
    color: var(--color-fg-default);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.recent-price {
    display: block;
    padding: 0.125rem var(--space-2) var(--space-2);
    font-size: var(--text-ui);
    font-weight: 600;
    color: var(--color-fg-default);
    font-variant-numeric: tabular-nums;
}

.recent-was {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-fg-subtle);
}

@media (max-width: 768px) {
    .recent-section { margin-top: var(--space-8); }
    .recent-row { grid-auto-columns: 8.25rem; }
}
