/* The page below the switch starts on the white canvas. */
body .sh-tabs-wrap { border-block-end: 0 !important; }
body :is(.listing-map-area, .listing-single).header-next.border-top { border-top: 0 !important; }

.catalog-main-categories {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 2px 7px;
    margin: 0 0 7px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.catalog-main-categories .catalog-category-chip,
body:has([data-catalog-rows]) .chips-scroll .chips-scroll-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 3px 12px;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 999px;
    background: #fff;
    color: #4a5965;
    font-size: .875rem;
    white-space: nowrap;
    text-decoration: none;
}

.catalog-main-categories .catalog-category-chip:is(.is-current,:hover),
body:has([data-catalog-rows]) .chips-scroll .chips-scroll-item:is(.active,:hover) {
    border-color: rgba(20, 149, 186, .48);
    background: #f2f9fc;
    color: #087b9b;
}

.catalog-category-icon {
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    overflow: hidden;
    border-radius: 50%;
    background: #f0f8fb;
}
.catalog-category-icon img { display: block; width: 22px; height: 22px; border-radius: 50%; object-fit: contain; }
body:has([data-catalog-rows]) .chips-scroll-item img { border-radius: 50%; }

#sooq-header #sh-search-form .catalog-header-sort {
    position: relative;
    flex: 0 0 auto;
    opacity: 1;
    margin-inline-start: auto;
    border-inline-start: 1px solid rgba(15,23,42,.10);
    padding-inline: 4px;
}
.catalog-header-sort summary {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    list-style: none;
    border-radius: 50%;
    background: #f0f8fb;
    color: #158bac;
    cursor: pointer;
}
.catalog-header-sort summary::-webkit-details-marker { display: none; }
.catalog-header-sort summary:focus-visible,
.catalog-category-chip:focus-visible { outline: 2px solid #1495ba; outline-offset: 1px; }

.catalog-sort-options {
    position: absolute;
    inset-inline-end: 0;
    inset-block-start: calc(100% + 8px);
    z-index: 1100;
    min-width: 180px;
    width: max-content;
    padding: 5px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(15, 23, 42, .12);
}
.catalog-sort-options button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 7px;
    padding: 7px 10px;
    background: #fff;
    color: #344550;
    text-align: start;
}
.catalog-sort-options button:is(:hover,[aria-pressed="true"]) { background: #edf7fb; color: #087b9b; }

body.catalog-sort-ready :is(.sort-row:has(#catSortSelect), .mobile-bar:has(#mobileSortSelect), .sort-item:has(#select_sort), .page-sidebar:has(.sidebar-sort-list)) {
    display: none !important;
}
body.catalog-sort-ready .page-wrap:has(> .page-sidebar .sidebar-sort-list) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main";
}
body:has([data-catalog-rows]) .listing-map-area.header-next { padding-block-start: 12px !important; }
body.catalog-sort-ready .listing-map-area .product-sort-area { padding-block-end: 0 !important; }
@media (max-width: 575px) {
    .catalog-main-categories { scrollbar-width: none; }
    #sooq-header #sh-search-form .catalog-header-sort { padding-inline: 2px; }
    .catalog-header-sort summary { width: 28px; height: 28px; }
}

body:has(.sh-tabs-wrap) .header-next.border-top { border-top: 0 !important; }
body:has([data-catalog-rows]) .chips-scroll:has(.chips-scroll-item:not(:first-child).active) {
    display: flex;
}

body:has([data-catalog-rows]) .sh-tabs {
    box-sizing: border-box;
    height: 32px;
    padding-block: 3px;
}
body:has([data-catalog-rows]) .sh-tab {
    min-height: 0;
    height: 24px;
    padding-block: 0;
    line-height: 24px;
}
@media (min-width: 768px) {
    body:has([data-catalog-rows]) :is(.sh-add-ad-btn, .sh-login-btn) { min-height: 36px; }
}
.catalog-main-categories,
body:has([data-catalog-rows]) .chips-scroll {
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}
.catalog-main-categories .catalog-category-chip,
body:has([data-catalog-rows]) .chips-scroll .chips-scroll-item,
.catalog-sheet-chip {
    box-sizing: border-box;
    min-height: 26px;
    line-height: 18px;
    padding: 2px 10px;
    gap: 6px;
}
.catalog-category-icon { flex-basis: 16px; width: 16px; height: 16px; }
.catalog-category-icon img,
body:has([data-catalog-rows]) .chips-scroll-item img {
    width: 16px;
    height: 16px;
}
@media (hover: hover) and (pointer: fine) {
    .catalog-drag, .catalog-drag a { cursor: grab; }
    .catalog-dragging, .catalog-dragging a { cursor: grabbing; user-select: none; }
}
.catalog-filter-launch, .catalog-sheet { display: none; }
@media (max-width: 767px) {
    body.catalog-mobile-ready #sooq-header.nav-hidden {
        display: block;
        transform: none;
        opacity: 1;
    }
    #sooq-header .catalog-mobile-menus {
        display: grid;
        grid-template-rows: 1fr;
        transition: grid-template-rows .22s ease, opacity .18s ease, visibility .22s;
        background: #fff;
    }
    .catalog-mobile-menus-inner { min-height: 0; overflow: hidden; }
    .catalog-mobile-menus-inner > :is(.catalog-main-categories,.chips-scroll) {
        width: calc(100% - 24px);
        margin: 0 auto 3px;
        padding: 2px;
    }
    .catalog-mobile-menus-inner > .chips-scroll-sub2,
    .catalog-mobile-menus-inner > .chips-scroll:nth-of-type(n+3) { display: none !important; }
    #sooq-header .catalog-mobile-menus .sh-tabs-wrap { position: static; }
    body.catalog-browsing #sooq-header .catalog-mobile-menus {
        grid-template-rows: 0fr;
        opacity: 0;
        visibility: hidden;
    }
    body.catalog-mobile-ready #sooqBottomNav.nav-hidden {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }
    body.catalog-browsing #sooqBottomNav,
    body.catalog-sheet-visible #sooqBottomNav {
        transform: translateY(110%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        visibility: hidden;
    }
    .catalog-filter-launch {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        flex: none;
        margin-inline-end: 3px;
        padding: 3px 7px;
        min-height: 27px;
        border: 1px solid #deedf2;
        border-radius: 999px;
        color: #087b9b;
        background: #f0f8fb;
        font: inherit;
        font-size: .75rem;
        cursor: pointer;
    }
    body.catalog-mobile-ready #sooq-header #sh-search-form .catalog-header-sort {
        margin-inline-start: 0;
    }
    .catalog-sheet {
        position: fixed;
        inset: auto 0 0;
        z-index: 1040;
        width: 100%;
        max-height: 55dvh;
        padding: 8px 14px max(10px, env(safe-area-inset-bottom));
        box-sizing: border-box;
        border: 1px solid #e0eaf0;
        border-radius: 21px 21px 0 0;
        background: #fff;
        color: #172537;
        box-shadow: 0 -5px 24px #17354621;
        overflow: auto;
        transform: translateY(105%);
        visibility: hidden;
        transition: transform .22s ease, visibility .22s ease;
    }
    .catalog-sheet:not([hidden]) { display: flex; flex-direction: column; gap: 7px; }
    body.catalog-sheet-visible .catalog-sheet { transform: none; visibility: visible; }
    .catalog-sheet-handle { width: 35px; height: 4px; border-radius: 8px; background: #d2e0e7; align-self: center; flex: none; }
    .catalog-sheet-head, .catalog-sheet-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .catalog-sheet-head { font-size: .75rem; color: #526777; }
    .catalog-sheet-close { border-radius: 50%; width: 29px; height: 29px; border: 1px solid #e0eaf0; background: white; color: #526777; }
    .catalog-sheet-search { border: 1px solid #dae6eb; border-radius: 10px; background: #fafcfd; min-height: 33px; padding-inline: 10px; font: inherit; font-size: .875rem; width: 100%; }
    .catalog-sheet-row { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-inline: contain; padding: 2px 1px; }
    .catalog-sheet-row + .catalog-sheet-row { margin-top: 3px; }
    .catalog-sheet-chip {
        display: inline-flex; align-items: center; flex: none; white-space: nowrap;
        border: 1px solid #e0e8ec; border-radius: 999px; background: #fff; color: #4a5965;
        font: inherit; font-size: .8rem; line-height: 18px; cursor: pointer;
    }
    .catalog-sheet-chip[aria-pressed=true] { border-color: #82c4d6; color: #087b9b; background: #f0f8fb; }
    .catalog-sheet-chip img { width: 16px; height: 16px; border-radius: 50%; object-fit: contain; }
    .catalog-sheet-actions { border-top: 1px solid #e5ecf0; padding-top: 7px; }
    .catalog-sheet-actions :is(a,button) { display: grid; place-items: center; min-height: 38px; padding-inline: 12px; border: 1px solid #c9dfe8; border-radius: 10px; color: #087b9b; background: #fff; }
    .catalog-sheet-actions a { flex: 1; border-color: #0b809f; background: #0b809f; color: white; font-weight: 700; }
    .catalog-sheet-message { margin: 0; font-size: .8rem; color: #526777; }
}
@media (prefers-reduced-motion: reduce) {
    .catalog-mobile-menus, .catalog-sheet { transition: none !important; }
}
@media (max-width: 767px) {
    body.catalog-mobile-ready #sooq-header.nav-hidden {
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    body.catalog-mobile-ready #sooqBottomNav.nav-hidden {
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    body.catalog-mobile-ready.catalog-browsing #sooqBottomNav,
    body.catalog-mobile-ready.catalog-sheet-visible #sooqBottomNav {
        transform: translateY(110%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}
@media (max-width: 767px) {
    body.catalog-mobile-ready { overflow-anchor: none; }
    body.catalog-mobile-ready .chips-scroll[hidden] { display: none !important; }
}

@media (max-width: 767px) {
    body.catalog-mobile-ready #sh-login-trigger { min-height: 36px; }
}

@media (max-width: 767px) { html:has(body.catalog-mobile-ready:not([style*="overflow: hidden"])), body.catalog-mobile-ready:not([style*="overflow: hidden"]) { overflow-x: clip !important; overflow-y: visible !important; } }
