/* ============================================================
   catalog-new.css — New catalog design for Akademik Stroy
   ============================================================ */

/* ── Catalog container ──────────────────────────────────────── */
.catalog-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 0;
    list-style: none;
    margin: 0;
    padding-left: 15px;
}

.catalog-container.list-view {
    grid-template-columns: 1fr;
}

.page-area .row .col-md-8 .term-description {
    display: none;
}

/* ── Product card ───────────────────────────────────────────── */
.product-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
    list-style: none;
}

.product-card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
}

.catalog-container.list-view .product-card {
    flex-direction: row;
    align-items: stretch;
}

/* ── Product gallery ────────────────────────────────────────── */
.product-gallery {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
    width: 100%;
    height: 430px;
}

.product-gallery__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.catalog-container.list-view .product-gallery {
    flex: 0 0 75%;
    width: 75%;
    height: auto;
    min-height: 360px;
    align-self: stretch;
    position: relative;
    aspect-ratio: 16 / 10;
}

.catalog-container.list-view .product-gallery .product-gallery__link,
.catalog-container.list-view .product-gallery .product-card-splide,
.catalog-container.list-view .product-gallery .product-gallery__single-img {
    height: 100%;
}

/* ── Splide slider ──────────────────────────────────────────── */

/* Reset WooCommerce's ul.products width/float that bleeds into Splide internals */
.product-card-splide .splide__list,
.product-card-splide .splide__pagination {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.product-card-splide {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.product-card-splide .splide__track {
    height: 100%;
    overflow: hidden !important;
}

.product-card-splide .splide__list,
.product-card-splide .splide__slide {
    height: 100%;
}

.product-card-splide .splide__slide img,
.product-gallery__single-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card-splide .splide__pagination {
    bottom: 8px;
}

.product-card-splide .splide__pagination__page {
    background: rgba(255, 255, 255, 0.7);
    width: 6px;
    height: 6px;
    margin: 0 3px;
}

.product-card-splide .splide__pagination__page.is-active {
    background: #ffffff;
    transform: scale(1.2);
}

.product-card-splide .splide__pagination {
    gap: 10px;
}

.product-card-splide .splide__pagination__page {
    width: 70px;
    height: 4px;
    margin: 0;
    background: #A1A1A1;
    border-radius: 10px;
    box-shadow: 0px 2px 2px 0px #0000008C;
}

.product-card-splide .splide__pagination__page.is-active {
    transform: none;
    background: #fff;
}

/* ── Price badge ────────────────────────────────────────────── */
.product-gallery__price-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #545454;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    padding: 8px 18px;
    white-space: nowrap;
    z-index: 3;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 10px;
    background-color: #FFFFFFB2;
}

/* ══════════════════════════════════════════════════════════════
   GRID VIEW — product-info is a compact 74px bottom bar
   ══════════════════════════════════════════════════════════════ */

.product-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 74px;
    padding: 0 16px;
    border-top: 1px solid #ebebeb;
    gap: 0;
    flex-shrink: 0;
}

/* Hide price, title, material in grid view */
.product-info__price,
.product-info__title-link,
.product-info-material {
    display: none;
}

/* Characteristics: horizontal flex, fill available space */
.product-info-characteristics {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    gap: 30px;
    margin: 0;
    padding: 0;
}

/* Show only first 3 items (area, rooms, bathrooms) in grid */
.product-info-characteristics__item:nth-child(n+4) {
    display: none;
}

/* Each item: column, centered */
.product-info-characteristics__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

/* In grid view: hide the large list-view icon */
.char-icon-list {
    display: none;
}

/* char-body: column layout */
.char-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Value row: icon + number inline */
.char-value-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    line-height: 1.1;
}

/* Grid inline icon */
.char-icon-grid {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    opacity: 0.75;
}

/* Value: 22px bold */
.char-value {
    font-size: 22px;
    color: #868686;
    line-height: 1.1;
    white-space: nowrap;
}

/* Label: 18px, centered below */
.char-label {
    font-size: 18px;
    color: #888;
    line-height: 1.1;
    margin-top: 2px;
    display: block;
    text-align: center;
    white-space: nowrap;
}

/* Actions: inline at end of bar */
.product-info-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    border-top: none;
    padding-top: 0;
    flex-grow: 1;
    justify-content: right;
}

.product-info-actions__item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #888;
    font-size: 18px;
}

.product-info-actions__views img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.6;
}

