﻿/* Danukala catalog: one scoped style sheet for the filter rail and product list. */
.catalog-page {
    --catalog-ink: #20365a;
    --catalog-text: #394c68;
    --catalog-muted: #748296;
    --catalog-accent: #118eaa;
    --catalog-accent-dark: #08718d;
    --catalog-tint: #effaff;
    --catalog-line: #e7ecf1;
    background: #fff;
    color: var(--catalog-ink);
    min-height: 70vh;
    font-size: 13px;
    line-height: 1.75;
}

    .catalog-page *, .catalog-page *::before, .catalog-page *::after {
        box-sizing: border-box;
    }

.catalog-shell {
    width: min(calc(100% - 48px), 1550px);
    margin-inline: auto;
    padding: 19px 0 64px;
}

.catalog-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0 0 16px;
    color: var(--catalog-muted);
    font-size: 12px;
}

    .catalog-breadcrumb a {
        color: inherit;
        text-decoration: none;
    }

        .catalog-breadcrumb a:hover {
            color: var(--catalog-accent-dark);
        }

    .catalog-breadcrumb [aria-current] {
        color: var(--catalog-ink);
    }

.catalog-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--catalog-line);
}

.catalog-eyebrow {
    display: block;
    color: var(--catalog-accent-dark);
    font-size: 11px;
    font-weight: 750;
}

body.dk-body .catalog-page .catalog-heading h1 {
    margin: 2px 0 0;
    color: var(--catalog-ink);
    font-size: clamp(20px, 2vw, 25px);
    line-height: 1.45;
    font-weight: 800;
}

.catalog-heading p {
    margin: 0;
    color: var(--catalog-muted);
    font-size: 12px;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 265px minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    margin-top: 17px;
}

/* Sidebar mirrors the clear row rhythm of the reference, with Danukala accents. */
.catalog-sidebar {
    position: sticky;
    top: 14px;
    max-height: min(87vh, 900px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 16px 4px;
    border: 1px solid #e0e7ed;
    border-radius: 13px;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #c1dbe4 transparent;
}

.catalog-sidebar__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 1px 17px;
}

    .catalog-sidebar__heading strong {
        font-size: 16px;
        font-weight: 800;
    }

    .catalog-sidebar__heading a {
        color: var(--catalog-accent-dark);
        font-size: 11px;
        font-weight: 700;
        text-decoration: none;
    }

        .catalog-sidebar__heading a:hover {
            text-decoration: underline;
        }

.catalog-availability {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 55px;
    border-top: 1px solid var(--catalog-line);
}

    .catalog-availability label {
        color: var(--catalog-text);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

.catalog-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    margin: 0;
    border: 0;
    border-radius: 99px;
    background: #d6e0e8;
    cursor: pointer;
    transition: background .18s;
}

    .catalog-switch::before {
        content: '';
        position: absolute;
        top: 3px;
        right: 3px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 3px #17324b38;
        transition: transform .18s;
    }

    .catalog-switch:checked {
        background: var(--catalog-accent);
    }

        .catalog-switch:checked::before {
            transform: translateX(-16px);
        }

.catalog-facet {
    border-top: 1px solid var(--catalog-line);
}

    .catalog-facet summary {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 54px;
        padding: 12px 1px;
        color: var(--catalog-text);
        font-size: 14px;
        font-weight: 700;
        list-style: none;
        cursor: pointer;
    }

        .catalog-facet summary::-webkit-details-marker {
            display: none;
        }

        .catalog-facet summary::after {
            content: '';
            width: 8px;
            height: 8px;
            margin-inline-start: auto;
            border-inline-end: 2px solid #8998a9;
            border-bottom: 2px solid #8998a9;
            transform: rotate(45deg);
            transition: transform .18s;
        }

    .catalog-facet[open] summary {
        color: var(--catalog-accent-dark);
    }

        .catalog-facet[open] summary::after {
            transform: rotate(225deg);
        }

.catalog-facet__search {
    display: block;
    width: 100%;
    height: 39px;
    margin: 1px 0 8px;
    padding: 7px 12px;
    border: 1px solid #d7e4eb;
    border-radius: 8px;
    outline: none;
    background: #fafcfe;
    color: var(--catalog-ink);
    font: inherit;
    font-size: 12px;
}

    .catalog-facet__search:focus {
        border-color: var(--catalog-accent);
        box-shadow: 0 0 0 3px #118eaa17;
    }

    .catalog-facet__search::placeholder {
        color: #8b99a8;
    }

