/* ═══════════════════════════════════════════════
   cartsearch.css — Məhsul kataloqu (cartsearch/index.php)
═══════════════════════════════════════════════ */

/* ─── BREADCRUMB override ─────────────────────────────────────── */
.breadcrumb {
    padding: 18px 40px;
}

/* ─── PAGE HEADER ─────────────────────────────────────────────── */
.page-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px 36px;
    border-bottom: 1px solid var(--warm);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.page-title {
    font-family: var(--serif);
    font-size: clamp(32px, 3vw, 44px);
    font-weight: 300;
    color: var(--espresso);
}
.page-title em {
    font-style: italic;
}
.product-count {
    font-size: 13px;
    color: var(--stone);
    letter-spacing: 0.04em;
}

/* ─── CATALOG LAYOUT ──────────────────────────────────────────── */
.catalog-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 40px 80px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 48px;
    align-items: start;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
    min-width: 0;
    overflow: hidden;
}

.filter-block {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--warm);
}
.filter-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--espresso);
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.filter-title svg {
    transition: transform 0.3s;
}
.filter-block.collapsed .filter-title svg {
    transform: rotate(-90deg);
}

.filter-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.filter-block.collapsed .filter-body {
    display: none;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--bark);
    transition: color 0.2s;
}
.filter-option:hover {
    color: var(--espresso);
}
.filter-option input[type="checkbox"] {
    display: none;
}

.filter-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid var(--sand);
    border-radius: 2px;
    flex-shrink: 0;
    transition:
        border-color 0.2s,
        background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.filter-option.checked .filter-checkbox {
    background: var(--espresso);
    border-color: var(--espresso);
}
.filter-option.checked .filter-checkbox::after {
    content: "✓";
    font-size: 10px;
    color: white;
}
.filter-option.checked {
    color: var(--espresso);
    font-weight: 500;
}

.filter-count {
    font-size: 11px;
    color: var(--stone);
    margin-left: auto;
}

.price-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}
.price-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--sand);
    border-radius: 2px;
    padding: 8px 10px;
    font-family: var(--sans);
    font-size: 12px;
    color: var(--espresso);
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
    width: 0;
}
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.price-input:focus {
    border-color: var(--stone);
}
.price-sep {
    font-size: 12px;
    color: var(--stone);
    flex-shrink: 0;
}

.sort-select {
    width: 100%;
    border: 1px solid var(--sand);
    border-radius: 2px;
    padding: 9px 32px 9px 12px;
    font-family: var(--sans);
    font-size: 12px;
    color: var(--bark);
    outline: none;
    background: var(--cream);
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.sort-select:focus {
    border-color: var(--stone);
}

.filter-scroll-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.filter-see-all {
    margin-top: 4px;
}
.btn-see-all {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--stone);
    font-family: var(--sans);
    letter-spacing: 0.04em;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.btn-see-all:hover {
    color: var(--espresso);
}

.filter-clear {
    width: 100%;
    background: none;
    border: 1px solid var(--sand);
    border-radius: 2px;
    padding: 9px;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone);
    font-family: var(--sans);
    cursor: pointer;
    transition:
        border-color 0.2s,
        color 0.2s;
    margin-top: 8px;
}
.filter-clear:hover {
    border-color: var(--espresso);
    color: var(--espresso);
}

/* ─── CATALOG TOOLBAR ─────────────────────────────────────────── */
.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--warm);
}
.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.active-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--warm);
    border-radius: 20px;
    padding: 5px 12px 5px 14px;
    font-size: 11px;
    color: var(--bark);
    letter-spacing: 0.04em;
}
.active-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--stone);
    font-size: 13px;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.active-tag button:hover {
    color: var(--espresso);
}

.view-toggle {
    display: flex;
    gap: 4px;
}
.view-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--sand);
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stone);
    transition:
        border-color 0.2s,
        color 0.2s;
}
.view-btn.active,
.view-btn:hover {
    border-color: var(--espresso);
    color: var(--espresso);
}

/* ─── PRODUCTS GRID (cartsearch version) ──────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 28px;
    row-gap: 24px;
}
.products-grid.list-view {
    grid-template-columns: 1fr;
}

.product-card {
    position: relative;
    cursor: pointer;
}

/* Invisible full-cover link over the image (keeps wishlist btn outside anchor) */
.product-img-link {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
}

.product-img-wrap {
    position: relative;
    overflow: hidden;
    background: var(--warm);
    aspect-ratio: 3/4;
    border-radius: 3px;
    margin-bottom: 20px;
}
.product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-img-wrap img {
    transform: scale(1.04);
}

.product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--espresso);
    color: var(--cream);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 1px;
    z-index: 2;
}
.product-badge.sale {
    background: #b04040;
}