.product-info-actions__btn {
    /* display: inline-flex; */
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.product-info-actions__btn:hover {
    opacity: 0.6;
}

.product-info-actions__btn img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* ══════════════════════════════════════════════════════════════
   LIST VIEW overrides
   ══════════════════════════════════════════════════════════════ */

.catalog-container.list-view .product-info {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 20px;
    border-top: none;
    gap: 0;
    flex: 1;
    min-width: 0;
}

/* Show price and title in list view */
.catalog-container.list-view .product-info__price,
.catalog-container.list-view .product-info__title-link {
    display: block;
}

/* Price block */
.product-info__price {
    margin-bottom: 6px;
}

.product-info__price span {
    display: block;
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.product-info__price p {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

/* Title link */
.product-info__title-link {
    text-decoration: none;
    margin-bottom: 12px;
}

.product-info__title-link:hover .product-info__house-type {
    color: #e53935;
}

.product-info__house-type {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

/* Characteristics in list: 2-column grid, all 6 items, row layout per item */
.catalog-container.list-view .product-info-characteristics {
    flex-direction: unset;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 12px;
    margin-bottom: 16px;
    width: 100%;
}

.catalog-container.list-view .product-info-characteristics__item:nth-child(n+4) {
    display: flex;
}

.catalog-container.list-view .product-info-characteristics__item {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
}

/* List view: show large left icon */
.catalog-container.list-view .char-icon-list {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.75;
}

/* List view: hide inline grid icon */
.catalog-container.list-view .char-icon-grid {
    display: none !important;
}

/* List: char-body column */
.catalog-container.list-view .char-body {
    align-items: flex-start;
}

.catalog-container.list-view .char-value-row {
    gap: 0;
}

.catalog-container.list-view .char-label {
    text-align: left;
}

/* Material block — hidden in both views for now */
.product-info-material {
    display: none !important;
}

/* Actions in list: bottom row with border */
.catalog-container.list-view .product-info-actions {
    margin-left: 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    width: 100%;
    gap: 12px;
}

/* ── View switcher ──────────────────────────────────────────── */
.catalog-view-switcher {
    align-items: center;
    background-color: #EAEAEA;
    border-radius: 7px;
    padding: 6px;
    display: flex;
    gap: 6px;
}

.catalog-view-switcher__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1;
}

.catalog-view-switcher__btn img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.catalog-view-switcher__btn:hover,
.catalog-view-switcher__btn.active {
    background: #fff;
}

.catalog-view-switcher__btn.active img {
    opacity: 1;
}

/* ── Sort area ──────────────────────────────────────────────── */
.catalog-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-sort img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.6;
}

.catalog-sort__select {
    border: 0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 18px;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
    min-width: 160px;
    transition: border-color 0.15s;
}

.catalog-sort__select:focus {
    border-color: #e53935;
}

.catalog-mobile-filters {
    text-decoration: none;
    color: #333;
}

.catalog-sort-type {
    font-size: 14px;
    font-weight: 600;
}

/* ── Show more button ───────────────────────────────────────── */
.catalog-show-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    transition: background 0.2s, color 0.2s;
    font-size: 20px;
    line-height: 19px;
    text-decoration-line: underline;
    color: #000000;
}

.catalog-show-more:hover {
    background: #e53935;
    color: #ffffff;
}

.catalog-show-more:hover img {
    filter: brightness(0) invert(1);
}

.catalog-show-more img {
    width: 25px;
    height: 25px;
    object-fit: contain;
    transition: filter 0.2s;
}

.catalog-show-more.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ── Pagination ─────────────────────────────────────────────── */

.catalog-pagination {
    list-style-type: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding-left: 0;
    width: 100%;
    gap: 10px;
}

.catalog-pagination__item a {
    border: 1px solid #000;
    border-radius: 5px;
    font-size: 18px;
    line-height: 1;
    color: #000;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all .3s ease-in-out;
}

.catalog-pagination__item:not(.disabled):hover a {
    border-color: #A32829;
    background-color: #A32829;
    color: #fff;
}

.catalog-pagination__item.current a {
    border-color: #A32829;
    color: #A32829;
    cursor: default;
}

.catalog-pagination__item.disabled a {
    cursor: default;
    opacity: .4;
}

.catalog-pagination__item.catalog-pagination__dots {
    align-self: center;
}

/* ── Premmerce sidebar ──────────────────────────────────────── */
#sidebar .filter--style-premmerce .filter__item {
    padding: 14px 0;
}

#sidebar .filter--style-premmerce .filter__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    margin-bottom: 10px;
}

#sidebar .filter--style-premmerce .filter__inner label {
    font-size: 16px;
    color: #515151;
    cursor: pointer;
}

#sidebar .filter--style-premmerce .filter__inner input[type="checkbox"] {
    accent-color: #e53935;
    margin-right: 6px;
}

#sidebar {
    padding-top: 8px;
}

.filter__item.filter__item--type-select .form-control.input-sm {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    color: #515151;
    background-color: transparent;
    padding: 12px 10px;
    border: 1px solid #B3B3B3;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    width: 100%;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .catalog-container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-right: 15px;
    }

    .product-gallery {
        height: 260px;
    }

    .catalog-container.list-view .product-gallery {
        width: 100%;
        height: 220px;
    }

    .catalog-container.list-view .product-card {
        flex-direction: column;
    }

    .product-gallery__price-badge {
        font-size: 20px;
        padding: 6px 12px;
    }

    .char-value {
        font-size: 16px;
    }

    .char-label {
        font-size: 13px;
    }

    .product-gallery__price-badge,
    .product-info-actions__item,
    .product-info-characteristics__item p,
    .sidebar button {
        font-size: 14px !important;
    }

    .product-card .product-info {
        font-size: 14px;
        gap: 15px;
    }

    .product-info-actions {
        gap: 10px;
    }

    .product-gallery__price-badge {
        top: 10px;
        right: 10px;
    }

    .product-info-actions__item img {
        width: 24px;
        height: 24px;
    }

    .project-search__form {
        width: 100%;
    }

    .project-search__form .project-search__input {
        width: 100%;
        margin-left: 0;
    }

    .product-card-splide .splide__pagination__page {
        width: 40px;
        height: 2px;
    }

    .filter--style-premmerce {
        padding: 0 20px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .product-gallery {
        height: 340px;
    }

    .catalog-container.list-view .product-gallery {
        flex: 0 0 45%;
        width: 45%;
    }

    .product-gallery__price-badge {
        font-size: 22px;
    }

    .char-value {
        font-size: 18px;
    }

    .char-label {
        font-size: 15px;
    }
}