.catalog-facet__options {
    max-height: 238px;
    overflow-y: auto;
    padding: 0 2px 11px;
    scrollbar-width: thin;
    scrollbar-color: #bbd9e1 transparent;
}

.catalog-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--catalog-text);
    font-size: 12.5px;
    line-height: 1.55;
    cursor: pointer;
    transition: background .15s;
}

    .catalog-option[hidden] {
        display: none;
    }

    .catalog-option:hover, .catalog-option:has(input:checked) {
        background: var(--catalog-tint);
    }

.catalog-option--all {
    color: var(--catalog-accent-dark);
    font-weight: 700;
}

.catalog-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--catalog-accent);
    cursor: pointer;
}

.catalog-option span:not(.catalog-color-dot) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-option small {
    margin-inline-start: auto;
    color: #8999a9;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.catalog-color-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border: 1px solid #c8d2dc;
    border-radius: 50%;
    background: var(--swatch);
}

/* The toolbar and every selectable filter still use the existing GET query. */
.catalog-results {
    min-width: 0;
    transition: opacity .15s;
}

    .catalog-results.is-updating {
        opacity: .55;
        pointer-events: none;
    }

.catalog-results__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    margin-bottom: 14px;
    padding: 0 1px 12px;
    border-bottom: 1px solid var(--catalog-line);
}

.catalog-results__label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

    .catalog-results__label strong {
        font-size: 14px;
        font-weight: 800;
    }

.catalog-active-count {
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--catalog-tint);
    color: var(--catalog-accent-dark);
    font-size: 11px;
}

.catalog-sort {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--catalog-muted);
    font-size: 12px;
    white-space: nowrap;
}

    .catalog-sort select {
        min-height: 38px;
        max-width: 150px;
        padding: 6px 10px;
        border: 1px solid #dce5ea;
        border-radius: 8px;
        background: #fff;
        color: var(--catalog-ink);
        font: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
    }

/* One grid, four balanced cards. Only source-backed facts appear in each card. */
.catalog-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.catalog-product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e9edf1;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 2px 12px #1b3e5c08;
    transition: box-shadow .18s, border-color .18s, transform .18s;
}

    .catalog-product-card:hover {
        position: relative;
        z-index: 1;
        border-color: #b4dce7;
        box-shadow: 0 10px 28px #1b3e5c1c;
        transform: translateY(-2px);
    }

.catalog-product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 14px 13px 17px;
    color: inherit;
    text-decoration: none;
}

.catalog-product-card__image-box {
    position: relative;
    flex: none;
    width: 100%;
    height: 178px;
    margin-bottom: 10px;
    overflow: hidden;
}

    .catalog-product-card__image-box .catalog-product-card__image {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        color: transparent;
        font-size: 0;
    }

.catalog-product-card__no-image {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--catalog-muted);
    font-size: 12px;
}

.catalog-product-card__colors {
    position: absolute;
    top: 8px;
    inset-inline-end: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 5px;
    border-radius: 99px;
    background: #ffffffea;
}

.catalog-product-card__swatch {
    display: block;
    width: 11px;
    height: 11px;
    border: 1px solid #bdc9d2;
    border-radius: 50%;
    background: var(--swatch);
}

.catalog-product-card__discount {
    flex: none;
    padding: 2px 7px;
    border-radius: 5px;
    background: #c62c4d;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.catalog-product-card__highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    min-height: 37px;
    margin: 0 0 8px;
    overflow: hidden;
}

.catalog-product-card__highlight {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
    padding-inline-start: 7px;
    border-inline-start: 2px solid #d8e9ef;
}

.catalog-product-card__highlights b, .catalog-product-card__highlights small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-product-card__highlights b {
    color: #254565;
    font-size: 11px;
    font-weight: 750;
}

.catalog-product-card__highlights small {
    color: var(--catalog-muted);
    font-size: 10px;
}

body.dk-body .catalog-page .catalog-product-card__title {
    display: block;
    flex: none;
    height: 47px;
    margin: 0 0 8px;
    overflow: hidden;
    color: #263b57;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.8;
    text-align: right;
}