.product-oos-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(100, 100, 100, 0.85);
    color: #fff;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 2px;
    z-index: 2;
}
.product-card--oos .product-img-wrap img {
    opacity: 0.7;
}
.btn-add-cart--oos {
    background: #aaa !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

.product-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.product-card:hover .product-wishlist {
    opacity: 1;
}
.product-wishlist svg {
    width: 14px;
    height: 14px;
}
.product-wishlist.active svg {
    fill: #b04040;
    stroke: #b04040;
}

.product-category {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 6px;
}
.product-name {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 400;
    color: var(--espresso);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-desc {
    font-size: 12px;
    color: var(--stone);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(12px * 1.5 * 2);
}

.product-ml {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    min-height: 28px;
}
.ml-btn {
    font-size: 11px;
    font-family: var(--sans);
    letter-spacing: 0.08em;
    border: 1px solid var(--sand);
    background: transparent;
    color: var(--stone);
    padding: 4px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}
.ml-btn.active {
    background: #fff;
    color: #000;
    border-color: #000;
}
.ml-btn:hover {
    border-color: #000;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}
.product-price {
    font-size: 14px;
    font-weight: 500;
    color: var(--bark);
    letter-spacing: 0.04em;
}
.product-price s {
    color: var(--sand);
    font-weight: 300;
    margin-right: 6px;
}

.btn-add-cart {
    background: var(--espresso);
    color: var(--cream);
    border: none;
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 9px 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.btn-add-cart:hover {
    opacity: 0.75;
}

/* ─── LIST VIEW ───────────────────────────────────────────────── */
.products-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--warm);
}
.products-grid.list-view .product-card:last-child {
    border-bottom: none;
}
.products-grid.list-view .product-img-wrap {
    aspect-ratio: 3/4;
    margin-bottom: 0;
}
.products-grid.list-view .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ─── PAGINATION ──────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--warm);
}
.page-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--sand);
    border-radius: 2px;
    background: none;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--bark);
    transition:
        border-color 0.2s,
        color 0.2s,
        background 0.2s;
}
.page-btn:hover,
.page-btn.active {
    border-color: var(--espresso);
    color: var(--espresso);
}
.page-btn.active {
    background: var(--espresso);
    color: var(--cream);
}
.page-btn.arrow {
    font-size: 16px;
    color: var(--stone);
}
.page-btn.arrow:hover {
    color: var(--espresso);
}
.page-dots {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--stone);
}

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 220px 1fr;
        gap: 32px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* ─── MOBILE FILTER BUTTON ────────────────────────────────────── */
.mob-filter-bar {
    display: none;
}

/* ─── FILTER DRAWER OVERLAY ───────────────────────────────────── */
.filter-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 300;
    opacity: 0; transition: opacity .3s;
}
.filter-overlay.active { display: block; opacity: 1; }

.filter-drawer {
    position: fixed; top: 0; left: -100%; width: min(320px, 88vw); height: 100dvh;
    background: var(--cream); z-index: 301;
    display: flex; flex-direction: column;
    transition: left .35s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.1);
}
.filter-drawer.open { left: 0; }

.filter-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; height: 60px; border-bottom: 1px solid var(--warm); flex-shrink: 0;
    font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.filter-drawer-close {
    background: none; border: none; cursor: pointer; color: var(--bark);
    display: flex; align-items: center; padding: 4px; transition: color .2s;
}
.filter-drawer-close:hover { color: var(--espresso); }
.filter-drawer-body {
    flex: 1; overflow-y: auto; padding: 20px;
}
.filter-drawer-footer {
    padding: 16px 20px; border-top: 1px solid var(--warm); flex-shrink: 0;
}
.filter-apply-btn {
    width: 100%; background: var(--espresso); color: var(--cream); border: none;
    font-family: var(--sans); font-size: 11px; letter-spacing: .14em;
    text-transform: uppercase; font-weight: 600; padding: 14px;
    border-radius: 2px; cursor: pointer; transition: opacity .2s;
}
.filter-apply-btn:hover { opacity: .85; }

@media (max-width: 1024px) {
    .mob-filter-bar {
        display: flex; align-items: center; justify-content: space-between;
        padding: 12px 16px; border-bottom: 1px solid var(--warm);
        max-width: 1400px; margin: 0 auto; width: 100%;
    }
    .mob-filter-btn {
        display: inline-flex; align-items: center; gap: 8px;
        background: none; border: 1px solid var(--sand); border-radius: 2px;
        font-family: var(--sans); font-size: 12px; letter-spacing: .08em;
        color: var(--bark); padding: 8px 16px; cursor: pointer; transition: border-color .2s, color .2s;
    }
    .mob-filter-btn:hover { border-color: var(--espresso); color: var(--espresso); }
    .catalog-layout {
        grid-template-columns: 1fr;
        padding: 16px 16px 60px;
    }
    .sidebar { display: none; }
    .page-header { padding-left: 16px; padding-right: 16px; padding-bottom: 20px; }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 14px;
        row-gap: 20px;
    }
}
@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
}
