/* ============================================================
   VENDARA — Catalog Page CSS
   Подключается после frontend.css
   ============================================================ */

/* ── Catalog Layout ───────────────────────────────────────── */
.vd-catalog {
    padding: 0 0 56px;
}
.vd-catalog__layout {
    display: grid;
    grid-template-columns: 256px 1fr;
    gap: 24px;
    align-items: start;
}

/* ── Filter Sidebar ───────────────────────────────────────── */
.vd-filters {
    position: sticky;
    top: 80px;
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    overflow: hidden;
}
.vd-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1.5px solid var(--vd-border);
}
.vd-filters__title {
    font-family: var(--vd-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--vd-ink);
}
.vd-filters__reset {
    font-size: 12px;
    font-weight: 700;
    color: var(--vd-brand);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color var(--vd-transition);
    display: none;
}
.vd-filters__reset--visible { display: block; }
.vd-filters__reset:hover { color: var(--vd-brand-dark); }

/* Filter group */
.vd-filter-group {
    border-bottom: 1px solid var(--vd-border);
}
.vd-filter-group:last-child { border-bottom: none; }

.vd-filter-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    cursor: pointer;
    user-select: none;
    transition: background var(--vd-transition);
}
.vd-filter-group__head:hover { background: var(--vd-surface); }

.vd-filter-group__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--vd-ink);
}
.vd-filter-group__arrow {
    color: var(--vd-muted);
    transition: transform var(--vd-transition);
    flex-shrink: 0;
}
.vd-filter-group--open .vd-filter-group__arrow {
    transform: rotate(180deg);
}

.vd-filter-group__body {
    padding: 4px 18px 14px;
    display: none;
}
.vd-filter-group--open .vd-filter-group__body { display: block; }

/* Price range */
.vd-price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.vd-price-input {
    height: 36px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    padding: 0 10px;
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--vd-ink);
    outline: none;
    width: 100%;
    transition: border-color var(--vd-transition);
}
.vd-price-input:focus { border-color: var(--vd-brand); }
.vd-price-input::placeholder { font-weight: 400; color: var(--vd-placeholder); }

.vd-price-slider {
    position: relative;
    height: 4px;
    background: var(--vd-border);
    border-radius: 2px;
    margin: 8px 4px;
}
.vd-price-slider__fill {
    position: absolute;
    height: 100%;
    background: var(--vd-brand);
    border-radius: 2px;
    left: 0%;
    right: 30%;
}
.vd-price-slider input[type=range] {
    position: absolute;
    width: 100%;
    height: 4px;
    top: 0;
    background: transparent;
    outline: none;
    pointer-events: none;
    -webkit-appearance: none;
}
.vd-price-slider input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--vd-brand);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    cursor: pointer;
    pointer-events: all;
}

/* Checkbox filter items */
.vd-filter-search {
    height: 32px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    padding: 0 10px;
    font-family: var(--vd-font-body);
    font-size: 12px;
    color: var(--vd-text);
    outline: none;
    width: 100%;
    margin-bottom: 8px;
    transition: border-color var(--vd-transition);
}
.vd-filter-search:focus { border-color: var(--vd-brand); }

.vd-filter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--vd-border) transparent;
}
.vd-filter-list::-webkit-scrollbar { width: 4px; }
.vd-filter-list::-webkit-scrollbar-thumb { background: var(--vd-border); border-radius: 2px; }

.vd-filter-check {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 4px;
    cursor: pointer;
    border-radius: var(--vd-radius-sm);
    transition: background var(--vd-transition);
    user-select: none;
}
.vd-filter-check:hover { background: var(--vd-surface); }
.vd-filter-check input[type=checkbox] {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--vd-border-dark);
    border-radius: 4px;
    accent-color: var(--vd-brand);
    cursor: pointer;
    flex-shrink: 0;
}
.vd-filter-check__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--vd-text);
    flex: 1;
    line-height: 1.3;
}
.vd-filter-check__count {
    font-size: 11px;
    color: var(--vd-muted);
    font-weight: 600;
}

