/* ===========================================================
   Espressimo — Category Products (sidebar + toolbar + grid)
   =========================================================== */

.esp-cprod {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 0 48px;
    font-family: 'Dialect PM', sans-serif;
}

/* ── Sidebar ── */
.esp-cprod__sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    align-self: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-left: 8px;
}
.esp-cprod__side-title {
    margin: 0 0 8px;
    padding-top: 24px;
    color: #522c25;
    font-size: 26px;
    font-weight: 700;
}
.esp-cprod__group {
    border-bottom: 1px solid #e6dad4;
    padding: 24px 0;
}
.esp-cprod__group--last {
    border-bottom: none;
}
.esp-cprod__group-title {
    margin: 0 0 12px;
    color: #75605a;
    font-size: 15px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 1;
}

/* filter rows */
.esp-cprod__filter {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    text-decoration: none;
    text-align: right;
}
.esp-cprod__box {
    width: 20px;
    height: 20px;
    border: 1px solid #d4c4bc;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    position: relative;
}
.esp-cprod__box--check { border-radius: 5px; }
.esp-cprod__box--radio { border-radius: 50%; }
.esp-cprod__filter:hover .esp-cprod__box { border-color: #c46500; }

.esp-cprod__filter.is-active .esp-cprod__box {
    border-color: #c46500;
    background: #c46500;
}
.esp-cprod__filter.is-active .esp-cprod__box--check::after {
    content: '';
    width: 6px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}
.esp-cprod__filter.is-active .esp-cprod__box--radio::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
}
.esp-cprod__filter-label {
    flex: 1;
    font-size: 19px;
    color: #522c25;
    transition: color 0.2s ease;
}
.esp-cprod__filter:hover .esp-cprod__filter-label,
.esp-cprod__filter.is-active .esp-cprod__filter-label { color: #8B3A00; }
.esp-cprod__filter-count {
    font-size: 15px;
    color: #75605a;
    opacity: 1;
}

/* ── Results column ── */
.esp-cprod__results {
    flex: 1;
    min-width: 0;
    padding-bottom: 64px;
}
.esp-cprod__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0 16px;
    border-bottom: 1px solid #e6dad4;
}
.esp-cprod__count { margin: 0; color: #522c25; font-size: 19px; }
.esp-cprod__count-num { font-weight: 700; }
.esp-cprod__count-suffix { opacity: 1; color: #75605a; }

/* sort */
.esp-cprod__sort { position: relative; }
.esp-cprod__sort-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e6dad4;
    border-radius: 8px;
    padding: 0 16px;
    height: 44px;
    background: #fff9f2;
    color: #522c25;
    font-size: 18px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.esp-cprod__sort-btn:hover { border-color: #c46500; }
.esp-cprod__sort-label { opacity: 1; color: #75605a; }
.esp-cprod__sort-current { font-weight: 700; }
.esp-cprod__sort.is-open .esp-cprod__sort-btn svg { transform: rotate(180deg); }
.esp-cprod__sort-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #fff9f2;
    border: 1px solid #e6dad4;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(82,44,37,0.12);
    padding: 6px;
    display: none;
    z-index: 20;
}
.esp-cprod__sort.is-open .esp-cprod__sort-menu { display: block; }
.esp-cprod__sort-opt {
    display: block;
    padding: 9px 12px;
    border-radius: 7px;
    color: #522c25;
    font-size: 17px;
    text-decoration: none;
}
.esp-cprod__sort-opt:hover { background: #f6ede3; }
.esp-cprod__sort-opt.is-active { font-weight: 700; color: #8B3A00; }

.esp-cprod__empty {
    padding: 48px 0;
    color: #75605a;
    opacity: 1;
    font-size: 20px;
    text-align: center;
}

/* ── Grid ── */
.esp-cprod__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-top: 32px;
}
.esp-cprod__card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff9f2;
    border: 1px solid #e6dad4;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.esp-cprod__card:hover {
    border-color: #c46500;
    box-shadow: 0 8px 30px rgba(82,44,37,0.08);
}
.esp-cprod__badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    color: #fff;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 9999px;
}
.esp-cprod__img-wrap {
    aspect-ratio: 1 / 1;
    background: #f6ede3;
    overflow: hidden;
}
.esp-cprod__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    padding: 32px;
    transition: transform 0.5s ease;
}
.esp-cprod__card:hover .esp-cprod__img { transform: scale(1.05); }

.esp-cprod__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border-top: 1px solid #e6dad4;
    flex: 1;
}
.esp-cprod__brand {
    color: #c46500;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.esp-cprod__card-title {
    margin: 0;
    color: #522c25;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.15;
    transition: color 0.2s ease;
}
.esp-cprod__card:hover .esp-cprod__card-title { color: #8B3A00; }
.esp-cprod__desc {
    margin: 0;
    color: #75605a;
    font-size: 16px;
    line-height: 1.35;
    opacity: 1;
}
.esp-cprod__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.esp-cprod__tag {
    font-size: 13px;
    color: #522c25;
    background: #f6ede3;
    border: 1px solid #e6dad4;
    border-radius: 9999px;
    padding: 2px 10px;
}
.esp-cprod__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.esp-cprod__stars { display: inline-flex; gap: 2px; }
.esp-cprod__rating-text { color: #75605a; font-size: 14px; opacity: 1; }

.esp-cprod__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e6dad4;
}
.esp-cprod__prices { display: flex; align-items: baseline; gap: 8px; }
.esp-cprod__price {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2em;
    color: #522c25;
    font-size: 26px;
    font-weight: 700;
}
.esp-cprod__orig {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2em;
    color: #522c25;
    font-size: 17px;
    opacity: 0.3;
    text-decoration: line-through;
}
.esp-cprod__cart {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #8B3A00;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.esp-cprod__card:hover .esp-cprod__cart { background: #a34500; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .esp-cprod { flex-direction: column; padding: 0 24px; gap: 0; }
    .esp-cprod__sidebar {
        width: 100%;
        position: static;
        max-height: none;
        padding-left: 0;
        border-bottom: 1px solid #e6dad4;
    }
    /* Compact filters: flow each group as wrapping chips instead of full-width stacked
       rows, so the sidebar takes far less vertical space when it sits on top. */
    .esp-cprod__group {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 10px;
        padding: 16px 0;
    }
    .esp-cprod__group-title {
        flex: 0 0 100%;          /* title stays on its own line */
        margin: 0 0 4px;
    }
    .esp-cprod__filter {
        width: auto;             /* chip, not a full-width row */
        padding: 6px 12px;
        gap: 8px;
        border: 1px solid #e6dad4;
        border-radius: 9999px;
        background: #fff9f2;
    }
    .esp-cprod__filter-label { flex: 0 0 auto; font-size: 16px; }
    .esp-cprod__filter.is-active { border-color: #c46500; }
    .esp-cprod__grid { grid-template-columns: repeat(2, 1fr); }

    /* Item 7 — on mobile, collapse all filters into a CLOSED accordion; tap the
       "סינון" title to open. (Desktop is unaffected — this is inside the ≤1024 query.) */
    .esp-cprod__side-title {
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0;
        padding: 14px 0;
    }
    .esp-cprod__side-title::after {
        content: '';
        width: 9px;
        height: 9px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.2s;
        opacity: 0.55;
        margin-inline-start: 10px;
    }
    .esp-cprod__sidebar.is-open .esp-cprod__side-title::after { transform: rotate(-135deg); }
    .esp-cprod__sidebar .esp-cprod__group { display: none; }
    .esp-cprod__sidebar.is-open .esp-cprod__group { display: flex; }
}
@media (max-width: 560px) {
    .esp-cprod__grid { grid-template-columns: 1fr; }
}

/* ── Pagination (in-page, JS-driven) ── */
.esp-cprod__pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}
.esp-cprod__page {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e6dad4;
    border-radius: 10px;
    background: #fff9f2;
    color: #522c25;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.esp-cprod__page:hover:not(.is-disabled):not(.is-active) {
    border-color: #c46500;
    background: #f6ede3;
}
.esp-cprod__page.is-active {
    border-color: #c46500;
    background: #c46500;
    color: #fff9f2;
    cursor: default;
}
.esp-cprod__page.is-disabled {
    opacity: 0.4;
    cursor: default;
}

/* Smaller phones: shrink page buttons so the row doesn't wrap awkwardly. */
@media (max-width: 560px) {
    .esp-cprod__pagination { gap: 6px; }
    .esp-cprod__page {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 14px;
        border-radius: 8px;
    }
}

/* ── Desktop density: row ~15% narrower, card contents ~15% smaller (0.9 x 0.95) ── */
@media (min-width: 1025px) {
    .esp-cprod__toolbar,
    .esp-cprod__grid { width: 85.5%; margin-inline: auto; }
    .esp-cprod__card { zoom: 0.855; }
}

/* "אזל מהמלאי" badge on archive cards: twice the regular badge (client 2026-10-13). */
.esp-cprod__badge.esp-cprod__badge--oos { font-size: 19.5px; line-height: 1.4; padding: 6px 18px; color: #522C25; }
@media (max-width: 560px) { .esp-cprod__badge.esp-cprod__badge--oos { font-size: 13.5px; padding: 4.5px 12px; } }

/* ── exec-ui 2026-10-19: no theme pink (#CC3366) on archive controls ── */
.esp-cprod__filter, .esp-cprod__filter:hover, .esp-cprod__filter:focus { color: #522c25; }
.esp-cprod__sort-btn, .esp-cprod__sort-btn:hover, .esp-cprod__sort-btn:focus {
    color: #522c25 !important; background-color: #fff9f2 !important; border: 1px solid #e6dad4 !important;
}
.esp-cprod__sort-btn:hover, .esp-cprod__sort-btn:focus-visible, .esp-cprod__sort.is-open .esp-cprod__sort-btn { border-color: #c46500 !important; }
.esp-cprod__page, .esp-cprod__page:focus { color: #522c25 !important; border-color: #e6dad4 !important; background-color: #fff9f2 !important; }
.esp-cprod__page:hover:not(.is-disabled):not(.is-active), .esp-cprod__page:focus-visible:not(.is-active) { border-color: #c46500 !important; background-color: #f6ede3 !important; color: #522c25 !important; }
.esp-cprod__page.is-active, .esp-cprod__page.is-active:hover, .esp-cprod__page.is-active:focus { border-color: #c46500 !important; background-color: #c46500 !important; color: #fff9f2 !important; }
@media (min-width: 1025px) {
    button.esp-cprod__filter:hover, button.esp-cprod__filter:focus { background-color: transparent !important; }
}
@media (max-width: 1024px) {
    button.esp-cprod__filter:hover, button.esp-cprod__filter:focus { background-color: #fff9f2 !important; }
}