.catalog-product-card__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 23px;
    margin-top: auto;
    color: #9b7605;
    font-size: 11px;
    font-weight: 700;
}

    .catalog-product-card__meta small {
        color: #8b99a7;
        font-weight: 400;
    }

.catalog-product-card__price {
    min-height: 62px;
    margin-top: 4px;
    padding-top: 9px;
    border-top: 1px solid #f0f3f6;
}

    .catalog-product-card__price del {
        display: block;
        min-height: 17px;
        color: #98a5b0;
        font-size: 11px;
        text-align: left;
    }

.catalog-product-card__price-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
}

.catalog-product-card__amount {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    margin-inline-start: auto;
    white-space: nowrap;
}

.catalog-product-card__price strong {
    color: #1e3554;
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.catalog-product-card__amount > span {
    color: var(--catalog-muted);
    font-size: 10px;
}

.catalog-product-card__unavailable {
    display: block;
    color: var(--catalog-muted) !important;
    font-size: 11px !important;
    font-weight: 600;
}

.catalog-scroll-sentinel {
    display: grid;
    min-height: 58px;
    place-items: center;
    padding: 12px;
    color: var(--catalog-muted);
    font-size: 12px;
}

.catalog-loading[hidden], .catalog-more[hidden], .catalog-next-page[hidden] {
    display: none;
}

.catalog-more {
    padding: 8px 16px;
    border: 1px solid #c6e7ee;
    border-radius: 8px;
    background: var(--catalog-tint);
    color: var(--catalog-accent-dark);
    font: inherit;
    cursor: pointer;
}

.catalog-next-page {
    display: block;
    width: fit-content;
    margin: 0 auto 14px;
    color: var(--catalog-accent-dark);
    font-size: 11px;
    text-decoration: none;
}

.catalog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 65px 18px;
    border: 1px solid var(--catalog-line);
    border-radius: 10px;
    text-align: center;
    color: var(--catalog-muted);
}

    .catalog-empty strong {
        color: var(--catalog-ink);
    }

    .catalog-empty a {
        color: var(--catalog-accent-dark);
        font-weight: 700;
    }

.catalog-seo-content {
    margin-top: 44px;
    padding-top: 23px;
    border-top: 1px solid var(--catalog-line);
    color: #485a6c;
    font-size: 14px;
    line-height: 2;
}

.catalog-page :focus-visible {
    outline: 2px solid var(--catalog-accent);
    outline-offset: 2px;
}

@media (max-width: 1280px) {
    .catalog-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 950px) {
    .catalog-layout {
        grid-template-columns: 228px minmax(0, 1fr);
        gap: 14px;
    }

    .catalog-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .catalog-shell {
        width: calc(100% - 24px);
        padding-top: 14px;
    }

    .catalog-heading p {
        display: none;
    }

    .catalog-layout {
        display: block;
    }

    .catalog-sidebar {
        position: static;
        max-height: 330px;
        margin-bottom: 15px;
    }

    .catalog-product-grid {
        gap: 8px;
    }

    .catalog-product-card__link {
        padding: 10px 9px 13px;
    }

    .catalog-product-card__image-box {
        height: 145px;
    }

    .catalog-product-card__highlights {
        gap: 3px;
    }

        .catalog-product-card__highlights b, .catalog-product-card__highlights small {
            font-size: 9px;
        }

    .catalog-product-card__price strong {
        font-size: 14px;
    }
}

@media (max-width: 390px) {
    .catalog-product-card__image-box {
        height: 132px;
    }

    .catalog-product-card__highlights > span:nth-child(2) {
        display: none;
    }

    .catalog-sort span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-product-card, .catalog-switch, .catalog-switch::before, .catalog-facet summary::after {
        transition: none;
    }
}
.catalog-product-card__highlight {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-product-card__highlight-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    object-fit: contain;
}

.catalog-product-card__highlight-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
/* =========================================================
   Catalog filter sidebar visual refinement
   ========================================================= */

.catalog-sidebar {
    padding: 24px 22px 10px;
    border: 1px solid #dfe5eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(31, 54, 83, 0.04);
    scrollbar-width: thin;
    scrollbar-color: #b9dbe5 transparent;
}

