/* Category PLP — subcategories + product grid + filters */

body{
    background: #F2F4F7 !important;
}

.category-shop-page {
    direction: rtl;
}

.category-subcats-section {
    position: relative;
    width: 100%;
    margin-bottom: 28px;
    padding: 28px 0 36px;
    overflow: hidden;
}

.category-subcats-section__bg {
    position: absolute;
    inset: 0;
    background-color: #f8f9fc;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0.2;
}

.category-subcats-section__container {
    position: relative;
    z-index: 1;
    max-width: 1560px;
}

.category-subcats-section__title {
    margin: 0 0 62px;
    font-size: 22px;
    line-height: 1.5;
    font-weight: 800;
    color: #1d2939;
    text-align: right;
}

.category-shop-page .breadcrumb-container {
    background: transparent;
    padding: 0px;
    margin-bottom: 0px;
}

.category-shop-page .breadcrumb-container .js-breadcrumb {
    padding-right: 0px;
}

.category-subcats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 48px 18px;
}

.category-subcat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #344054;
}

.category-subcat-card__stage {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    min-height: 98px;
    padding: 0 12px;
    border-radius: 22px;
    background: #EBEBEB;
    overflow: visible;
}

.category-subcat-card__img {
    display: block;
    width: auto;
    max-width: 92%;
    max-height: 148px;
    margin-top: -36px;
    margin-bottom: -8px;
    object-fit: contain;
    object-position: center bottom;
}

.category-subcat-card__label {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 600;
    text-align: center;
}

.category-subcat-card:hover {
    color: #6941c9;
    text-decoration: none;
}

/* Listing toolbar + sort tabs (Figma: sort right, count left in RTL row) */
.shop-listing-toolbar {
    margin-bottom: 8px;
}

.shop-listing-toolbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    direction: rtl;
    padding-bottom: 12px;
}

.shop-listing-toolbar__sort-side {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    flex: 1 1 auto;
    min-width: 0;
}

.shop-listing-toolbar__sort-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.shop-listing-toolbar__count {
    margin: 0;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    color: #667085;
    white-space: nowrap;
}

.shop-listing-toolbar__sort-label {
    font-size: 14px;
    font-weight: 500;
    color: #667085;
    white-space: nowrap;
}

.shop-listing-sort {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shop-listing-sort > li {
    margin: 0;
    width: auto !important;
    text-align: inherit !important;
}

.shop-listing-sort .listing-tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    line-height: 1.4;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #667085 !important;
    text-decoration: none;
    background: transparent !important;
    transition: background 0.2s ease, color 0.2s ease;
}

.shop-listing-sort .listing-tab-item:hover {
    color: #6941c9 !important;
    background: #f9fafb !important;
    text-decoration: none;
}

.shop-listing-sort > li.listing-active .listing-tab-item {
    background: #f4ebff !important;
    color: #6941c9 !important;
    font-weight: 700;
}

.shop-listing-toolbar__mobile-btn.show-responsive-filters,
.shop-listing-toolbar__mobile-btn.show-responsive-sort-items {
    display: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    background: #ffffff;
    color: #6941c9;
    align-items: center;
    justify-content: center;
}

/* Kill legacy listing sort styles on category PLP */
.category-shop-page .listing .listing-header ul.sort-options {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 2px;
    margin: 0 !important;
    font-size: 14px;
}

.category-shop-page .listing .listing-header ul.sort-options li {
    display: list-item;
    width: auto !important;
    text-align: inherit !important;
}

.category-shop-page .listing .listing-header ul.sort-options li a.listing-tab-item {
    /* color: #667085 !important; */
    background: transparent !important;
    border-radius: 10px;
    height: auto;
    line-height: 1.4;
    padding: 7px 12px;
}

.category-shop-page .listing .listing-header ul.sort-options li a.listing-tab-item:hover {
    background: #f9fafb !important;
    color: #6941c9 !important;
}

.category-shop-page .listing .listing-header .listing-active a,
.category-shop-page .listing .listing-header li.listing-active a.listing-tab-item {
    background: #f4ebff !important;
    color: #6941c9 !important;
}

.category-shop-page .category-listing-header {
    display: block;
    margin-bottom: 18px;
}

/* Product grid (home card widget) */
.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.shop-products-grid__item {
    min-width: 0;
    height: 100%;
}

.shop-products-grid .shop-product-card--compact {
    min-height: 330px;
    height: 100%;
}

