/* Box of Good catalog search
 *
 * Renders inside the theme (fixed site header above), so the page scrolls
 * normally: the filter sidebar and the search row are sticky under the header.
 * `.is-compact` (set from JS when the content column is narrow — a phone, or a
 * desktop with the Next Order flyout open) turns the sidebar into a left
 * drawer. It is JS-driven rather than a media query because the flyout
 * narrows the content without changing the viewport.
 */

.bog-catalog,
.bog-catalog *,
.bog-catalog *::before,
.bog-catalog *::after {
    box-sizing: border-box;
}

.bog-catalog {
    --brand-primary: #14722b;
    --brand-primary-light: #e3f3e8;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --green-50: #f0fdf4;
    --green-600: #4caf7d;
    --green-700: #3d9067;
    --red-50: #fef2f2;
    --red-600: #e2666a;
    --red-700: #c94f54;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --slate-grey: #14722b;

    /* Height of the theme's fixed header (sol-storefront-child: 105px, 75px under 960px, incl. border) */
    --bog-header-h: 105px;

    font-family: inherit;
    color: var(--gray-900);
    line-height: 1.5;
    padding: 0.875rem 1rem 2rem;
    touch-action: manipulation;
}

@media (max-width: 959px) {
    .bog-catalog {
        --bog-header-h: 75px;
    }
}

.bog-catalog .catalog-layout {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Filter sidebar: sticky under the header with its own scroll */

.bog-catalog .category-sidebar {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.875rem;
    width: 290px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--bog-header-h) + 0.75rem);
    height: calc(100dvh - var(--bog-header-h) - 1.5rem);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.bog-catalog .drawer-head,
.bog-catalog .drawer-done,
.bog-catalog .filters-toggle,
.bog-catalog .drawer-overlay {
    display: none;
}

.bog-catalog .drawer-foot {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Facet Tabs (Categories / Brands / Tags pills) */

.bog-catalog .facet-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.1875rem;
    border-radius: 999px;
    margin-bottom: 0.625rem;
    flex-shrink: 0;
}

.bog-catalog .facet-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0.5rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.bog-catalog .facet-tab:hover {
    color: var(--gray-900);
}

.bog-catalog .facet-tab.active {
    background: white;
    color: var(--slate-grey);
    box-shadow: var(--shadow);
}

/* Swipeable facet viewport: three panels side by side, slide between them */

.bog-catalog .facet-viewport {
    overflow: hidden;
    position: relative;
    flex: 1;
    min-height: 0;
}

.bog-catalog .facet-track {
    --facet-index: 0;
    display: flex;
    width: 300%;
    height: 100%;
    transform: translateX(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bog-catalog .facet-track.show-brands {
    --facet-index: 1;
}

.bog-catalog .facet-track.show-tags {
    --facet-index: 2;
}

.bog-catalog .facet-track.show-brands,
.bog-catalog .facet-track.show-tags {
    transform: translateX(calc(var(--facet-index) * -33.3333%));
}

.bog-catalog .facet-panel {
    width: 33.3333%;
    flex-shrink: 0;
    min-width: 0;
    height: 100%;
    /* No overflow:hidden here — .facet-viewport already clips the
       horizontal slide. This panel must stay open so its .category-list
       child can scroll vertically on its own. */
    display: flex;
    flex-direction: column;
}

.bog-catalog .category-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Only vertical panning inside this list — lets a touch that starts
       here commit to scrolling immediately instead of the browser
       weighing it against the sidebar's horizontal swipe-to-switch. */
    touch-action: pan-y;
}

.bog-catalog .category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 1.125rem;
    color: var(--gray-700);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.bog-catalog .category-item:hover {
    background: var(--gray-100);
}

.bog-catalog .category-item.active {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
}

.bog-catalog .category-item.faded {
    opacity: 0.35;
}

.bog-catalog .category-item.faded:hover {
    opacity: 0.6;
}

.bog-catalog .category-count {
    font-size: 1rem;
    color: var(--gray-500);
    flex-shrink: 0;
}

.bog-catalog .category-item.active .category-count {
    color: #fff;
    opacity: 0.75;
}

/* Active filter chips (category + brand) */

.bog-catalog .active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    flex-shrink: 0;
}

