.product-catalog {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    column-gap: 32px;

    @media (max-width: 768px) {
        padding-top: 8px;
        display: block;
    }
}

.product-catalog__content {
    display: grid;
    min-width: 0;

    @media (max-width: 1024px) {
        display: flex;
        flex-direction: column;
    }
}

.product-catalog .menubar--products-sticky {
    top: 96px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100vh - 120px);
    padding: 12px 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: transparent;

    .menubar__item {
        justify-content: flex-start;
        padding: 8px 12px;
        border-radius: 8px;
        white-space: normal;
    }

    .menubar__item:hover {
        background-color: var(--color-vanilla);
        color: var(--color-black-bean);
    }

    .menubar__item--hidden {
        display: none;
    }

    @media (max-width: 768px) {
        display: none;
    }
}

.category-menu-trigger {
    display: none;

    @media (max-width: 768px) {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 8px 16px;
        border: 0;
        border-radius: 8px;
        background-color: var(--color-vanilla);
        cursor: pointer;
    }
}

.category-menu-trigger__menu-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--color-olive);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.category-menu-trigger__label {
    flex: 1;
    min-width: 0;
    font: 400 14px/1.2 "Jost";
    color: var(--color-black-bean);
    text-align: left;
}

.category-menu-trigger__chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--color-olive);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tingle-modal.tingle-modal--category .tingle-modal-box {
    width: calc(100% - 32px);
    max-width: 343px;
    height: 668px;
    max-height: calc(100dvh - 32px);
}

.tingle-modal.tingle-modal--category .tingle-modal-box__content {
    height: 100%;
}

.popup-modal--category {
    height: 100%;
}

.category-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-ice);
    background-color: white;
}

.category-modal__heading {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.category-modal__menu-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--color-olive);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.category-modal__title {
    font: 700 20px/1 "Crimson Pro";
    color: var(--color-black-bean);
}

.category-modal__close {
    display: flex;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.category-modal__search-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--color-olive);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.category-modal__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 12px 16px 20px;
    background-color: white;
}

.category-modal__search {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    margin-right: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-cream);
}

.category-modal__search-input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background-color: transparent;
    font: 400 14px/20px "Jost";
    color: var(--color-black-bean);

    &::placeholder {
        color: var(--color-smoke);
    }
}

.category-modal__empty {
    display: none;
    overflow: hidden;
    font: 400 14px/1.4 "Jost";
    color: var(--color-dark-grey);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-modal__empty--visible {
    display: block;
}

.category-modal__list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-color: var(--color-cream) transparent;
    scrollbar-width: thin;
}

.category-modal__item {
    width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
    font: 400 14px/1.2 "Jost";
    color: var(--color-black-bean);
    text-decoration: none;
}

.category-modal__item--active {
    color: white;
    background-color: var(--color-olive);
}

.category-modal__item--hidden {
    display: none;
}

.product-catalog .menubar__item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-background), 0 0 0 4px var(--color-olive);
}

.product-index-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    z-index: 800;
    top: 67px;
    width: 100%;
    grid-area: 1 / 1;
    align-self: start;
    pointer-events: none;
    padding-top: 10px;

    @media (max-width: 768px) {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        top: var(--product-navbar-height, 0px);
        order: -1;
        background-color: var(--color-background);
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .navbar--product-scroll-aware,
    .product-index-header {
        transition: transform 180ms cubic-bezier(0.32, 0.72, 0, 1), top 180ms cubic-bezier(0.32, 0.72, 0, 1);
        will-change: transform;
    }

    .navbar--product-scroll-hidden {
        transform: translateY(calc(-1 * var(--product-navbar-height, 0px)));
    }

    .product-navbar-hidden .product-index-header {
        top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .navbar--product-scroll-aware,
    .product-index-header {
        transition: none;
    }
}

.product-index-header--search {
    justify-content: space-between;
    padding-top: 20px;
    padding-bottom: 10px;
    top: 65px;
    background-color: var(--color-background);
}

.product-index-header__title {
    font: 700 24px/1.2 "Jost";
    white-space: nowrap;
}

.product-index-header__actions {
    display: flex;
    gap: 24px;

    background-color: var(--color-background);
    pointer-events: auto;

    @media (max-width: 768px) {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 20px;
    }
}

.product-index-search {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 164px;
    height: 36px;
    flex-shrink: 0;
    padding: 9px 12px;
    border: 1px solid var(--color-ice);
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 5.4px 6.75px rgba(0, 0, 0, 0.1);
}

.product-index-search__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: var(--color-olive);
}

.product-index-search__input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background-color: transparent;
    font: 400 14px/18px "Jost";
    color: var(--color-black-bean);

    &::placeholder {
        color: var(--color-dark-grey);
    }
}

.product-catalog .card-grid-wrapper[id] {
    scroll-margin-top: 80px;

    @media (max-width: 768px) {
        scroll-margin-top: 140px;
    }
}

.product-index {
    display: flex;
    flex-direction: column;
    gap: 48px;
    min-width: 0;
    grid-area: 1 / 1;

    @media (max-width: 768px) {
        padding-top: 0;
    }
}

.product-header {
    position: sticky;
    top: 72px;
    z-index: 2;
    padding: 10px 0 20px;
    background-color: var(--color-background);

    @media (max-width: 1024px) {
        position: static;
        padding-bottom: 0;
    }
}

.product-header__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    @media (max-width: 768px) {
        display: flex;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 18px;
    }
}

.product-header__title {
    min-height: 36px;
    min-width: 0;
    font: 700 24px/1.2 "Crimson Pro";
    color: var(--color-black-bean);

    @media (max-width: 768px) {
        font-size: 20px;
        margin-bottom: 4px;
    }
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 6px;

    @media (max-width: 768px) {
        flex: 1;
        min-width: 0;
        gap: 4px;
    }
}

.products-sort__label {
    font: 400 15px/1.4 "Jost";
    color: var(--color-black-bean);
    white-space: nowrap;

    @media (max-width: 768px) {
        font-size: 13px;
    }
}

.products-sort__trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.products-sort__value {
    font: 500 15px/1.4 "Jost";
    color: var(--color-olive);
    white-space: nowrap;

    @media (max-width: 768px) {
        font-size: 13px;
    }
}

.products-sort__chevron {
    width: 12px;
    height: 12px;
    display: block;

    @media (max-width: 768px) {
        width: 16px;
        height: 16px;
    }
}

.products-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--color-vanilla);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.products-search-btn img {
    width: 20px;
    height: 20px;
    display: block;
}

.search-index {
    margin-top: 40px;
    margin-bottom: 120px;

    @media (max-width: 768px) {
        margin-top: 60px;
    }
}

.category-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
    flex-shrink: 0;

    &::after {
        content: '';
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        height: 1px;
        background-color: var(--color-olive);
    }

    .category-search__icon {
        position: absolute;
        left: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;

        img {
            width: 16px;
            height: 16px;
        }
    }

    .category-search__input {
        width: 100%;
        padding: 10px 12px 10px 27px;
        border: 0;
        border-radius: 0;
        outline: none;
        font: 400 12px/1.5 'Jost';
        color: var(--color-text-primary);
        background-color: transparent;

        &::placeholder {
            color: var(--color-smoke);
        }
    }

    @media (max-width: 768px) {
        display: none;
    }
}

.category-search__empty {
    display: none;
    overflow: hidden;
    font: 400 14px/1.4 'Jost';
    color: var(--color-dark-grey);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-search__empty--visible {
    display: block;
}
