/* ===============================
   MAIN AREA
================================ */

.catalog-wrapper {
    display: block;
}

/* Two-column layout: sidebar + products */
.catalog-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.catalog-filters-col {
    flex: 0 0 260px;
    width: 260px;
    min-width: 0;
    margin-top: 7px;
    position: static;
}

.catalog-products-col {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

@media (max-width: 991px) {
    .catalog-layout {
        flex-direction: column;
        gap: 16px;
    }
    .catalog-filters-col {
        flex: none;
        width: 100%;
    }
}

/* Controls row above the two-column layout */
.catalog-top-controls {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.catalog-top-controls .catalog-header {
    flex: 1;
    min-width: 0;
}

.catalog-top-controls .catalog-sort-block {
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .catalog-top-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .catalog-top-controls .catalog-sort-block {
        width: 100%;
    }
}

.catalog-main {
    min-width: 0;
    overflow: visible;
}

.catalog-content-inner {
    width: 100%;
    overflow: visible;
}



/* ===============================
   PRODUCT GRID — 3 per row (sidebar layout)
================================ */

.catalog-has-sidebar #productsContainer .product-card-wrapper {
    flex: 0 0 calc(33.333% - 16px);
    max-width: calc(33.333% - 16px);
}

@media (max-width: 1199px) {
    .catalog-has-sidebar #productsContainer .product-card-wrapper {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

@media (max-width: 767px) {
    .catalog-has-sidebar #productsContainer .product-card-wrapper {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
}

@media (max-width: 480px) {
    .catalog-has-sidebar #productsContainer .product-card-wrapper {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* legacy .product-col kept for other uses */
.product-col {
    flex: 0 0 auto;
    width: 16.666%;
    min-width: 0;
    display: flex;
    justify-content: center;
}



/* ===============================
   PRODUCT CARD
================================ */

.product-card-img-wrap {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.product-card-link {
    text-decoration: none;
    color: inherit;
}

.product-card-link:hover {
    color: inherit;
}



/* ===============================
   CATALOG TOOLBAR (title + sort)
================================ */



/* ===============================
   ACTIVE FILTERS
================================ */

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.filters-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-size: .8rem;
}

.filter-tag i {
    font-size: .75rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.filter-tag i:hover {
    color: var(--text-primary);
}

.clear-all-filters {
    margin-left: auto;
    font-size: .8rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.clear-all-filters:hover {
    color: var(--accent);
}



/* ===============================
   PAGINATION
================================ */

.pagination-nav .page-link {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.pagination-nav .page-link:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-nav .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}



/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 991px) {
    .catalog-main {
        min-width: 0;
    }
}



/* ===============================
   LARGE SCREENS
================================ */

@media (min-width: 1400px) {
    .main-content > .container {
        max-width: 96%;
    }
}