.bog-catalog .active-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem 0.375rem 0.875rem;
    background: var(--brand-primary-light);
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 0.625rem;
}

.bog-catalog .active-category-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    color: var(--gray-700);
    cursor: pointer;
    /* The theme gives every <button> large padding; reset it so the icon fits. */
    padding: 0;
    min-width: 0;
    line-height: 1;
}

.bog-catalog .active-category-chip button:hover {
    background: white;
}

/* Reset filters button (bottom of sidebar) */

.bog-catalog .reset-filters-btn {
    flex-shrink: 0;
    margin-top: 0.625rem;
    width: 100%;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.625rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bog-catalog .reset-filters-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* Product Search Section: normal page flow next to the sticky sidebar */

.bog-catalog .product-search-section {
    min-width: 0;
    flex: 1;
}

.bog-catalog .modal-search-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
    position: sticky;
    top: var(--bog-header-h);
    z-index: 10;
    background: var(--gray-50);
    padding: 0.5rem 0.5rem 0.25rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    width: calc(100% + 1rem);
    border-radius: 0.5rem;
    transition: box-shadow 0.15s ease;
}

.bog-catalog .modal-search-row.is-stuck {
    box-shadow: var(--shadow);
}

.bog-catalog .modal-search-wrapper {
    position: relative;
    flex: 1;
}

.bog-catalog .modal-search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-400);
    pointer-events: none;
}

.bog-catalog .modal-search-input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.75rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 1.125rem;
    transition: all 0.2s;
}

.bog-catalog .modal-search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.bog-catalog .clear-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.bog-catalog .clear-search-btn:hover {
    background: var(--gray-300);
    color: var(--gray-900);
}

/* View Toggle Buttons */

.bog-catalog .view-toggle {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.bog-catalog .view-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s ease;
}

.bog-catalog .view-toggle-btn:hover {
    background: var(--gray-50);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.bog-catalog .view-toggle-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.bog-catalog .view-toggle-btn svg {
    pointer-events: none;
}

/* Search Results (list) */

.bog-catalog .search-results {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 0.625rem;
}

.bog-catalog .search-result-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    border-left: 3px solid transparent;
    transition: border-color 0.15s, background-color 0.15s;
}

.bog-catalog .search-result-item:last-child {
    border-bottom: none;
}

/* Thumbnail */

.bog-catalog .result-thumbnail {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bog-catalog .result-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bog-catalog .result-thumb-img.loaded {
    opacity: 1;
}

.bog-catalog .result-thumb-placeholder {
    width: 24px;
    height: 24px;
    color: var(--gray-400);
}

.bog-catalog .result-info {
    flex: 1;
    min-width: 0;
}

.bog-catalog .result-name {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.bog-catalog .result-details {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

/* Grid View */

.bog-catalog .search-results.grid-view {
    display: grid;
    /* At least 210px wide, and never more than 5 across (a column can't get
       narrower than a fifth of the row, so a 6th never fits). */
    grid-template-columns: repeat(auto-fill, minmax(max(210px, calc((100% - 4 * 0.875rem) / 5 - 0.5px)), 1fr));
    gap: 0.875rem;
    border: none;
    background: transparent;
}

.bog-catalog .search-results.grid-view .search-result-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.625rem;
    padding: 0.875rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-left: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: white;
    overflow: hidden;
}

.bog-catalog .search-results.grid-view .result-thumbnail {
    width: 160px;
    height: 160px;
    border-radius: 0.5rem;
}

.bog-catalog .search-results.grid-view .result-thumb-placeholder {
    width: 48px;
    height: 48px;
}

.bog-catalog .search-results.grid-view .result-info {
    min-width: 0;
    width: 100%;
    /* Fill the card so the brand line can be pinned to the bottom, right
       above the stock badge/control, regardless of title length. */
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bog-catalog .search-results.grid-view .result-name {
    font-size: 1.0625rem;
    line-height: 1.3;
    /* Show the full name; long names wrap. Cards in a row stretch to the
       tallest one and the stock control is pinned to the bottom (below),
       so the grid stays aligned. */
    overflow-wrap: anywhere;
}

.bog-catalog .search-results.grid-view .result-details {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin-top: auto;
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* List View (default — explicit class) */

.bog-catalog .search-results.list-view {
    display: block;
}

/* Empty / Loading Message */

.bog-catalog .empty-message {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--gray-500);
}

.bog-catalog .empty-message .empty-icon {
    width: 3rem;
    height: 3rem;
    color: var(--gray-400);
    margin: 0 auto 1rem;
}

.bog-catalog .empty-message p {
    margin: 0;
}

/* Stock filters (admin) sit beside the top pagination */

.bog-catalog .pagination-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

/* Pagination */

.bog-catalog .product-pagination {
    margin-bottom: 0.625rem;
}

.bog-catalog .product-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.bog-catalog .product-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.bog-catalog .product-page-btn:hover:not([disabled]) {
    background: var(--gray-50);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.bog-catalog .product-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bog-catalog .product-page-btn.product-page-active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: white;
}

.bog-catalog .product-page-ellipsis {
    padding: 0 0.375rem;
    color: var(--gray-400);
}

.bog-catalog .product-pagination-info {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--gray-500);
}

/* Spinner */

.bog-catalog .spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gray-200);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    margin: 0 auto 0.75rem;
    animation: bog-catalog-spin 0.7s linear infinite;
}

