/* ============================================================
   Shop (product listing) - metrotiles-style faceted layout,
   design-b theme (Barlow Condensed / DM Sans, orange #f97316).
   ============================================================ */
html {
    color-scheme: light !important;
}


.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* ---------- Filters sidebar ---------- */
.shop-filters {
    position: sticky;
    top: 96px;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 1.5rem 1.25rem;
}

.filters-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

    .filters-head h2 {
        font-family: 'Barlow Condensed', sans-serif;
        font-weight: 700;
        font-size: 1.35rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #0f172a;
        margin: 0;
    }

.filters-clear {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    text-decoration: none;
}

    .filters-clear:hover {
        color: #f97316;
    }

.filter-group {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.filter-field-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.filter-search {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    outline: none;
}

    .filter-search:focus {
        border-color: #f97316;
    }

/* collapsible group header */
.filter-group-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #1a3a5c;
}

    .filter-group-head .chev {
        transition: transform 0.25s ease;
        color: #94a3b8;
    }

.filter-group.collapsible[data-open="true"] .chev {
    transform: rotate(180deg);
}

.filter-group-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
}

.filter-group.collapsible[data-open="true"] .filter-group-body {
    max-height: 720px;
}

/* checkbox facet list (asp:CheckBoxList renders a <table>) */
.facet-list {
    width: 100%;
    border-collapse: collapse;
}

    .facet-list td {
        padding: 0.28rem 0;
    }

    .facet-list label {
        font-family: 'DM Sans', sans-serif;
        font-size: 0.85rem;
        color: #475569;
        margin-left: 0.45rem;
        cursor: pointer;
    }

    .facet-list input[type="checkbox"] {
        accent-color: #f97316;
        width: 15px;
        height: 15px;
        cursor: pointer;
    }

    .facet-list label:hover {
        color: #0f172a;
    }

/* Apply button - design-b orange (not the metrotiles olive) */
.btn-apply-filters {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.8rem 1rem;
    background: #f97316;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background 0.2s ease;
}

    .btn-apply-filters:hover {
        background: #ea6a0c;
    }

/* ---------- Main / toolbar ---------- */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.btn-show-filters {
    display: none; /* mobile only */
    padding: 0.6rem 1rem;
    background: #1a3a5c;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.shop-sort {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

    .shop-sort label {
        font-family: 'JetBrains Mono', monospace;
        font-size: 0.65rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #94a3b8;
    }

.sort-select {
    padding: 0.5rem 0.75rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    outline: none;
    margin-right: 20px;
}

    .sort-select:focus {
        border-color: #f97316;
    }

/* ---------- Product tiles ----------
   ASPxCardView renders cards inside its own container. We force a responsive
   3-column tile grid by making the cards wrap. Depending on your DevExpress
   version the card wrapper element differs; the selectors below cover the
   common ones (.dxcvControl table/cards). If your build renders a different
   class, point .cbs-cardview's grid at it (one line) - or swap ASPxCardView
   for ASPxDataView with ColumnCount="3" (see sql/shop-queries.sql notes). */

.cbs-cardview,
.cbs-cardview > div,
.cbs-cardview table.dxcvControl_Material,
.cbs-cardview table {
    width: 100% !important;
    border: none !important;
    background: transparent !important;
}



/* The tile itself (fully themed, independent of DevExpress chrome) */
.p-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.23,1,0.32,1), box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
}

    .p-tile:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 30px rgba(15,23,42,0.10);
        border-color: #cbd5e1;
    }

.p-tile-media {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 4 / 4;
    overflow: hidden;
}

    .p-tile-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.4s ease;
    }

.p-tile:hover .p-tile-media img {
    transform: scale(1.05);
}

.p-tile-tag {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: rgba(26,58,92,0.92);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
}

    .p-tile-tag:empty {
        display: none;
    }

.p-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1rem 1.1rem;
    flex: 1;
}

.p-tile-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.15;
    text-transform: uppercase;
    color: #0f172a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
}

.p-tile-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.p-tile-price {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a3a5c;
}

.p-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fff7ed;
    color: #f97316;
    transition: background 0.2s ease, color 0.2s ease;
}

.p-tile:hover .p-tile-icon {
    background: #f97316;
    color: #fff;
}

