/* ==========================================================================
   Le Belle Arti — Shop / Category Archive
   ========================================================================== */

/* ── Page header ── */
.lba-archive {
    padding-top: calc(99px + var(--lba-space-xl)); /* header + pre-header */
    padding-bottom: var(--lba-space-4xl);
    min-height: 60vh;
}

.admin-bar .lba-archive {
    padding-top: calc(131px + var(--lba-space-xl));
}

/* When a hero is present, remove top padding — hero fills the space */
.lba-archive:has(.lba-archive__hero),
.lba-brands-page:has(.lba-archive__hero),
.lba-archive.lba-contract-page {
    padding-top: 0;
}

/* Hero styles live in main.css (.lba-archive__hero) — shared across all page types */

.lba-archive__empty {
    font-family: var(--lba-font-secondary);
    font-size: 0.9375rem;
    color: var(--lba-gray-500);
    padding: var(--lba-space-3xl) 0;
    text-align: center;
}

.lba-archive__header {
    padding-bottom: var(--lba-space-xl);
    border-bottom: 1px solid var(--lba-gray-200);
    margin-bottom: var(--lba-space-sm);
}

/* When subcategory strip is present, tighten up and strip its border */
.lba-archive__header .lba-filter-bar {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.lba-archive__header:has(.lba-filter-bar) {
    padding-bottom: var(--lba-space-md);
}

.lba-archive__title {
    font-family: var(--lba-font-primary);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    color: var(--lba-black);
    margin: 0.5rem 0 0;
    letter-spacing: -0.01em;
}

.lba-archive__description {
    font-family: var(--lba-font-secondary);
    font-size: 0.9375rem;
    color: var(--lba-gray-500);
    line-height: 1.6;
    max-width: 600px;
    margin-top: 0.75rem;
}

/* ── Brand hero (taxonomy-product_brand pages) ── */
.lba-brand-hero {
    padding-bottom: var(--lba-space-xl);
    border-bottom: 1px solid var(--lba-gray-200);
    margin-bottom: 0;
}

.lba-brand-hero__desc {
    max-width: 680px;
}

/* ── Filter bar ── */
.lba-filter-bar {
    padding: var(--lba-space-md) 0;
    border-bottom: 1px solid var(--lba-gray-200);
    margin-bottom: var(--lba-space-lg);
}

.lba-filter-bar__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
    align-items: center;
}

.lba-filter-bar__pill {
    display: inline-block;
    padding: 0.25rem 0;
    font-family: var(--lba-font-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lba-gray-400);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.lba-filter-bar__pill:hover {
    color: var(--lba-black);
    border-bottom-color: var(--lba-black);
}

.lba-filter-bar__sep {
    font-family: var(--lba-font-secondary);
    color: var(--lba-gray-300);
    font-size: 0.6875rem;
    line-height: 1;
    user-select: none;
    padding: 0 0.25rem;
}

.lba-filter-bar__pill.is-active {
    color: var(--lba-black);
    border-bottom-color: var(--lba-black);
}

/* ── Toolbar ── */
.lba-archive__toolbar {
    margin-bottom: var(--lba-space-xl);
}

.lba-archive__toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* WooCommerce result count + ordering */
.woocommerce-result-count {
    font-family: var(--lba-font-secondary);
    font-size: 0.8125rem;
    color: var(--lba-gray-500);
    margin: 0;
}

.woocommerce-ordering {
    margin: 0;
}

.woocommerce-ordering select {
    font-family: var(--lba-font-secondary);
    font-size: 0.8125rem;
    color: var(--lba-black);
    border: 1px solid var(--lba-gray-300);
    background: transparent;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border-radius: 0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23737373'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    cursor: pointer;
}

/* ── Product grid ── */
ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* WooCommerce adds a .columns-N class we override */
ul.products.columns-1,
ul.products.columns-2,
ul.products.columns-3,
ul.products.columns-4,
ul.products.columns-5 {
    grid-template-columns: repeat(3, 1fr);
}

/* WooCommerce's clearfix hack adds ::before/::after with display:table to ul.products.
   In CSS grid, pseudo-elements become anonymous grid items — the ::before occupies
   column 1 of row 1, pushing all products one slot forward. Suppress them. */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
}

/* WooCommerce's layout.css sets float: left and width: N% on li.product.
   In CSS grid, % widths resolve against the column track, not the container,
   so we must explicitly reset to let the grid control sizing. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
}

/* ── Product card ── */
.lba-product-card {
    position: relative;
}

.lba-product-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Quote icon — price row, bottom-right of card info */
.lba-product-card__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.125rem;
}

/* ── Card icon button group (cart + quote, always side-by-side) ── */
.lba-product-card__icon-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.lba-product-card__icon-group .lba-card-cart-btn,
.lba-product-card__icon-group .lba-card-quote-btn {
    position: relative;
    width: 26px;
    height: 26px;
    min-height: unset;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--lba-gray-500, #888);
    cursor: pointer;
    transition: color 0.2s ease;
    overflow: visible;
    flex-shrink: 0;
}