.bog-catalog .spinner-sm {
    width: 1.25rem;
    height: 1.25rem;
    border-width: 2px;
}

@keyframes bog-catalog-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   Product cards: link (thumbnail + name) / price / add button
   ========================================== */

.bog-catalog .search-result-item {
    flex-wrap: wrap;
}

.bog-catalog .result-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.bog-catalog .result-link:hover .result-name {
    text-decoration: underline;
}

.bog-catalog .result-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.bog-catalog .result-price del {
    font-weight: 400;
    color: var(--gray-400);
    margin-right: 0.25rem;
}

.bog-catalog .result-price ins {
    text-decoration: none;
}

.bog-catalog .result-action .button {
    margin: 0;
    width: 100%;
    white-space: normal;
}

/* Action area: Add fills the row, "+ List" sits beside it at the same height */
.bog-catalog .result-action {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.bog-catalog .result-action > .button {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

/* WooCommerce's "View cart" link (non-skip customers) goes on its own line */
.bog-catalog .result-action > .added_to_cart {
    flex: 1 0 100%;
    text-align: center;
}

.bog-catalog .result-list-btn,
.bog-catalog .result-in-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    min-width: 5.75rem;
    padding: 0 0.875rem;
    border: 2px solid var(--brand-primary);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.bog-catalog .result-list-btn {
    min-height: 2.75rem;
    background: white;
    color: var(--brand-primary);
    cursor: pointer;
}

@media (hover: hover) {
    .bog-catalog .result-list-btn:not(:disabled):hover {
        background: var(--brand-primary-light);
    }
}

.bog-catalog .result-list-btn:disabled {
    border-color: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
}

.bog-catalog .result-list-btn.has-error {
    border-color: var(--sale-red);
    color: var(--sale-red-dark);
}

/* Already in a list: a quiet confirmation, not a button */
.bog-catalog .result-in-list {
    border-color: transparent;
    background: var(--brand-primary-light);
    color: var(--brand-primary);
}

/* The small "which list?" popover */
.bog-catalog .list-picker {
    position: fixed;
    z-index: 60;
    width: min(18rem, calc(100vw - 1rem));
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.bog-catalog .list-picker-title {
    padding: 0.375rem 0.5rem 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--gray-900);
}

.bog-catalog .list-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--gray-900);
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.bog-catalog .list-picker-item:hover,
.bog-catalog .list-picker-item:focus-visible {
    background: var(--gray-50);
}

.bog-catalog .list-picker-count {
    min-width: 1.75rem;
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: var(--gray-200);
    font-size: 0.9375rem;
    text-align: center;
}

.bog-catalog .list-picker-new {
    margin-top: 0.375rem;
    padding: 0.5rem 0.5rem 0.25rem;
    border-top: 1px solid var(--gray-200);
}

.bog-catalog .list-picker-new label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-500);
}

