.products-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: calc(var(--header-offset) + 1.5rem) 1rem 3rem;
    background: var(--bc-bg);
}

/* Avoid double-counting --header-offset: styles.css gives main a margin-top; shell padding also includes it. */
body > nav.nav-full + main.products-shell {
    margin-top: 0;
}

.products-title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: var(--bc-ink);
}

.products-subtitle {
    margin: 0 0 1.5rem;
    color: var(--bc-text-muted);
    max-width: 56ch;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* ─── Filter Chip Row ────────────────────────── */

.products-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.bc-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bc-surface);
    border: 1px solid var(--bc-border);
    color: var(--bc-ink);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--bc-radius-pill);
    cursor: pointer;
    transition: var(--transition-fast);
}

.bc-chip:hover {
    background: var(--bc-bg);
    border-color: var(--bc-border-strong);
}

.bc-chip--active {
    background: var(--bc-clay-soft);
    border-color: var(--bc-clay);
    color: var(--bc-text-clay-deep);
}

/* ─── Country Filter Bar ──────────────────── */

.products-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.products-filter-label {
    font-size: 0.88rem;
    color: var(--bc-text-muted);
    white-space: nowrap;
}

.products-filter-select-wrap {
    position: relative;
}

.products-filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bc-surface);
    border: 1px solid var(--bc-border);
    border-radius: 8px;
    color: var(--bc-ink);
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.35rem 2rem 0.35rem 0.7rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23D8A07E' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 150ms ease;
}

.products-filter-select:focus {
    outline: 2px solid var(--bc-clay-soft);
    outline-offset: 2px;
    border-color: var(--bc-clay);
}

.products-filter-select:hover {
    border-color: var(--bc-border-strong);
}

.products-filter-currency {
    font-size: 0.8rem;
    color: var(--bc-text-muted);
    font-weight: 500;
}

.products-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

/* ─── Card ──────────────────────────────────── */

.product-card {
    position: relative;
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-card);
    overflow: hidden;
    background: var(--bc-surface);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

/* Card is a div - media + title link to editor; footer CTAs are separate controls */
a.product-card-media {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    outline: none;
}

a.product-card-media:focus-visible {
    outline: 2px solid var(--bc-clay);
    outline-offset: 2px;
}

a.product-name-link {
    text-decoration: none;
    color: inherit;
    align-self: flex-start;
}

a.product-name-link:hover .product-name {
    color: var(--bc-clay);
}