.vd-filter-show-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--vd-brand);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 4px 0;
    display: block;
    transition: color var(--vd-transition);
}
.vd-filter-show-more:hover { color: var(--vd-brand-dark); }

/* ── Catalog Main Area ────────────────────────────────────── */
.vd-catalog__main { min-width: 0; }

/* Page header */
.vd-catalog__header { margin-bottom: 16px; }
.vd-catalog__title {
    font-family: var(--vd-font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--vd-ink);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}
.vd-catalog__count {
    font-size: 13px;
    color: var(--vd-muted);
    font-weight: 600;
}

/* Active filter tags */
.vd-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.vd-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    background: var(--vd-brand-light);
    border: 1.5px solid var(--vd-brand-mid);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    color: var(--vd-brand);
    white-space: nowrap;
}
.vd-active-tag__remove {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--vd-brand);
    opacity: 0.7;
    transition: opacity var(--vd-transition);
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    font-size: 14px;
}
.vd-active-tag__remove:hover { opacity: 1; }

.vd-active-tags__clear {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--vd-muted);
    background: none;
    border: 1.5px solid var(--vd-border);
    border-radius: 99px;
    cursor: pointer;
    transition: all var(--vd-transition);
}
.vd-active-tags__clear:hover {
    border-color: var(--vd-red);
    color: var(--vd-red);
}

/* Toolbar: sort + view toggle */
.vd-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius);
    margin-bottom: 16px;
}
.vd-toolbar__left { display: flex; align-items: center; gap: 10px; }
.vd-toolbar__right { display: flex; align-items: center; gap: 8px; }

.vd-toolbar__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--vd-muted);
    white-space: nowrap;
}

.vd-sort-select {
    height: 36px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    padding: 0 30px 0 12px;
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 700;
    color: var(--vd-ink);
    background: var(--vd-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color var(--vd-transition);
}
.vd-sort-select:focus { border-color: var(--vd-brand); }

.vd-view-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    background: var(--vd-surface);
    color: var(--vd-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--vd-transition);
}
.vd-view-btn:hover { border-color: var(--vd-brand); color: var(--vd-brand); }
.vd-view-btn--active {
    background: var(--vd-brand);
    border-color: var(--vd-brand);
    color: #fff;
}

/* Mobile filters button */
.vd-filter-mobile-btn {
    display: none;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 700;
    color: var(--vd-ink);
    cursor: pointer;
    transition: all var(--vd-transition);
    position: relative;
}
.vd-filter-mobile-btn:hover { border-color: var(--vd-brand); color: var(--vd-brand); }
.vd-filter-mobile-btn__badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--vd-brand);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Product Grid ─────────────────────────────────────────── */
.vd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.vd-grid--4col { grid-template-columns: repeat(4, 1fr); }

/* ── Product List View ────────────────────────────────────── */
.vd-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vd-list-card {
    background: var(--vd-white);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-md);
    display: grid;
    grid-template-columns: 150px 1fr auto;
    gap: 0;
    overflow: hidden;
    transition: all var(--vd-transition-slow);
    cursor: pointer;
}
.vd-list-card:hover {
    border-color: var(--vd-brand-mid);
    box-shadow: var(--vd-shadow-md);
}

