/* ═══════════════════════════════════════
   LUMO — Catalog Page
   ═══════════════════════════════════════ */

.catalog-page {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px var(--content-padding-x, 32px) 60px;
    box-sizing: border-box;
}

/* ── Breadcrumb ── */
.catalog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--grey-500);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.catalog-breadcrumb a,
.catalog-breadcrumb-link {
    color: var(--grey-500);
    text-decoration: none;
    transition: color .15s;
}
.catalog-breadcrumb a:hover,
.catalog-breadcrumb-link:hover { color: var(--baseblack-500); }
.catalog-breadcrumb-sep { color: var(--grey-300); }
.catalog-breadcrumb-current { color: var(--baseblack-500); font-weight: 600; }

/* ── Layout ── */
.catalog-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 28px;
    align-items: start;
}

/* ── SIDEBAR ── */
.catalog-sidebar {
    position: sticky;
    top: 24px;
}

/* Mobile filter toggle */
.catalog-filter-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    padding: 11px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--baseblack-500);
    cursor: pointer;
    margin-bottom: 0;
    transition: background .15s;
}
.catalog-filter-toggle:hover { background: var(--grey-50); }

/* Sidebar panel */
.catalog-sidebar-panel {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
}

.sidebar-section {
    padding: 20px 16px;
    border-bottom: 1px solid var(--grey-100);
}
.sidebar-section:last-child { border-bottom: none; }

.sidebar-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--grey-500);
    margin: 0 0 10px;
    padding: 0 4px;
}

/* Category list */
.catalog-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.catalog-cat-list li {
    border: 1px solid rgba(0, 0, 0, 0.13);
    border-radius: 8px;
    overflow: hidden;
}
.catalog-cat-item {
    display: flex;
    align-items: flex-start;
    padding: 11px 14px;
    border-radius: 8px;
    cursor: pointer;
    gap: 0;
    transition: background .12s, color .12s;
    text-decoration: none;
    color: var(--baseblack-500);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    border-left: 3px solid transparent;
    width: 100%;
    box-sizing: border-box;
}
.catalog-cat-item:hover {
    background: var(--grey-50);
    color: #FD7200;
}
.catalog-cat-item.active {
    background: rgba(253, 114, 0, .07);
    color: #FD7200;
    font-weight: 700;
    border-left-color: #FD7200;
    padding-left: 11px;
}
.catalog-cat-list li:has(.catalog-cat-item.active) {
    border-color: rgba(253, 114, 0, 0.35);
}
.catalog-cat-left {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
}
/* Icons hidden */
.catalog-cat-icon,
.catalog-cat-icon-placeholder { display: none; }

.catalog-cat-name {
    font-size: 16px;
    word-break: break-word;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.45;
}

/* Count hidden */
.catalog-cat-count { display: none; }

/* Price filter */
.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}
.price-input-wrap { position: relative; }
.price-input-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
}
.price-input {
    width: 100%;
    padding: 9px 10px 9px 26px;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--baseblack-500);
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}
.price-input:focus { border-color: #FD7200; box-shadow: 0 0 0 2px rgba(253,114,0,.12); }
.price-input-symbol {
    position: absolute;
    left: 8px;
    bottom: 9px;
    font-size: 12px;
    color: var(--grey-400, #aaa);
    pointer-events: none;
}
.price-apply-btn {
    width: 100%;
    padding: 10px;
    background: #FD7200;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
.price-apply-btn:hover { opacity: .88; }
.price-reset-btn {
    width: 100%;
    margin-top: 6px;
    padding: 7px;
    background: none;
    border: 1px solid var(--grey-200);
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-500);
    cursor: pointer;
    transition: background .15s;
}
.price-reset-btn:hover { background: var(--grey-50); }

/* ── PAGE TITLE ROW (full width, above the grid) ── */
.catalog-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.catalog-heading {
    font-size: 24px;
    font-weight: 700;
    color: var(--baseblack-500);
    margin: 0;
    white-space: nowrap;
}
.catalog-title-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.catalog-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--grey-500);
    white-space: nowrap;
}