.product-card:hover {
    border-color: var(--bc-border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-card:focus-visible {
    outline: 2px solid var(--bc-clay);
    outline-offset: 2px;
}

/* ─── Image ──────────────────────────────────── */

.product-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(140deg, #E9DDD3, #DCCABD);
    overflow: hidden;
    flex-shrink: 0;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 140ms ease-out, transform 300ms ease;
}

.product-card:hover .product-image-wrap img {
    transform: scale(1.03);
}

.product-image-wrap img[data-loading="true"] {
    opacity: 0.35;
    position: relative;
    z-index: 1;
}

.product-image-wrap:has(img[data-loading="true"])::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    background-size: 200% 100%;
    animation: products-image-shimmer 1.2s ease-in-out infinite;
}

@keyframes products-image-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.product-ribbon-slot[hidden] {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.product-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    min-width: 52px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 9px;
    background: var(--bc-clay);
    color: var(--bc-decision-cta-text);
    font-size: 0.82rem;
    font-weight: 800;
    z-index: 1;
    pointer-events: none;
}

/* ─── Body ──────────────────────────────────── */

.product-body {
    padding: 0.9rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.product-name {
    margin: 0;
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bc-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    margin: 0;
    color: var(--bc-text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--bc-clay);
    margin-top: 0.15rem;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.product-price-list {
    color: var(--bc-text-muted);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: line-through;
}

.product-price-sale {
    color: var(--bc-clay);
    font-size: 1.5rem;
    font-weight: 800;
}

.product-price--pending {
    color: var(--bc-text-muted);
    font-weight: 600;
    font-size: 0.88rem;
}

.product-price-pending-text {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 6px;
    min-height: 1.1em;
    min-width: 5.5rem;
    padding: 0.1rem 0;
    color: transparent;
    background: rgba(0, 0, 0, 0.06);
}

.product-price-pending-text::after {
    content: "Pricing…";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--bc-text-muted);
    font-weight: 600;
}

.product-price-pending-text::before {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: products-shimmer 1.3s infinite;
}

.product-price--on-request {
    color: var(--bc-text-muted);
    font-weight: 600;
    font-size: 0.88rem;
}

@media (max-width: 539px) {
    .product-price {
        white-space: nowrap;
        overflow: visible;
        flex-wrap: nowrap;
    }

    .product-price-sale {
        font-size: 1.25rem;
    }

    .product-price-list {
        font-size: 0.85rem;
    }
}

/* ─── CTA row ─────────────────────────────── */

.product-footer {
    padding: 0 0.9rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
}

.product-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 9px;
    background: var(--bc-decision);
    color: var(--bc-decision-text);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    min-height: 38px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    flex: 1;
    transition: background 150ms ease;
}

.product-cta:hover {
    filter: brightness(1.1);
}

.product-cta:focus-visible {
    outline: 2px solid var(--bc-clay);
    outline-offset: 2px;
}

.product-cta:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ─── Skeleton / Loading states ──────────────── */

.products-loading .product-card {
    pointer-events: none;
}

.product-skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
}

.product-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    animation: products-shimmer 1.3s infinite;
}

.product-image-wrap.product-skeleton {
    border-radius: 0;
}

.products-error {
    margin-top: 0.5rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 130, 130, 0.3);
    border-radius: 12px;
    color: #ffd5d5;
    background: rgba(190, 70, 70, 0.12);
    grid-column: 1 / -1;
}

.products-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 1.25rem auto 0;
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--bc-border);
    border-radius: 999px;
    background: var(--bc-surface);
    color: var(--bc-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 150ms ease, transform 150ms ease;
}

.products-load-more:hover {
    border-color: var(--bc-border-strong);
    transform: translateY(-1px);
}

.products-load-more:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.products-load-more[hidden] {
    display: none;
}

@keyframes products-shimmer {
    to { transform: translateX(100%); }
}

/* ─── Price info icon button ─────────────── */

.product-price-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--text-muted, rgba(255,255,255,0.38));
    flex-shrink: 0;
    transition: color 150ms ease;
}

.product-price-info-btn:hover {
    color: var(--text-secondary, rgba(255,255,255,0.6));
}

/* ─── Price info popup ───────────────────── */

.price-info-popup {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
}

.price-info-popup.active {
    opacity: 1;
    visibility: visible;
}

.price-info-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(90, 79, 71, 0.35);
}

.price-info-popup-card {
    position: relative;
    width: 100%;
    max-width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-md);
    z-index: 1;
}

.price-info-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.price-info-popup-header strong {
    font-weight: 700;
}

.price-info-popup-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.price-info-popup-body {
    margin: 0 0 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.price-info-popup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    border: none;
    border-radius: var(--radius-btn, 9px);
    background: var(--accent, #e8c547);
    color: var(--bc-decision-cta-text);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms ease;
}

.price-info-popup-btn:hover {
    background: #f0d45c;
}

@media (max-width: 539px) {
    .price-info-popup {
        align-items: flex-end;
        padding: 0;
    }

    .price-info-popup-card {
        max-width: none;
        border-radius: 18px 18px 0 0;
        padding: 24px 24px 32px;
    }

    .price-info-popup-btn {
        height: 46px;
        font-size: 0.9rem;
    }
}

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

@media (min-width: 540px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 900px) {
    .products-shell {
        padding: calc(var(--header-offset) + 2rem) 1.5rem 4rem;
    }
    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.1rem;
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.2rem;
    }
}