.p-empty {
    padding: 3rem 1rem;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    color: #64748b;
}

    .p-empty a {
        color: #f97316;
    }

/* pager */
.cbs-cardview .dxpLite, .cbs-cardview .dxp-num, .cbs-cardview .dxp-current {
    font-family: 'DM Sans', sans-serif !important;
}

/* ВАЖНО: НЯМА фиксирана височина тук нарочно. Пробвахме фиксирани
   стойности (378px desktop, после опити за 474/447/450/324px по
   breakpoint-ове - виж закоментираните опити по-долу) и винаги някъде
   съдържанието (квадратна снимка + име, което може да wrap-не на 1 или
   2 реда) не се събираше в точния брой пиксели, отрязвайки цената.
   Реалната височина зависи от дължината на продуктовото име, не само
   от ширината на viewport-а - затова height: auto е единственото
   стабилно решение, вместо безкраен whack-a-mole по breakpoint-ове. */
.dxcvBreakpointsCard {
    height: auto !important;
}


.shop-layout > .shop-main {
    min-width: 0 !important;
}

/* ---------- responsive ---------- */
@media (max-width: 1535px) {
    /* .dxcvBreakpointsCard {
        height: 324px;
    }*/
}

@media (max-width: 1280px) {
    .container {
        margin: 0;
    }

    /*.dxcvBreakpointsCard {
        height: 450px;
    }
*/
    .shop-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .shop-filters {
        position: fixed;
        inset: 0;
        z-index: 60;
        top: 0;
        overflow-y: auto;
        display: none;
        border: none;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
    }

        .shop-filters * {
            box-sizing: border-box;
            max-width: 100%;
        }

        .shop-filters.open {
            display: block;
        }

    .btn-show-filters {
        display: inline-block;
    }
}

@media (max-width: 1024px) {


    .container {
        margin: 0 !important;
    }
}

/*@media (max-width: 535px) {
    .dxcvBreakpointsCard {
        height: 474px;
    }
}


@media (max-width: 435px) {
    .dxcvBreakpointsCard {
        height: 447px;
    }
}*/

/*  dxbplc
@media (max-width: 1024px) and (min-width: 641px) {
    .cbs-cardview table.dxcvTable td.dxcvCard {
        display: inline-block !important;
        width: calc(33% - 10px) !important;
        vertical-align: top;
        margin-bottom: 16px;
        padding: 10px;
        background: white;
        border: none;
    }

    .cbs-cardview table.dxcvTable td.dxcvSeparator {
        display: none !important;
    }

    .dxcvCard {
        height: 400px;
    }
}
 
@media (max-width: 640px) {
    .cbs-cardview table.dxcvTable,
    .cbs-cardview table.dxcvTable tbody,
    .cbs-cardview table.dxcvTable tr,
    .cbs-cardview table.dxcvTable td.dxcvCard {
        display: block !important;
        width: 100% !important; 
    

        .cbs-cardview table.dxcvTable td.dxcvSeparator {
            display: none !important;
        }

    .cbs-cardview .p-tile {
        margin-bottom: 16px;
    }
}*/

/* ---------- price range slider ---------- */
.price-slider {
    padding: 0.35rem 0.15rem 0.25rem;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a3a5c;
    margin-bottom: 0.85rem;
}

.price-track {
    position: relative;
    height: 30px;
}

    .price-track .price-fill {
        position: absolute;
        top: 13px;
        height: 4px;
        background: #f97316;
        border-radius: 2px;
    }

    .price-track::before {
        content: "";
        position: absolute;
        top: 13px;
        left: 0;
        right: 0;
        height: 4px;
        background: #e2e8f0;
        border-radius: 2px;
    }
    /* two overlapped range inputs sharing one track */
    .price-track input[type="range"] {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        height: 30px;
        -webkit-appearance: none;
        appearance: none;
        background: none;
        pointer-events: none;
    }

        .price-track input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            pointer-events: all;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            border: 3px solid #f97316;
            cursor: pointer;
            box-shadow: 0 1px 4px rgba(15,23,42,0.2);
        }

        .price-track input[type="range"]::-moz-range-thumb {
            pointer-events: all;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            border: 3px solid #f97316;
            cursor: pointer;
            box-shadow: 0 1px 4px rgba(15,23,42,0.2);
        }

.dxp-summary {
    margin: 10px;
}
