/* ==========================================================================
   Category page (markup: storefront/category.blade.php and storefront/category/_rail,
   behaviour: js/storefront/product-list.js and sheets.js)
   Header colours come from the main category's theme (themes.css).
   Chips, grid and "Show more" are shared with search: components/product-list.css
   ========================================================================== */

.store--category .store__main {
    padding: 0 0 calc(110px + env(safe-area-inset-bottom));
    gap: 0;
}

/* No bottom menu on this page, so the cart pill sits lower */
.store--category .cart-pill {
    bottom: calc(18px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */

/* Stays at the top while scrolling; its height is put in --list-header-height
   by product-list.js so the rail can stick just below it */
.category-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 10px 12px;
    background: var(--theme-bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-header__top {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-header__back {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    color: var(--theme-label);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header__back .icon {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.category-header__titles {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.category-header__title {
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--theme-title);    overflow-wrap: break-word;
}

.category-header__shop {
    font-size: 12px;
    font-weight: 500;
    color: var(--theme-subtitle);    overflow-wrap: break-word;
}

.category-header__search {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    color: var(--color-ink);
    box-shadow: 0 2px 8px rgba(28, 21, 48, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-header__search .icon {
    width: 20px;
    height: 20px;
}

/* ---------- Rail + products ---------- */

.category-page {
    width: 100%;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: start;
}

.category-rail {
    position: sticky;
    top: var(--list-header-height, 0px);
    max-height: calc(100vh - var(--list-header-height, 0px));
    padding: 6px 0 24px;
    background: var(--color-soft);
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
}

.category-rail::-webkit-scrollbar {
    display: none;
}

.category-rail__item {
    margin: 2px 6px 2px 0;
    padding: 10px 4px;
    border-left: 4px solid transparent;
    border-radius: 0 16px 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
}

.category-rail__item.is-active {
    border-left-color: var(--color-offer);
    background: #FFFFFF;
    box-shadow: 0 2px 8px rgba(42, 16, 82, 0.10);
}

.category-rail__media {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-rail__item.is-active .category-rail__media {
    background: #EDE2FF;
}

.category-rail__media--icon svg {
    width: 34px;
    height: 34px;
}

.category-rail__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.category-rail__name {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    color: #5E4F7A;
}

.category-rail__item.is-active .category-rail__name {
    color: var(--color-ink);
    font-weight: 800;
}

.category-products {
    min-width: 0;
    padding: 12px 10px 0;
}

/* ---------- Bigger screens ---------- */

@media (min-width: 768px) {
    .category-page {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .category-rail__name {
        font-size: 12px;
    }

    .category-products {
        padding: 16px 20px 0;
    }
}

@media (min-width: 1200px) {
    .category-page {
        max-width: var(--page-max);
        margin: 0 auto;
    }
}