.vd-list-card__img {
    width: 150px;
    height: 150px;
    background: var(--vd-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.vd-list-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.vd-list-card__body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.vd-list-card__brand {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--vd-brand);
}
.vd-list-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--vd-ink);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vd-list-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.vd-list-card__spec {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--vd-muted);
}
.vd-list-card__avail {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
}
.vd-list-card__avail--yes { color: var(--vd-green); }
.vd-list-card__avail--no  { color: var(--vd-muted); }
.vd-list-card__avail-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.vd-list-card__actions {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    border-left: 1px solid var(--vd-border);
    min-width: 180px;
    flex-shrink: 0;
}
.vd-list-card__price {
    font-family: var(--vd-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--vd-ink);
    text-align: right;
}
.vd-list-card__old {
    font-size: 13px;
    color: var(--vd-muted);
    text-decoration: line-through;
    text-align: right;
    margin-top: 2px;
}
.vd-list-card__btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.vd-list-card__cart {
    width: 100%;
    height: 38px;
    background: var(--vd-brand);
    color: #fff;
    border: none;
    border-radius: var(--vd-radius-sm);
    font-family: var(--vd-font-body);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--vd-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.vd-list-card__cart:hover { background: var(--vd-brand-dark); }

.vd-list-card__fav {
    width: 100%;
    height: 34px;
    background: transparent;
    color: var(--vd-muted);
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    font-family: var(--vd-font-body);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--vd-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.vd-list-card__fav:hover {
    border-color: var(--vd-brand);
    color: var(--vd-brand);
    background: var(--vd-brand-light);
}

/* ── Pagination ───────────────────────────────────────────── */
.vd-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 0 8px;
    flex-wrap: wrap;
}
.vd-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1.5px solid var(--vd-border);
    border-radius: var(--vd-radius-sm);
    background: var(--vd-white);
    color: var(--vd-text);
    font-family: var(--vd-font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--vd-transition);
    text-decoration: none;
}
.vd-page-btn:hover { border-color: var(--vd-brand); color: var(--vd-brand); }
.vd-page-btn--active {
    background: var(--vd-brand);
    border-color: var(--vd-brand);
    color: #fff;
}
.vd-page-btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.vd-page-ellipsis {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--vd-muted);
    font-weight: 700;
}

/* ── Filter Modal (mobile) ────────────────────────────────── */
.vd-filter-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.55);
    z-index: 1060;
    opacity: 0;
    visibility: hidden;
    transition: all var(--vd-transition-slow);
}
.vd-filter-modal-backdrop--open {
    opacity: 1;
    visibility: visible;
}
.vd-filter-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--vd-white);
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--vd-transition-slow);
    z-index: 1061;
}
.vd-filter-modal-backdrop--open .vd-filter-modal {
    transform: translateY(0);
}
.vd-filter-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--vd-border);
    position: sticky;
    top: 0;
    background: var(--vd-white);
    z-index: 1;
}
.vd-filter-modal__title {
    font-family: var(--vd-font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--vd-ink);
}
.vd-filter-modal__foot {
    position: sticky;
    bottom: 0;
    background: var(--vd-white);
    border-top: 1px solid var(--vd-border);
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .vd-catalog__layout {
        grid-template-columns: 220px 1fr;
        gap: 18px;
    }
    .vd-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .vd-catalog__layout {
        grid-template-columns: 1fr;
    }
    .vd-filters {
        display: none;
        position: fixed;
    }
    .vd-filter-mobile-btn { display: flex; }
    .vd-grid { grid-template-columns: repeat(3, 1fr); }

    .vd-list-card {
        grid-template-columns: 110px 1fr auto;
    }
    .vd-list-card__img { width: 110px; height: 110px; }
    .vd-list-card__actions { min-width: 150px; }
}

@media (max-width: 640px) {
    .vd-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .vd-list-card {
        grid-template-columns: 1fr;
    }
    .vd-list-card__img {
        width: 100%;
        height: 160px;
    }
    .vd-list-card__actions {
        border-left: none;
        border-top: 1px solid var(--vd-border);
        flex-direction: row;
        align-items: center;
        padding: 14px 16px;
        min-width: auto;
    }
    .vd-list-card__btns {
        flex-direction: row;
        flex: 1;
        justify-content: flex-end;
    }
    .vd-list-card__cart { width: auto; padding: 0 16px; }

    .vd-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .vd-pagination { gap: 4px; }
    .vd-page-btn { min-width: 34px; height: 34px; font-size: 12px; }
}