.bog-catalog .list-picker-new-row {
    display: flex;
    gap: 0.375rem;
}

.bog-catalog .list-picker-new input {
    flex: 1 1 auto;
    min-width: 0;
    height: 2.75rem;
    padding: 0 0.625rem;
    font-size: 1rem;
}

.bog-catalog .list-picker-new button {
    flex: 0 0 auto;
    height: 2.75rem;
    padding: 0 0.875rem;
    border: 0;
    border-radius: 4px;
    background: var(--brand-primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}

.bog-catalog .result-sold-out {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-500);
}

/* List view: link grows, price and button sit to the right */

.bog-catalog .search-results.list-view .result-action .button {
    width: auto;
    white-space: nowrap;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
}

/* Grid view: stack link, price, button; pin price + button to the bottom */

.bog-catalog .search-results.grid-view .search-result-item {
    flex-wrap: nowrap;
}

.bog-catalog .search-results.grid-view .result-link {
    flex-direction: column;
    flex: 1;
    width: 100%;
    gap: 0.5rem;
    text-align: center;
}

.bog-catalog .search-results.grid-view .result-price {
    margin-top: 0.125rem;
}

.bog-catalog .search-results.grid-view .result-action {
    width: 100%;
}

.bog-catalog .search-results.grid-view .result-action .button {
    padding: 0.875rem 0.5rem;
    font-size: 0.9375rem;
}

/* The shop banner (address + delivery date + View order) above the search row */

.bog-catalog .sol-shop-address-banner {
    margin-bottom: 0.875rem;
}

/* ==========================================
   Compact mode: sidebar becomes a left drawer
   ========================================== */

.bog-catalog.is-compact .catalog-layout {
    display: block;
}

.bog-catalog.is-compact .category-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    width: min(340px, 88vw);
    max-width: none;
    border: none;
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 0 0.75rem;
    z-index: 100000;
    transform: translateX(-105%);
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
    visibility: hidden;
    box-shadow: var(--shadow-lg);
}

.bog-catalog.is-compact.drawer-open .category-sidebar {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.28s ease;
}

.bog-catalog.is-compact .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 99995;
}

.bog-catalog.is-compact.drawer-open .drawer-overlay {
    opacity: 1;
    pointer-events: auto;
}

.bog-catalog.is-compact .drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 0.875rem 0.25rem 0.625rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
}

.bog-catalog .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-700);
    cursor: pointer;
    padding: 0;
}

.bog-catalog.is-compact .drawer-foot {
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--gray-200);
    margin-top: 0.5rem;
}

.bog-catalog.is-compact .drawer-foot .reset-filters-btn {
    margin: 0;
    width: auto;
    flex: 0 0 auto;
    padding: 0.625rem 0.875rem;
}

.bog-catalog.is-compact .drawer-done {
    display: block;
}

.bog-catalog .drawer-done {
    flex: 1;
    border: none;
    border-radius: 0.5rem;
    background: var(--brand-primary);
    color: #fff;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 700;
    padding: 0.875rem;
    cursor: pointer;
}

/* Larger touch targets in the drawer */

.bog-catalog.is-compact .category-item {
    padding: 0.75rem 0.625rem;
}

.bog-catalog.is-compact .facet-tab {
    padding: 0.625rem 0.5rem;
}

/* Filters toggle (compact only) */