.lba-product-card__icon-group .lba-card-cart-btn:hover,
.lba-product-card__icon-group .lba-card-quote-btn:hover {
    color: var(--lba-black);
}

/* Cart tooltip */
.lba-card-cart-btn__tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    white-space: nowrap;
    background: var(--lba-black);
    color: #fff;
    font-family: var(--lba-font-secondary);
    font-size: 0.5625rem;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 4px 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.lba-card-cart-btn:hover .lba-card-cart-btn__tooltip,
.lba-card-cart-btn:focus-visible .lba-card-cart-btn__tooltip {
    opacity: 1;
}

/* Override lba-btn-add-quote product-page defaults for the small card icon */
.lba-product-card .lba-card-quote-btn {
    position: relative;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    min-height: unset;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--lba-gray-500, #888);
    transition: color 0.2s ease;
    overflow: visible;
}

.lba-product-card .lba-card-quote-btn:hover,
.lba-product-card .lba-card-quote-btn:focus-visible {
    border: none;
    background: transparent;
    color: var(--lba-black);
}

.lba-product-card .lba-card-quote-btn.is-in-list {
    color: var(--lba-black);
    background: transparent;
    border: none;
}

.lba-product-card .lba-card-quote-btn.is-in-list svg {
    fill: var(--lba-black);
}

/* Tooltip — appears above the icon on hover */
.lba-card-quote-btn__tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    white-space: nowrap;
    background: var(--lba-black);
    color: #fff;
    font-family: var(--lba-font-secondary);
    font-size: 0.5625rem;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 4px 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.lba-card-quote-btn:hover .lba-card-quote-btn__tooltip,
.lba-card-quote-btn:focus-visible .lba-card-quote-btn__tooltip,
.lba-qv__quote-icon:hover .lba-card-quote-btn__tooltip,
.lba-qv__quote-icon:focus-visible .lba-card-quote-btn__tooltip {
    opacity: 1;
}

.lba-product-card__img-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--lba-white);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product card image — 85% sizing for breathing room on #F5F4F2 bg.
   High-specificity selector beats main.css ul.products a img.
   Universal fallback covers contract page and other non-.woocommerce contexts. */
.lba-product-card__img-wrap img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.woocommerce ul.products li.product a .lba-product-card__img-wrap img,
.woocommerce-page ul.products li.product a .lba-product-card__img-wrap img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.lba-product-card__link:hover .lba-product-card__img-wrap img {
    transform: scale(1.04);
}

.lba-product-card__placeholder {
    width: 100%;
    height: 100%;
    background: var(--lba-white);
}

/* ── Colour swatches (variable products with pa_colour) ── */
.lba-product-card__swatches {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.625rem 0 0.375rem;
}

.lba-product-card__swatch {
    display: block;
    width: 28px;
    height: 28px;
    overflow: hidden;
    border: 1px solid var(--lba-gray-200);
    flex-shrink: 0;
}

.lba-product-card__swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lba-product-card__swatch-more {
    font-family: var(--lba-font-secondary);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--lba-gray-500);
    white-space: nowrap;
    padding-left: 0.125rem;
}

.lba-product-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.lba-product-card__brand {
    font-family: var(--lba-font-secondary);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lba-gray-500);
}

.lba-product-card__name {
    font-family: var(--lba-font-primary);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--lba-black);
    line-height: 1.3;
    margin: 0;
}

.lba-product-card__price {
    font-family: var(--lba-font-secondary);
    font-size: 0.875rem;
    color: var(--lba-black);
}

.lba-product-card__price .woocommerce-Price-amount {
    font-size: 0.875rem;
    color: var(--lba-black);
}

/* "More Info →" — shared with related card rows on product page */
.lba-product-card__more-info,
.lba-related-card__more-info {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--lba-font-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lba-black);
    margin-top: 0.25rem;
    transition: gap 0.2s ease;
}

.lba-product-card__link:hover .lba-product-card__more-info,
.lba-related-card:hover .lba-related-card__more-info {
    gap: 0.5rem;
}

/* ── Pagination ── */
.woocommerce-pagination {
    margin-top: var(--lba-space-4xl);
    padding-top: var(--lba-space-xl);
    border-top: 1px solid var(--lba-gray-200);
    display: flex;
    justify-content: center;
}

.woocommerce-pagination ul {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Page number links and spans */
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.625rem;
    font-family: var(--lba-font-secondary);
    font-size: 0.6875rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--lba-gray-500);
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: color 0.2s ease;
}

.woocommerce-pagination ul li a:hover {
    color: var(--lba-black);
    background: none;
}

/* Current page — serif, black */
.woocommerce-pagination ul li span.current {
    font-family: var(--lba-font-primary);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--lba-black);
}

/* Prev / Next — small uppercase text */
.woocommerce-pagination ul li a.prev,
.woocommerce-pagination ul li a.next {
    font-size: 0.5625rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lba-gray-400, #a3a3a3);
    padding: 0 1.25rem;
}