.category-shop-page .listing-items,
.category-shop-page .section-slider-product {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-shop-page .listing-items > li {
    display: block !important;
    height: auto !important;
}

.category-shop-page .listing-header {
    position: static;
    border: 0;
    background: #ffffff;
    padding: 0;
    overflow: visible;
}

.category-shop-page .page-contents,
.category-shop-page .listing-wrapper-tab,
.category-shop-page .listing {
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* Filters sidebar — each panel/card like Figma (برند, محدوده قیمت, …) */
.category-shop-page .filters-background {
    background: #ffffff;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.category-shop-page .sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-shop-page .shop-filter-panel {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.05);
    padding: 16px 16px 14px;
}

.category-shop-page .shop-filter-panel .title-product {
    font-size: 15px;
    font-weight: 700;
    color: #1d2939;
}

.category-shop-page .shop-filters-stack {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0 !important;
}

.category-shop-page .shop-filters-stack > .box,
.category-shop-page .shop-filters-stack > .feature-filter,
.category-shop-page .shop-filters-stack > .each-filter {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}

.category-shop-page .shop-filters-stack .box-header {
    border-bottom: 0;
    padding: 0;
    margin: 0;
}

.category-shop-page .shop-filters-stack .box-header h2 {
    margin: 0;
    font-size: inherit;
}

.category-shop-page .shop-filters-stack .box-header .btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    width: 100%;
    padding: 16px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    font-weight: 700;
    color: #1d2939;
    text-align: right;
    white-space: normal;
}

.category-shop-page .shop-filters-stack .box-header .btn:focus,
.category-shop-page .shop-filters-stack .box-header .btn:hover {
    background: #fcfcfd;
    color: #6941c9;
    box-shadow: none;
}

.category-shop-page .shop-filters-stack .box-header .btn .mdi {
    font-size: 24px;
    color: #98a2b3;
    transition: transform 0.2s ease, color 0.2s ease;
    background: transparent;
}

.category-shop-page .shop-filters-stack .box-header .btn[aria-expanded="true"] .mdi-chevron-down {
    transform: rotate(180deg);
    color: #6941c9;
}

.category-shop-page .shop-filters-stack .filter-items,
.category-shop-page .shop-filters-stack .collapse.filter-items {
    border-top: 1px solid #f2f4f7;
}

.category-shop-page .shop-filters-stack .filter-items-values {
    padding: 8px 18px 16px;
    max-height: 280px;
    overflow-y: auto;
}

.category-shop-page .shop-filters-stack .form-auth-row {
    position: relative;
    margin: 0 0 8px;
    padding: 4px 18px 4px 4px;
    min-height: 30px;
    font-size: 14px;
    line-height: 2;
    color: #475467;
}

.category-shop-page .shop-filters-stack .remember-me {
    margin-top: -4px;
    margin-right: 16px;
    text-align: right;
    color: #475467;
}

.category-shop-page .shop-filters-stack .ui-checkbox {
    width: 20px;
    height: 20px;
    position: absolute;
    right: 0px;
    top: 6px;
    margin-left: 10px;
}

.category-shop-page .shop-filters-stack .ui-checkbox input[type="checkbox"] {
    display: block !important;
    opacity: 0;
    position: absolute;
    z-index: 999;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.category-shop-page .shop-filters-stack .ui-checkbox-check {
    display: block;
}

.category-shop-page .shop-filters-stack .search-box {
    padding: 0 18px 16px;
}

.category-shop-page .shop-filter-panel .input-field-cleanable,
.category-shop-page .shop-filters-stack .form-control{
    width: 100%;
    min-height: 44px;
    padding: 10px 44px 10px 14px;
    border: 1px solid #eaecf0;
    border-radius: 999px;
    background: #f9fafb;
    font-size: 13px;
    color: #344054;
    box-shadow: none;
}

.category-shop-page .shop-filter-panel .btn-search-cleanable {
    border: 0;
    background: transparent;
    position: absolute;
}

.category-shop-page .shop-filter-panel .ui-input-quick-search {
    position: relative;
}

.category-shop-page .shop-filters-stack > .box:has(.statusswitcher) {
    padding: 14px 18px;
}

.category-shop-page .shop-filters-stack .statusswitcher {
    margin: 0;
    padding: 0;
}

.category-shop-page .shop-filters-stack .statusswitcher input.filter-checkbox[type="checkbox"] {
    display: none;
}

.category-shop-page .shop-filters-stack .statusswitcher input.filter-checkbox:checked ~ .switch {
    background: #7f56d9 !important;
    border-color: #7f56d9 !important;
}

.category-shop-page .shop-filters-stack .statusswitcher input.filter-checkbox:checked ~ .toggle {
    background: #ffffff;
}

.category-shop-page .shop-filters-stack .statusswitcher label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    gap: 12px;
    margin: 0;
    cursor: pointer;
}

.category-shop-page .shop-filters-stack .statusswitcher .switch-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #344054;
}

