/**
 * PDP recirculation rows (pdp-recirculation.php)
 *
 * Layout + card styling for the "More from <aisle>" / "Goes well with" /
 * "More from <brand>" / "Keep browsing" blocks after the product.
 *
 * Colour values come from the customizer-styles.css token palette with
 * literal fallbacks; this file declares no new tokens (see the policy note
 * at the top of eg-layout-modes.css).
 */

.eg-recirc {
    max-width: 1200px;
    margin: 2.5rem auto 1.5rem;
    padding: 0 1rem;
    font-family: brandon-grotesque, sans-serif;
}

.eg-recirc__row {
    margin-bottom: 2.25rem;
}

.eg-recirc__row:last-child {
    margin-bottom: 0;
}

.eg-recirc__title {
    font-size: 20px;
    font-weight: 500;
    color: var(--eg-accent, #2c5e54);
    margin: 0 0 1rem;
}

.eg-recirc__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

/* ── Cards ─────────────────────────────────────────────────────────── */

.eg-recirc-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: var(--eg-card-bg, #ffffff);
    border: 1px solid var(--eg-card-border, #dce8e4);
    border-radius: 6px;
    padding: 0.85rem;
    text-decoration: none;
    color: var(--eg-ink-strong, #222222);
    transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.eg-recirc-card:hover,
.eg-recirc-card:focus-visible {
    text-decoration: none;
    border-color: var(--eg-brand-sage, #a5ccbc);
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.eg-recirc-card:focus-visible {
    outline: 2px solid var(--eg-brand-sage, #a5ccbc);
    outline-offset: 2px;
}

.eg-recirc-card__media {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    background: var(--eg-surface-mint, #eef6f1);
    margin-bottom: 0.35rem;
}

.eg-recirc-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.eg-recirc-card__brand {
    font-size: 11px;
    font-style: italic;
    color: var(--eg-ink-body-soft, #5a6b65);
    line-height: 1.3;
}

.eg-recirc-card__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eg-recirc-card__price {
    font-size: 13px;
    font-weight: 600;
    color: var(--eg-accent, #2c5e54);
    margin-top: auto;
}

.eg-recirc-card__price del {
    color: var(--eg-ink-body-soft, #5a6b65);
    font-weight: 400;
    margin-right: 0.3em;
}

/* ── Keep-browsing pills ───────────────────────────────────────────── */

.eg-recirc__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* The shared .eg-cat-pill carries a leading ← ("go back into this
   category"). These pills point outward, so swap it for a trailing →. */
.eg-recirc .eg-cat-pill--fwd::before {
    content: none;
}

.eg-recirc .eg-cat-pill--fwd::after {
    content: "\2192";
    font-size: 0.9em;
    color: var(--eg-accent, #2c5e54);
    margin-left: 0.05rem;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .eg-recirc__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .eg-recirc__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .eg-recirc__title {
        font-size: 18px;
    }

    .eg-recirc-card {
        padding: 0.65rem;
    }
}