.woocommerce-pagination ul li a.prev:hover,
.woocommerce-pagination ul li a.next:hover {
    color: var(--lba-black);
}

/* Ellipsis */
.woocommerce-pagination ul li span.dots {
    color: var(--lba-gray-300);
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
}

/* ── No products ── */
.woocommerce-info {
    font-family: var(--lba-font-secondary);
    font-size: 0.9375rem;
    color: var(--lba-gray-500);
    padding: var(--lba-space-3xl) 0;
    text-align: center;
    border: none;
    background: none;
}

.woocommerce-info::before {
    display: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    ul.products,
    ul.products.columns-1,
    ul.products.columns-2,
    ul.products.columns-3,
    ul.products.columns-4,
    ul.products.columns-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    ul.products,
    ul.products.columns-1,
    ul.products.columns-2,
    ul.products.columns-3,
    ul.products.columns-4,
    ul.products.columns-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
    }

    .lba-archive__toolbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    ul.products,
    ul.products.columns-1,
    ul.products.columns-2,
    ul.products.columns-3,
    ul.products.columns-4,
    ul.products.columns-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem 0.75rem;
    }
}

/* ==========================================================================
   Brands Directory Page
   ========================================================================== */

.lba-brands-page {
    padding-top: 24px;
    padding-bottom: var(--lba-space-4xl);
    min-height: 60vh;
}

.admin-bar .lba-brands-page {
    padding-top: 24px;
}

.lba-brands-page .lba-archive__header {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}

.lba-brands-page .lba-breadcrumb {
    padding-top: 8px;
    padding-bottom: 0;
}

.lba-brands-page .lba-filter-bar {
    padding-top: 20px;
}

.lba-brands-page .lba-az-strip {
    border-bottom: none;
    padding-bottom: 0;
}

.lba-brands-page__header {
    margin-bottom: var(--lba-space-xl);
    padding-bottom: var(--lba-space-xl);
    border-bottom: 1px solid var(--lba-gray-200);
}

.lba-brands-page__eyebrow {
    font-family: var(--lba-font-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lba-gray-500);
    margin: 0 0 0.5rem;
}

.lba-brands-page__title {
    font-family: var(--lba-font-primary);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    color: var(--lba-black);
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.lba-brands-page__intro {
    font-family: var(--lba-font-secondary);
    font-size: 0.9375rem;
    color: var(--lba-gray-500);
    margin: 0;
}

/* ── Inline filter bar (no top border on this context) ── */
.lba-filter-bar--inline {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: var(--lba-space-lg);
}

/* ── A–Z strip ── */
.lba-az-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.125rem;
    margin-bottom: var(--lba-space-xl);
    padding-bottom: var(--lba-space-lg);
    border-bottom: 1px solid var(--lba-gray-200);
}

.lba-az-strip__letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-family: var(--lba-font-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

a.lba-az-strip__letter {
    color: var(--lba-black);
    cursor: pointer;
}

a.lba-az-strip__letter:hover {
    background: var(--lba-gray-100);
}

a.lba-az-strip__letter.is-active {
    background: var(--lba-black);
    color: var(--lba-white);
}

span.lba-az-strip__letter.is-empty {
    color: var(--lba-gray-300);
    cursor: default;
}

/* ── Brand grid ── */
/* minmax(0, 1fr) lets tracks shrink past item min-content (uppercase letter-spaced
   brand names + nowrap product count would otherwise expand columns past container). */
.lba-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.lba-brand-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--lba-gray-200);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lba-brand-card:hover {
    border-color: var(--lba-black);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.lba-brand-card__logo-wrap {
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lba-gray-50);
    padding: 1.5rem;
    overflow: hidden;
}

.lba-brand-card__logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lba-brand-card__name-fallback {
    font-family: var(--lba-font-primary);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--lba-black);
    text-align: center;
    letter-spacing: 0.02em;
}

.lba-brand-card__footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-top: 1px solid var(--lba-gray-200);
    gap: 0.5rem;
}

.lba-brand-card__brand-name {
    font-family: var(--lba-font-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lba-black);
}

.lba-brand-card__count {
    font-family: var(--lba-font-secondary);
    font-size: 0.6875rem;
    color: var(--lba-gray-500);
    white-space: nowrap;
}

.lba-brands-empty {
    padding: var(--lba-space-3xl) 0;
    text-align: center;
    font-family: var(--lba-font-secondary);
    font-size: 0.9375rem;
    color: var(--lba-gray-500);
}

@media (max-width: 1024px) {
    .lba-brands-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .lba-brands-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .lba-az-strip__letter {
        width: 2rem;
        height: 2rem;
        font-size: 0.6875rem;
    }
}

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

    /* Anchor footer to card baseline so cards in a row align on the bottom edge
       (grid stretches all to tallest; without this the extra height lands as
       empty whitespace below the count text on 1-line-name cards). */
    .lba-brand-card {
        justify-content: space-between;
    }

    .lba-brand-card__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