.catalog-sidebar__heading {
    min-height: 58px;
    padding: 0 2px 20px;
}

    .catalog-sidebar__heading strong {
        color: var(--catalog-ink);
        font-size: 22px;
        line-height: 1.5;
        font-weight: 900;
    }

    .catalog-sidebar__heading a {
        color: var(--catalog-accent-dark);
        font-size: 14px;
        line-height: 1.5;
        font-weight: 750;
    }

.catalog-availability {
    min-height: 68px;
    gap: 14px;
}

    .catalog-availability label {
        color: var(--catalog-text);
        font-size: 16px;
        line-height: 1.7;
        font-weight: 750;
    }

.catalog-switch {
    width: 46px;
    height: 26px;
}

    .catalog-switch::before {
        top: 3px;
        right: 3px;
        width: 20px;
        height: 20px;
    }

    .catalog-switch:checked::before {
        transform: translateX(-20px);
    }

.catalog-facet summary {
    min-height: 66px;
    padding: 17px 2px;
    gap: 14px;
    color: var(--catalog-text);
    font-size: 17px;
    line-height: 1.7;
    font-weight: 800;
}

    .catalog-facet summary::after {
        width: 10px;
        height: 10px;
        border-inline-end-width: 2px;
        border-bottom-width: 2px;
    }

.catalog-facet__search {
    height: 46px;
    margin: 2px 0 12px;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.catalog-facet__options {
   
    padding: 0 2px 14px;
}

.catalog-option {
    min-height: 52px;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--catalog-text);
    font-size: 16px;
    line-height: 1.75;
    font-weight: 550;
}

    .catalog-option:hover,
    .catalog-option:has(input:checked) {
        background: #effaff;
    }

.catalog-option--all {
    font-weight: 750;
}

.catalog-option input {
    width: 21px;
    height: 21px;
}

.catalog-option span:not(.catalog-color-dot) {
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.catalog-color-dot {
    width: 20px;
    height: 20px;
}

/* پشتیبان: اگر جایی شمارنده از Razor حذف نشده بود */
.catalog-option > small {
    display: none !important;
}

/* نمایش عریض دسکتاپ */
@media (min-width: 1281px) {
    .catalog-layout {
        grid-template-columns: 305px minmax(0, 1fr);
        gap: 24px;
    }
}

/* لپ‌تاپ و نمایشگرهای متوسط */
@media (min-width: 951px) and (max-width: 1280px) {
    .catalog-layout {
        grid-template-columns: 305px minmax(0, 1fr);
        gap: 18px;
    }

    .catalog-sidebar {
        padding-inline: 18px;
    }
}

/* در موبایل پنل بیش از حد بلند نشود */
@media (max-width: 700px) {
    .catalog-sidebar {
        max-height: 430px;
        padding: 18px 16px 8px;
    }

    .catalog-sidebar__heading strong {
        font-size: 19px;
    }

    .catalog-facet summary {
        min-height: 58px;
        font-size: 16px;
    }

    .catalog-option {
        min-height: 48px;
        font-size: 15px;
    }
}
/* =========================================================
   Final filter sidebar sizing and scrolling
   ========================================================= */

/* تنها خود پنل اصلی فیلتر اسکرول داشته باشد */
.catalog-sidebar {
    position: sticky;
    top: 12px;
    height: calc(100vh - 24px);
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* اسکرول مستقل هر گروه فیلتر حذف شود */
.catalog-facet__options {
    max-height: none;
    overflow: visible;
    padding-bottom: 14px;
}

/* عرض متعادل در نمایشگرهای بزرگ */
@media (min-width: 1281px) {
    .catalog-layout {
        grid-template-columns: 305px minmax(0, 1fr);
        gap: 22px;
    }
}

/* عرض مناسب لپ‌تاپ و نمایشگر متوسط */
@media (min-width: 951px) and (max-width: 1280px) {
    .catalog-layout {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 18px;
    }

    .catalog-sidebar {
        padding-inline: 17px;
    }
}

/* در موبایل پنل sticky نباشد */
@media (max-width: 700px) {
    .catalog-sidebar {
        position: static;
        top: auto;
        width: 100%;
        height: auto;
        max-height: 75vh;
        margin-bottom: 16px;
        overflow-y: auto;
    }

    .catalog-facet__options {
        max-height: none;
        overflow: visible;
    }
}