.category-shop-page .shop-filters-stack .statusswitcher .toggle,
.category-shop-page .shop-filters-stack .statusswitcher .switch {
    flex: 0 0 auto;
}

.category-shop-page .shop-filters-stack .filter-color {
    margin-right: 8px;
    vertical-align: middle;
}

.category-shop-page .got-filters-container .catalog.items {
    padding-top: 4px;
}

.category-shop-page .got-filters-container .each-got-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 4px 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f4ebff;
    color: #6941c9;
    font-size: 12px;
}

.category-shop-page .brand-page-description.about {
    box-shadow: none;
}

.category-shop-page .brand-page-description {
    margin: 8px 0 20px;
}

.category-shop-page .brand-page-description .page-content-about-paragraph {
    font-size: 14px;
    line-height: 1.9;
    color: #475467;
    text-align: right;
}

.category-shop-page .brand-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 20px;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.05);
}

.category-shop-page .brand-card-image {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #f9fafb;
}

.category-shop-page .brand-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-shop-page .brand-card-title,
.category-shop-page .brand-card-title p {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1d2939;
    text-align: right;
}

.mobile-filter-drawer-head {
    display: none;
}

@media (max-width: 1199px) {
    .shop-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .category-subcats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shop-listing-toolbar__sort-head {
        gap: 10px;
    }

    .shop-listing-toolbar__mobile-btn.show-responsive-filters,
    .shop-listing-toolbar__mobile-btn.show-responsive-sort-items {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 40px !important;
        width: auto;
        margin: 0;
        padding: 0 16px;
        border: 1px solid #eaecf0;
        border-radius: 999px !important;
        background: #ffffff;
        color: #344054;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    }

    .shop-listing-toolbar__mobile-btn i {
        font-size: 16px;
        color: #667085;
    }

    /* Filters drawer: list of filter names, then one filter's values */
    .category-shop-page .filters-background {
        z-index: 1010;
        padding: 0 20px 32px;
        background: #ffffff;
    }

    .category-shop-page #close-responsive-filters {
        display: none !important;
    }

    .category-shop-page .mobile-filter-drawer-head {
        position: sticky;
        top: 0;
        z-index: 5;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 40px 0 24px;
        background: #ffffff;
    }

    .category-shop-page .mobile-filter-drawer-back {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #344054;
        font-size: 18px;
        cursor: pointer;
    }

    .category-shop-page .mobile-filter-drawer-title {
        font-size: 17px;
        font-weight: 700;
        color: #1d2939;
    }

    .category-shop-page .filters-background .shop-filter-panel {
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0 0 16px;
    }

    .category-shop-page .filters-background .shop-filters-stack > .box,
    .category-shop-page .filters-background .shop-filters-stack > .feature-filter,
    .category-shop-page .filters-background .shop-filters-stack > .each-filter {
        margin: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .category-shop-page .filters-background .shop-filters-stack > .each-filter::after {
        content: "";
        display: block;
        height: 1px;
        margin-left: 24px;
        background: linear-gradient(90deg, rgba(214, 57, 127, 0) 0%, rgba(214, 57, 127, 0.45) 55%, rgba(233, 67, 147, 0.75) 100%);
    }

    .category-shop-page .filters-background .shop-filters-stack .box-header .btn {
        padding: 20px 0;
        font-size: 16px;
        font-weight: 500;
        color: #344054;
        background: transparent;
    }

    .category-shop-page .filters-background .shop-filters-stack .box-header .btn:hover,
    .category-shop-page .filters-background .shop-filters-stack .box-header .btn:focus {
        background: transparent;
        color: #344054;
    }

    .category-shop-page .filters-background .shop-filters-stack .box-header .btn .mdi,
    .category-shop-page .filters-background .shop-filters-stack .box-header .btn[aria-expanded="true"] .mdi-chevron-down {
        transform: rotate(90deg);
        color: #667085;
    }

    .category-shop-page .filters-background:not(.is-filter-detail) .shop-filters-stack .filter-items {
        display: none !important;
    }

    .category-shop-page .filters-background .shop-filters-stack > .box:has(.statusswitcher) {
        padding: 20px 0;
    }

    .category-shop-page .filters-background .shop-filters-stack .statusswitcher .switch-title {
        font-size: 16px;
        font-weight: 500;
    }

    .category-shop-page .filters-background.is-filter-detail .got-filters-container,
    .category-shop-page .filters-background.is-filter-detail .shop-filter-panel--search,
    .category-shop-page .filters-background.is-filter-detail .shop-filters-stack > .box:not(.is-mobile-active) {
        display: none !important;
    }

    .category-shop-page .filters-background.is-filter-detail .each-filter.is-mobile-active > .box-header,
    .category-shop-page .filters-background.is-filter-detail .each-filter.is-mobile-active::after {
        display: none;
    }

    .category-shop-page .filters-background.is-filter-detail .each-filter.is-mobile-active .filter-items {
        display: block !important;
        height: auto !important;
        border-top: 0;
    }

    .category-shop-page .filters-background.is-filter-detail .filter-items-values {
        max-height: none;
        padding: 0;
        overflow: visible;
    }

    .category-shop-page .filters-background.is-filter-detail .form-auth-row {
        min-height: 44px;
        margin: 0 0 14px;
        padding: 8px 34px 8px 0;
        font-size: 15px;
    }

    .category-shop-page .filters-background.is-filter-detail .ui-checkbox {
        top: 12px;
    }

    .category-shop-page .filters-background.is-filter-detail .remember-me {
        margin: 0;
        font-weight: 600;
        color: #344054;
    }

    /* Sort bottom sheet */
    .category-shop-page .responsive-sort-options {
        z-index: 1010;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        background: rgba(16, 24, 40, 0.45);
    }

    .category-shop-page .responsive-sort-options .title {
        position: relative;
        top: auto;
        left: auto;
        height: auto;
        padding: 40px 20px 18px;
        border-radius: 24px 24px 0 0;
        background: #ffffff;
    }

    .category-shop-page .responsive-sort-options .title::before {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        width: 84px;
        height: 4px;
        border-radius: 999px;
        background: #d0d5dd;
        transform: translateX(-50%);
    }

    .category-shop-page .responsive-sort-options .title p {
        font-size: 16px;
        font-weight: 700;
        color: #1d2939;
    }

    .category-shop-page #close-responsive-sort-options {
        display: none;
    }

    .category-shop-page .responsive-sort-options .filter-by-status-select {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 4px 20px 36px;
        background: #ffffff;
    }

    .category-shop-page .responsive-sort-options .filter-by-status-select li {
        position: relative;
        width: 100% !important;
        padding: 0;
        border: 0;
    }

    .category-shop-page .responsive-sort-options .filter-by-status-select li.listing-active::before {
        content: none;
    }

    .category-shop-page .responsive-sort-options .filter-by-status-select li.listing-active::after {
        content: "\f05d";
        position: absolute;
        top: 50%;
        bottom: auto;
        left: 16px;
        width: auto;
        height: auto;
        background: transparent;
        font-family: FontAwesome;
        font-size: 22px;
        line-height: 1;
        color: #574f9a;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .category-shop-page .responsive-sort-options .filter-by-status-select li a.listing-tab-item {
        display: flex;
        justify-content: flex-start;
        width: 100%;
        padding: 14px 18px;
        border-radius: 999px;
        font-size: 15px;
        font-weight: 500;
        color: #344054 !important;
        background: transparent !important;
    }

    .category-shop-page .responsive-sort-options .filter-by-status-select li.listing-active a.listing-tab-item {
        background: #efedf7 !important;
        color: #574f9a !important;
        font-weight: 600;
    }

    .shop-listing-sort--desktop.sort-options {
        display: none !important;
    }

    .shop-listing-toolbar__row {
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 0px;
    }

    .shop-listing-toolbar__count {
        width: 100%;
        text-align: left;
        direction: ltr;
        display: none;
    }

    .category-shop-page .listing-header {
        background-color: transparent !important;
        margin-bottom: 0px;
    }
}

@media (max-width: 767px) {
    .category-subcats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .category-subcat-card__stage {
        min-height: 96px;
    }

    .category-subcat-card__img {
        max-height: 120px;
        margin-top: -28px;
    }

    .shop-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}