.bog-catalog.is-compact .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
    height: 2.875rem;
    padding: 0 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-800);
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.bog-catalog.is-compact .filters-toggle.has-filters {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.bog-catalog .filters-toggle-count {
    display: none;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: center;
}

.bog-catalog .filters-toggle.has-filters .filters-toggle-count {
    display: inline-block;
}

/* Compact + narrow: two-up grid, search row stays on one line */

.bog-catalog.is-compact .search-results.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* Phones: the product layout is fixed (compact cards), so grid/list are hidden. */
.bog-catalog.is-narrow .view-toggle {
    display: none;
}

.bog-catalog.is-narrow {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Page scroll is locked while the filter drawer is open. Keep the scrollbar's
   space reserved, or the page gets wider when it disappears and the product
   grid jumps (e.g. 2 columns -> 3) on open and back on close. */
html.bog-drawer-open {
    overflow: hidden;
    scrollbar-gutter: stable;
}
.bog-catalog .product-search-section { scroll-margin-top: var(--bog-header-h); }

/* The drawer itself takes focus when it opens: no ring on the container. */
.bog-catalog .category-sidebar:focus {
    outline: none;
}

/* The theme sets overflow-x:hidden on #page, which turns it into a scroll
   container and breaks position:sticky for the sidebar and search row.
   `clip` hides horizontal overflow the same way without creating one.
   `flow-root` keeps the block formatting context overflow used to provide:
   without it #content's top margin collapses through #page and drags the
   theme's fixed header (which has no `top`) down by that margin. */
body.bog-catalog-page #page {
    overflow-x: clip;
    overflow-y: visible;
    display: flow-root;
}

/* ==========================================
   Variety: which size the Add button adds, and the picker for the others
   ========================================== */

.bog-catalog .result-buy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.bog-catalog .result-variety {
    font-size: 1rem;
    color: var(--gray-600);
}

.bog-catalog .result-variation {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.5rem 1.75rem 0.5rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background-color: white;
    color: var(--gray-800);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.3;
    text-overflow: ellipsis;
}

.bog-catalog .result-variation:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-primary-light);
}

.bog-catalog .search-results.list-view .result-buy {
    align-items: flex-end;
    min-width: 9rem;
}

.bog-catalog .search-results.list-view .result-variation {
    width: auto;
    max-width: 14rem;
}

.bog-catalog .search-results.grid-view .result-buy {
    width: 100%;
    align-items: center;
    text-align: center;
}

/* ==========================================
   Phones (is-narrow): compact horizontal cards
   Photo on the left; name, price, size picker and button stacked on the right.
   One product is ~130-170px tall instead of ~290px, so 3-4 fit per screen at the
   same readable text size.
   ========================================== */

.bog-catalog.is-narrow {
    /* Win back part of the theme's side gutters for the product column. */
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.bog-catalog.is-narrow .search-results.grid-view {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.bog-catalog.is-narrow .search-results.grid-view .search-result-item {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-areas:
        "thumb info"
        "thumb buy"
        "thumb action";
    grid-template-rows: auto auto 1fr;
    column-gap: 0.75rem;
    row-gap: 0.25rem;
    align-items: start;
    text-align: left;
    padding: 0.625rem;
}

/* Let the link's thumbnail and name become separate grid items (the whole
   thing is still tappable and still goes to the product page). */
.bog-catalog.is-narrow .search-results.grid-view .result-link {
    display: contents;
    /* display:contents boxes still pass text-align down to the name. */
    text-align: left;
}

.bog-catalog.is-narrow .search-results.grid-view .result-thumbnail {
    grid-area: thumb;
    width: 104px;
    height: 104px;
}

.bog-catalog.is-narrow .search-results.grid-view .result-info {
    grid-area: info;
    flex: none;
    width: auto;
    display: block;
}

.bog-catalog.is-narrow .search-results.grid-view .result-name {
    font-size: 1.0625rem;
    margin-bottom: 0;
}

.bog-catalog.is-narrow .search-results.grid-view .result-details {
    margin: 0.125rem 0 0;
    font-size: 0.9375rem;
}

.bog-catalog.is-narrow .search-results.grid-view .result-buy {
    grid-area: buy;
    width: auto;
    align-items: flex-start;
    text-align: left;
}

.bog-catalog.is-narrow .search-results.grid-view .result-price {
    margin: 0;
    font-size: 1.1875rem;
}

.bog-catalog.is-narrow .search-results.grid-view .result-action {
    grid-area: action;
    width: auto;
    align-self: end;
}

.bog-catalog.is-narrow .search-results.grid-view .result-action .button {
    padding: 0.75rem 0.75rem;
    font-size: 0.9375rem;
}

.bog-catalog.is-narrow .search-results.grid-view .result-sold-out {
    padding: 0.5rem 0;
}

/* ==========================================
   Wider page on desktop and larger screens
   The theme caps .col-full at 1064px (content) at every screen size, which
   leaves a narrow strip in the middle of a big monitor. On this page the
   content area and the header row share a wider cap instead, so the product
   grid gets the room (more cards per row, same card size). Phones and
   tablets (<960px) keep the theme's own gutters.
   ========================================== */

@media (min-width: 960px) {
    body.bog-catalog-page #content > .col-full,
    body.bog-catalog-page #masthead > .col-full {
        max-width: 1500px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* ==========================================
   Visual category view (the "Categories" button)
   ========================================== */

/* The tiles replace the product list and its paging. */
.bog-catalog.view-tiles #search-results,
.bog-catalog.view-tiles .pagination-row,
.bog-catalog.view-tiles #product-pagination,
.bog-catalog.view-tiles #no-product-message {
    display: none !important;
}

.bog-catalog .category-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.875rem;
    margin-top: 0.25rem;
}

.bog-catalog .category-tiles-empty {
    grid-column: 1 / -1;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 1.125rem;
}

.bog-catalog .category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background: white;
    color: var(--gray-900);
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

@media (hover: hover) {
    .bog-catalog .category-tile:hover {
        border-color: var(--brand-primary);
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }
}

.bog-catalog .category-tile.active {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-primary);
}

