/* MediRoyal — All Products page */

/* ── FILTER BAR ── */
.log-ap-filter-bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 48px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.log-ap-cunter-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 48px 0;
    display: flex;
    align-items: center;
}

.log-ap-filter-tabs {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.log-ap-filter-tabs::-webkit-scrollbar {
    display: none;
}

.log-ap-ftab {
    padding: 9px 18px;
    border-radius: var(--r-pill);
    border: 1.5px solid var(--line);
    background: var(--white) !important;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-700);
    cursor: pointer;
    transition: all .22s;
    white-space: nowrap;
    outline: none;
}

.log-ap-ftab:hover,
.log-ap-ftab:focus {
    border-color: var(--mr-gold);
    color: var(--plum-700);
    background: var(--white) !important;
    outline: none;
}

.log-ap-ftab.active:hover,
.log-ap-ftab.active:focus {
    background: var(--plum-700) !important;
    color: #fff;
}

.log-ap-ftab.active {
    border-color: var(--plum-700);
    background: var(--plum-700) !important;
    color: #fff;
}

.log-ap-sort-select {
    /* Blocksy's global form reset sets select{width:var(--has-width,
       var(--theme-form-field-width,100%))} which balloons this to fill
       the flex row and squeezes .log-ap-filter-tabs to 0 — override. */
    width: auto;
    flex-shrink: 0;
    margin-left: auto;
    padding: 10px 30px 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm, 10px);
    background: var(--white);
    font-size: 12px;
    font-family: var(--body);
    color: var(--ink-700);
    outline: none;
    cursor: pointer;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237d6e79' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.log-ap-sort-select:focus {
    border-color: var(--sage-500);
}

.log-ap-results-count {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.log-ap-results-count strong {
    color: var(--ink-900);
}

/* ── CATEGORIES ── */
.log-ap-categories-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 48px 80px;
}

/* ── CATEGORY GRID — single container for every subcategory card,
   AJAX-refreshed per pill click (see log-all-products.js) ── */
.log-ap-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
    min-height: 120px;
}

.log-ap-cat-grid.log-ap-loading {
    opacity: 0.4;
    pointer-events: none;
}

.log-ap-cat-grid.log-ap-loading::after {
    content: "";
    position: absolute;
    top: 40px;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-left: -17px;
    border: 3px solid var(--line);
    border-top-color: var(--plum-700);
    border-radius: 50%;
    animation: log-ap-spin 0.7s linear infinite;
}

@keyframes log-ap-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Subcategory cards reuse the shared .log-prod-card component (see
   log-product-card.css / log-product-card-extra.css) for 100% consistent
   styling with real product cards — no separate .log-ap-cat-* card CSS.
   The .log-ap-cat-card class is kept only as a JS reveal-animation hook
   (see log-all-products.js), not for styling. */

/* ── EMPTY STATE ── */
.log-ap-empty-state {
    text-align: center;
    padding: 80px 20px;
    display: none;
}

.log-ap-empty-state.show {
    display: block;
}

.log-ap-empty-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.log-ap-empty-state h3 {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 900;
    color: var(--ink-900);
    margin-bottom: 8px;
}

.log-ap-empty-state p {
    font-size: 14px;
    color: var(--gray-600);
}

/* ── HIDE PARENT THEME TITLE + CONTAINER OVERRIDE ── */
body.log-all-products-page .entry-hero-container-inner {
    display: none !important;
}

body.log-all-products-page .site-content>.content-container,
body.log-all-products-page .site-content>.site-container,
body.log-all-products-page [class*="ct-container"],
body.log-all-products-page [class*="content-container"] {
    /* Blocksy sets `width: var(--container-max-width)` (90vw) on
       .ct-container, not max-width — must reset width itself, same
       fix as log-shop.css. */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
}

body.log-all-products-page [class*="ct-container"][data-vertical-spacing] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* ── RESPONSIVE ── */
/* Jumps straight from 4 columns to 2 at 1024px and stays there through
   phone width (no 3-column tablet step) — same pattern as
   .log-products-grid on the shop page. */
@media(max-width:1024px) {
    .log-ap-cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:768px) {
    .log-ap-filter-bar,
    .log-ap-categories-wrap {
        padding-left: 20px;
        padding-right: 20px;
    }

    .log-ap-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .log-ap-search-wrap {
        width: 100%;
        flex-shrink: 1;
    }

    .log-ap-filter-tabs {
        width: 100%;
    }

    .log-ap-sort-select {
        margin-left: 0;
    }

    .log-ap-results-count {
        white-space: normal;
    }
}

/* Category cards stay 2-across all the way down to phone width — same
   pattern as .log-products-grid on the shop page — instead of dropping
   to a single column at 480px. */