/* ── MAIN CONTENT ── */
.catalog-main {}

/* Sort select */
.catalog-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.catalog-sort-label {
    font-size: 13px;
    color: var(--grey-500);
    font-weight: 500;
    white-space: nowrap;
}
.catalog-sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--baseblack-500);
    background: #fff url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}
.catalog-sort-select:focus { border-color: var(--yellow-500); }

/* ── PRODUCT GRID ── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.product-card-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--grey-50);
    overflow: hidden;
}
.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.product-card:hover .product-card-image img { transform: scale(1.04); }

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-200);
}

/* Badges */
.product-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 1.4;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
/* NEW — зелёный */
.badge-new {
    background: #16a34a;
    color: #fff;
}
/* Скидка — красный */
.badge-sale {
    background: var(--red-500);
    color: #fff;
}

/* Wishlist heart button */
.product-card-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
    transition: transform .18s, background .15s;
    backdrop-filter: blur(4px);
    z-index: 2;
    padding: 0;
}
.product-card-wishlist:hover { transform: scale(1.12); background: #fff; }
.product-card-wishlist .wishlist-icon { transition: fill .15s, stroke .15s; }
.product-card-wishlist:hover .wishlist-icon { stroke: #FD7200; }
.product-card-wishlist.liked .wishlist-icon { fill: #FD7200; stroke: #FD7200; }

/* Basket button */
.product-card-basket {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    background: #FD7200;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s, transform .12s;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
}
.product-card-basket:hover { opacity: .88; transform: translateY(-1px); }
.product-card-basket.in-cart { background: #FD7200; }
.product-card-basket.in-cart:hover { background: #e56500; transform: none; }
.product-card-basket img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

/* Card info */
.product-card-info {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.product-card-category {
    font-size: 11px;
    font-weight: 600;
    color: var(--grey-400, #aaa);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.product-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--baseblack-500);
    line-height: 1.35;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.price-current {
    font-size: 17px;
    font-weight: 800;
    color: var(--baseblack-500);
    white-space: nowrap;
}
.price-old {
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-400, #aaa);
    text-decoration: line-through;
    white-space: nowrap;
}

/* ── PAGINATION ── */
.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    background: #fff;
    color: var(--baseblack-500);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.pag-btn:hover:not(:disabled) {
    border-color: #FD7200;
    color: #FD7200;
    background: rgba(253, 114, 0, .05);
}
.pag-btn.active {
    background: #FD7200;
    border-color: #FD7200;
    color: #fff;
    cursor: default;
}
.pag-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.pag-prev, .pag-next { min-width: 40px; padding: 0; }
.pag-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 40px;
    font-size: 16px;
    color: var(--grey-400, #aaa);
    user-select: none;
}

/* ── EMPTY / LOADING states ── */
.catalog-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.skeleton-card {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.skeleton-img {
    aspect-ratio: 1;
    background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-50) 50%, var(--grey-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.skeleton-info { padding: 12px 14px 16px; }
.skeleton-line {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-50) 50%, var(--grey-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    margin-bottom: 8px;
}
.skeleton-line:last-child { margin-bottom: 0; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.catalog-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--grey-500);
    grid-column: 1 / -1;
}
.catalog-empty svg { margin-bottom: 14px; opacity: .3; }
.catalog-empty-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.catalog-empty-text { font-size: 14px; }

/* ── POPULAR SECTION ── */
.popular-section {
    margin-top: 56px;
}
.popular-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}
.popular-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--baseblack-500);
    margin: 0;
}
.popular-view-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--baseblack-500);
    text-decoration: none;
    transition: color .15s;
}
.popular-view-all:hover { color: var(--grey-500); }

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1100px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .catalog-skeleton { grid-template-columns: repeat(3, 1fr); }
    .popular-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1000px) {
    .catalog-layout { grid-template-columns: 260px 1fr; gap: 20px; }
}

@media (max-width: 900px) {
    .catalog-layout { grid-template-columns: 220px 1fr; gap: 16px; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-skeleton { grid-template-columns: repeat(2, 1fr); }
    .popular-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile filter toggle button ── */
.catalog-filter-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--grey-200);
    border-radius: 10px;
    padding: 14px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--baseblack-500);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.catalog-filter-toggle:hover { border-color: #FD7200; background: rgba(253,114,0,.03); }
.catalog-filter-toggle.open { border-color: #FD7200; }

.catalog-filter-toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.catalog-filter-chevron {
    transition: transform .2s;
    color: var(--grey-500);
    flex-shrink: 0;
}
.catalog-filter-toggle.open .catalog-filter-chevron {
    transform: rotate(180deg);
    color: #FD7200;
}

/* ─────────────────────────
   TABLET (900px)
───────────────────────── */
@media (max-width: 900px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .catalog-skeleton { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ─────────────────────────
   MOBILE (700px)
───────────────────────── */
@media (max-width: 700px) {

    /* Page padding */
    .catalog-page { padding: 16px 14px 48px; }

    /* Breadcrumb */
    .catalog-breadcrumb { font-size: 12px; gap: 4px; margin-bottom: 14px; }

    /* Title row: stack vertically */
    .catalog-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 14px;
    }
    .catalog-heading { font-size: 20px; }
    .catalog-title-right {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .catalog-count { font-size: 13px; color: var(--grey-500); font-weight: 500; }
    .catalog-sort { width: 100%; }
    .catalog-sort-select { width: 100%; flex: 1; }

    /* Layout: 1 column, sidebar first */
    .catalog-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .catalog-sidebar { position: static; }

    /* Show the toggle button */
    .catalog-filter-toggle { display: flex; }

    /* Sidebar panel: hidden by default, slides open */
    .catalog-sidebar-panel {
        display: none;
        margin-top: 10px;
        border-radius: 10px;
        overflow: hidden;
        animation: fadeIn .18s ease;
    }
    .catalog-sidebar-panel.open { display: block; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

    /* Categories inside sidebar: compact */
    .catalog-cat-item { font-size: 15px; padding: 11px 12px; }
    .catalog-cat-name { font-size: 15px; }

    /* Products 2 per row */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .catalog-skeleton { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Product card compact */
    .product-card-info { padding: 10px 10px 12px; }
    .product-card-name { font-size: 12px; }
    .price-current { font-size: 14px; }
    .product-card-category { display: none; }
    .product-card-basket { font-size: 11px; height: 36px; gap: 5px; }
    .product-card-basket img { width: 26px; height: 26px; }
    .product-card-wishlist { width: 30px; height: 30px; top: 6px; right: 6px; }

    /* Pagination compact */
    .pag-btn { min-width: 36px; height: 36px; font-size: 13px; }

    /* Popular section */
    .popular-section { margin-top: 32px; }
    .popular-title { font-size: 17px; }
    .popular-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ─────────────────────────
   SMALL MOBILE (400px)
───────────────────────── */
@media (max-width: 400px) {
    .catalog-page { padding: 12px 10px 40px; }
    .products-grid { gap: 8px; }
    .popular-grid { gap: 8px; }
    .product-card-name { font-size: 11px; }
    .price-current { font-size: 13px; }
    .catalog-heading { font-size: 18px; }
}

/* ── Search banner ── */
.search-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(253, 114, 0, .07);
    border: 1px solid rgba(253, 114, 0, .25);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--baseblack-500);
    flex-wrap: wrap;
}
.search-banner svg {
    color: #FD7200;
    flex-shrink: 0;
}
.search-banner span {
    flex: 1;
}
.search-banner strong {
    font-weight: 700;
}
.search-banner-clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid rgba(253, 114, 0, .4);
    border-radius: 6px;
    background: transparent;
    color: #FD7200;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
    white-space: nowrap;
}
.search-banner-clear:hover {
    background: rgba(253, 114, 0, .1);
    border-color: #FD7200;
}

/* Search input — hide browser native clear button */
#headerSearchInput::-webkit-search-cancel-button { display: none; }
#headerSearchInput::placeholder { color: var(--grey-300); }