.bog-catalog .category-tile-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 0.5rem;
    background: var(--gray-100);
    overflow: hidden;
}

.bog-catalog .category-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bog-catalog .category-tile-image .result-thumb-placeholder {
    width: 3rem;
    height: 3rem;
}

.bog-catalog .category-tile-name {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.bog-catalog .category-tile-count {
    font-size: 1rem;
    color: var(--gray-600);
}

/* Phones: two tiles per row */
.bog-catalog.is-narrow .category-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
}

.bog-catalog.is-narrow .category-tile {
    padding: 0.5rem 0.5rem 0.75rem;
}

.bog-catalog.is-narrow .category-tile-name {
    font-size: 1.0625rem;
}

/* "Choose an option": a variable product with no default; Add is off until one is picked. */
.bog-catalog .result-choose,
.bog-catalog .result-choose:disabled {
    background: var(--gray-200);
    color: var(--gray-600);
    cursor: default;
    opacity: 1;
}

/* ==========================================
   List view: separate row "cards" and defined columns
   Product (photo + name + arrow) | price + option picker | Add button.
   The whole row is clickable (except the picker and button), so rows get a
   hover highlight, a green accent bar, and a link-coloured name.
   ========================================== */

.bog-catalog .search-results.list-view {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.bog-catalog .search-results.list-view .search-result-item {
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem 0.75rem 0.75rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.bog-catalog .search-results.list-view .search-result-item:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid var(--gray-200);
}

@media (hover: hover) {
    .bog-catalog .search-results.list-view .search-result-item:hover {
        background: #f3faf5;
        border-color: var(--brand-primary);
        border-left-color: var(--brand-primary);
        box-shadow: var(--shadow-lg);
    }
}

/* Column 1: photo + name, with an arrow at the right edge */
.bog-catalog .search-results.list-view .result-link {
    align-self: stretch;
    padding-right: 1rem;
    border-right: 1px solid var(--gray-200);
}

.bog-catalog .search-results.list-view .result-link::after {
    content: "\203A";
    margin-left: auto;
    padding-left: 0.75rem;
    font-size: 2rem;
    line-height: 1;
    color: var(--gray-400);
    transition: color 0.12s ease, transform 0.12s ease;
}

.bog-catalog .search-results.list-view .search-result-item:hover .result-link::after {
    color: var(--brand-primary);
    transform: translateX(2px);
}

.bog-catalog .search-results.list-view .result-name {
    color: var(--brand-primary);
    font-weight: 600;
}

.bog-catalog .search-results.list-view .search-result-item:hover .result-name {
    text-decoration: underline;
}

/* Column 2: price + option picker (fixed width so rows line up) */
.bog-catalog .search-results.list-view .result-buy {
    flex: 0 0 16rem;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    border-right: 1px solid var(--gray-200);
    text-align: center;
}

.bog-catalog .search-results.list-view .result-variation {
    width: 100%;
    max-width: none;
}

/* Column 3: Add button (fixed width, buttons line up down the page) */
.bog-catalog .search-results.list-view .result-action {
    flex: 0 0 12.5rem;
}

.bog-catalog .search-results.list-view .result-action .button {
    width: 100%;
    white-space: normal;
}

/* Medium widths (compact): product on its own line, price/picker and button below */
.bog-catalog.is-compact .search-results.list-view .search-result-item {
    flex-wrap: wrap;
    row-gap: 0.625rem;
}

.bog-catalog.is-compact .search-results.list-view .result-link {
    flex: 1 1 100%;
    padding-right: 0;
    border-right: none;
}

.bog-catalog.is-compact .search-results.list-view .result-buy {
    flex: 1 1 12rem;
    padding: 0;
    border-right: none;
}

.bog-catalog.is-compact .search-results.list-view .result-action {
    flex: 1 1 11rem;
}

/* ==========================================
   "Sale items only": bold on purpose. Red/white so it stands apart from the
   green brand controls; filled when on.
   ========================================== */

.bog-catalog {
    --sale-red: #d92d20;
    --sale-red-dark: #b42318;
    --sale-red-light: #fef3f2;
}

.bog-catalog .sale-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
    height: 2.75rem;
    padding: 0 0.5rem 0 1rem;
    border: 2px solid var(--sale-red);
    border-radius: 999px;
    background: var(--sale-red-light);
    color: var(--sale-red-dark);
    font-family: inherit;
    font-size: 1.125rem;
    white-space: nowrap;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(217, 45, 32, 0.18);
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.bog-catalog .sale-toggle svg {
    flex-shrink: 0;
}

.bog-catalog .sale-toggle-count {
    min-width: 2rem;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    background: var(--sale-red);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}

@media (hover: hover) {
    .bog-catalog .sale-toggle:hover {
        background: #fee4e2;
        box-shadow: 0 3px 10px rgba(217, 45, 32, 0.28);
        transform: translateY(-1px);
    }
}

.bog-catalog .sale-toggle[aria-pressed="true"] {
    background: var(--sale-red);
    color: #fff;
    box-shadow: 0 3px 10px rgba(217, 45, 32, 0.4);
}

.bog-catalog .sale-toggle[aria-pressed="true"] .sale-toggle-count {
    background: #fff;
    color: var(--sale-red-dark);
}

.bog-catalog .sale-toggle:focus-visible {
    outline: 3px solid var(--sale-red-dark);
    outline-offset: 2px;
}


/* ==========================================
   "My Lists": the customer's saved product lists. Brand green (Sale is red), same
   pill shape; a menu picks the list when there are several.
   ========================================== */

.bog-catalog .lists-wrap {
    position: relative;
    flex-shrink: 0;
}

.bog-catalog .lists-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    height: 2.75rem;
    padding: 0 0.5rem 0 1rem;
    border: 2px solid var(--brand-primary);
    border-radius: 999px;
    background: white;
    color: var(--brand-primary);
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bog-catalog .lists-toggle svg {
    flex-shrink: 0;
}

.bog-catalog .lists-toggle-count {
    min-width: 2rem;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
}

.bog-catalog .lists-toggle-count:empty {
    display: none;
}

@media (hover: hover) {
    .bog-catalog .lists-toggle:hover {
        background: var(--gray-50);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    }
}

.bog-catalog .lists-toggle[aria-pressed="true"] {
    background: var(--brand-primary);
    color: #fff;
}

.bog-catalog .lists-toggle[aria-pressed="true"] .lists-toggle-count {
    background: #fff;
    color: var(--brand-primary);
}

.bog-catalog .lists-toggle:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

.bog-catalog .lists-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 30;
    min-width: 16rem;
    max-width: min(22rem, calc(100vw - 2rem));
    padding: 0.375rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.bog-catalog .lists-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--gray-900);
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.bog-catalog .lists-menu-item:hover,
.bog-catalog .lists-menu-item:focus-visible {
    background: var(--gray-50);
}

