/* Compact public catalogue tiles. Button colors come from public-controls.css. */
body.fb-product-tiles {
    --tile-surface: var(--catalog-surface, #1d1e20);
    --tile-border: var(--catalog-border, #36383a);
    --tile-text: var(--catalog-text, #f1efe9);
    --tile-muted: var(--catalog-muted, #b5b4ae);
    --tile-subtle: var(--catalog-subtle, #969791);
    --tile-accent: var(--catalog-accent, #e19173);
    --tile-success: var(--catalog-success, #a0c0a5);
    --tile-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-family: var(--tile-font);
    color-scheme: dark;
}

body.fb-product-tiles [hidden] { display: none !important; }
body.fb-product-tiles :is(.category-grid, .category-products) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
    min-width: 0;
}
body.fb-product-tiles :is(.category-section.reveal, .product-card.reveal) {
    opacity: 1;
    transform: none !important;
    animation: none !important;
    transition: none;
}
body.fb-product-tiles .product-card {
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    width: 100%;
    min-width: 0;
    height: auto;
    border: 1px solid var(--tile-border);
    border-radius: 14px;
    background: var(--tile-surface);
    color: var(--tile-text);
    overflow: hidden;
    cursor: default;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none !important;
    transform-style: flat;
    will-change: auto;
    animation: none !important;
    transition: border-color .15s ease;
}
body.fb-product-tiles .product-card:hover { border-color: #68615a; box-shadow: none; }
body.fb-product-tiles .product-card::before { display: none; }
body.fb-product-tiles .product-card .product-img-wrap {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 3 / 4;
    padding: 0;
    border-bottom: 1px solid var(--tile-border);
    background: #18191b;
    color: var(--tile-muted);
    font-size: 14px;
    text-decoration: none;
    overflow: hidden;
}
body.fb-product-tiles .product-card .product-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none !important;
    transition: none;
}
body.fb-product-tiles .product-card .product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
}
body.fb-product-tiles .product-card .product-article {
    margin: 0 0 8px;
    color: var(--tile-subtle);
    font-family: var(--tile-font);
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
body.fb-product-tiles .product-card .product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    min-height: 72px;
    max-height: 72px;
    margin: 0;
    color: var(--tile-text);
    font-family: var(--tile-font);
    font-size: 17px;
    font-weight: 550;
    line-height: 24px;
    letter-spacing: -.01em;
    overflow: hidden;
    overflow-wrap: anywhere;
}
body.fb-product-tiles .product-card .product-title a { color: inherit; text-decoration: none; }
body.fb-product-tiles .product-card .product-title a:hover { color: var(--tile-accent); }
body.fb-product-tiles .product-card :is(.product-img-wrap, .product-title a):focus-visible {
    outline: 2px solid var(--tile-accent);
    outline-offset: -3px;
}
body.fb-product-tiles .product-card .product-bottom {
    display: grid;
    grid-template-rows: minmax(58px, auto) minmax(20px, auto) auto;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    min-width: 0;
}
body.fb-product-tiles .product-card .product-commerce { grid-row: 1; min-width: 0; }
body.fb-product-tiles .product-card .stock-status {
    margin: 0 0 4px;
    color: var(--tile-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
}
body.fb-product-tiles .product-card .stock-status--in_stock { color: var(--tile-success); }
body.fb-product-tiles .product-card .stock-status--out_of_stock { color: #d0ad80; }
body.fb-product-tiles .product-card .catalog-price {
    margin: 0;
    color: var(--tile-text);
    font-size: 22px;
    font-weight: 550;
    line-height: 28px;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
body.fb-product-tiles .product-card .catalog-price span {
    color: var(--tile-subtle);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
}
body.fb-product-tiles .product-card .price-note {
    margin: 0;
    color: var(--tile-muted);
    font-size: 13px;
    line-height: 20px;
}
/* The small promotion row keeps actions aligned with cards without a promotion. */
body.fb-product-tiles .product-card .product-promo-summary {
    grid-row: 2;
    margin: 0;
    color: #f2b79d;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    overflow-wrap: anywhere;
}
body.fb-product-tiles .product-card .product-actions {
    grid-row: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: 8px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}
body.fb-product-tiles .product-card :is(.product-link, .product-btn) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 10px 8px;
    font-size: 13px;
    white-space: normal;
}

@media (max-width: 1000px) {
    body.fb-product-tiles :is(.category-grid, .category-products) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    body.fb-product-tiles :is(.category-grid, .category-products) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 380px) {
    body.fb-product-tiles .product-card .product-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    body.fb-product-tiles .product-card { transition: none; }
}

/* Keep labels intact when the three-column grid creates narrow tiles. */
body.fb-product-tiles.fb-public-controls .product-card :is(.product-link, .product-btn) { white-space: nowrap; }
@container (max-width: 330px) {
    body.fb-product-tiles.fb-public-controls .product-card .product-actions { grid-template-columns: minmax(0, 1fr); }
}
@supports not (container-type: inline-size) {
    @media (min-width: 1001px) and (max-width: 1100px), (min-width: 561px) and (max-width: 730px), (max-width: 380px) {
        body.fb-product-tiles.fb-public-controls .product-card .product-actions { grid-template-columns: minmax(0, 1fr); }
    }
}
/* The catalogue uses the same system font in its navigation. */
body.fb-product-tiles { --font-display: var(--tile-font); --font-body: var(--tile-font); }
@media (max-width: 360px) {
    body.fb-product-tiles .fb-header-inner { padding-right: 16px; padding-left: 16px; gap: 8px; }
    body.fb-product-tiles .fb-primary { gap: 4px; }
    body.fb-product-tiles .fb-wordmark { font-size: 18px; }
    body.fb-product-tiles.fb-public-controls .fb-primary > a,
    body.fb-product-tiles.fb-public-controls .fb-menu > summary { padding-right: 8px; padding-left: 8px; white-space: nowrap; }
}