.bog-catalog .lists-menu-item.active {
    background: var(--brand-primary);
    color: #fff;
}

.bog-catalog .lists-menu-count {
    flex-shrink: 0;
    min-width: 1.75rem;
    padding: 0.0625rem 0.5rem;
    border-radius: 999px;
    background: var(--gray-200);
    color: var(--gray-900);
    font-size: 0.9375rem;
    font-weight: 700;
    text-align: center;
}

.bog-catalog .lists-menu-item.active .lists-menu-count {
    background: #fff;
    color: var(--brand-primary);
}

/* Phones: no count on the Lists button (like the Sale button). */

.bog-catalog.is-narrow .lists-toggle {
    padding: 0 0.875rem 0 0.75rem;
    gap: 0.375rem;
}

.bog-catalog.is-narrow .lists-toggle-count {
    display: none;
}

/* The menu opens under the row on phones: full width of the screen gutter */
.bog-catalog.is-narrow .lists-wrap {
    position: static;
}

.bog-catalog.is-narrow .lists-menu {
    left: 0.5rem;
    right: 0.5rem;
    max-width: none;
    top: calc(100% + 0.25rem);
}

/* "Some options on sale" under the price when the default option isn't the sale one */
.bog-catalog .result-sale-note {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--sale-red-dark);
}

/* Short button row (small tablets, phones): "Sale" / "Lists" without "items" / "My". */
.bog-catalog.is-snug .sale-toggle-more,
.bog-catalog.is-snug .lists-toggle-more {
    display: none;
}

/* Narrower search rows (< 960px wide): the search box gets a row of its own and the
   buttons (Filters, Sale, My Lists, grid/list) go on a second row under it, so
   they never squeeze the search box. Wide screens keep everything on one row. */
.bog-catalog.is-tight .modal-search-row {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.bog-catalog.is-tight .modal-search-wrapper {
    order: -1;
    flex: 1 1 100%;
}

.bog-catalog.is-tight .view-toggle {
    margin-left: auto;
}



.bog-catalog.is-narrow .sale-toggle {
    padding: 0 0.875rem 0 0.75rem;
    gap: 0.375rem;
}

/* A bare number isn't self-explanatory, so phones keep the word and drop the count. */
.bog-catalog.is-narrow .sale-toggle-count {
    display: none;
}


/* Phones: less inner padding so the short "Search" placeholder isn't clipped */
.bog-catalog.is-narrow .modal-search-input {
    padding-left: 2.375rem;
    padding-right: 1.75rem;
}

.bog-catalog.is-narrow .modal-search-icon {
    left: 0.625rem;
}

.bog-catalog.is-narrow .modal-search-row {
    gap: 0.375rem;
}

/* Tile view header: what you're browsing + the way back to all products */
.bog-catalog .facet-tiles-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0 0 0.75rem;
}

.bog-catalog .facet-tiles-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

.bog-catalog .facet-tiles-all {
    padding: 0.625rem 1.125rem;
    border: 2px solid var(--brand-primary);
    border-radius: 999px;
    background: white;
    color: var(--brand-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

@media (hover: hover) {
    .bog-catalog .facet-tiles-all:hover {
        background: var(--brand-primary);
        color: #fff;
    }
}

.bog-catalog.is-narrow .facet-tiles-title {
    font-size: 1.25rem;
}

/* Optional intro written in the page editor, shown above the catalog */
.bog-catalog-intro {
    padding: 0.875rem 1rem 0;
    font-size: 1.125rem;
}

/* Logged-in admins see WordPress's admin bar, which pushes the theme's fixed header down
   by its own height (32px, 46px on phones/small tablets). The sticky search row and sidebar
   offset from the header, so add the same amount. */
body.admin-bar .bog-catalog {
    --bog-header-h: 137px; /* 105 + 32 */
}

@media (max-width: 959px) {
    body.admin-bar .bog-catalog {
        --bog-header-h: 107px; /* 75 + 32 */
    }
}

@media (max-width: 782px) {
    body.admin-bar .bog-catalog {
        --bog-header-h: 121px; /* 75 + 46 */
    }
}
