/* Page Header ----------------------------------------------------------- */
.page-header {
    padding-bottom: 16px;
    margin-top: 20px;
}
.page-header .breadcrumb ol {
    padding-bottom: 15px;
}
.page-header h1 {
    margin-bottom: 14px;
    font-weight: 800;
    text-align: right;
}
.page-header p {
    max-width: 860px;
    margin: 10px 0 5px auto;
    line-height: 2;
}
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 36px;
    }
    .page-header p {
        font-size: 16px;
    }
}

/* hero ------------------------------------------------------------ */
#main .hero {
    margin: 0 0 30px 0;
}
#main .hero, #main .hero img {
    height: 160px;
}
/* category-select ------------------------------------------------------------ */
.category-select {
    --chip-padding-x: 26px;
}
.category-select h3 {
    text-align: right;
    margin: 0 0 12px 0;
    line-height: 2;
    padding-right: 20px;
}
.category-select .sub {
    margin-top: 20px
}
.category-select .main-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}
.category-select .item {
    height: 150px;
    border: 2px solid #e7eaf2;
    border-radius: 16px;
    color: #24345d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: .3s;
    background-color: #fff;
}
.category-select .second-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px
}
.category-select .second-grid.expanded {
    justify-content: flex-start;
}
.category-select .chip {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding: 12px 26px;
    border: 1px solid #e7eaf2;
    border-radius: 14px;
    color: #24345d;
    transition: 0.3s;
}
.category-select .more {
    display: flex;
    align-items: center;
    gap: 8px
}
.category-select .more-chip {
    padding: 15px 26px;
    border: 1px solid #e7eaf2;
    border-radius: 14px;
    height: 50px;
    cursor: pointer;
}
.category-select .item[data-id="10"] i {
    background-position: -208px 0;
}
.category-select .item[data-id="11"] i {
    background-position: -256px 0;
}
.category-select .item[data-id="12"] i {
    background-position: -304px 0;
}
.category-select .item[data-id="13"] i {
    background-position: -352px 0;
}
.category-select .item[data-id="14"] i {
    background-position: -160px 0;
}
.category-select .item[data-id="10"].active i {
    background-position: -208px -48px;
}
.category-select .item[data-id="11"].active i {
    background-position: -256px -48px;
}
.category-select .item[data-id="12"].active i {
    background-position: -304px -48px;
}
.category-select .item[data-id="13"].active i {
    background-position: -352px -48px;
}
.category-select .item[data-id="14"].active i {
    background-position: -160px -48px;
}
.category-select .item.active {
    color: #2563eb;
    border: 2px solid #2563eb;
    border-radius: 20px;
    border-bottom: 8px solid #2563eb;
    font-weight: bold;
    background-color: #f6f9ff;
}
.category-select .chip.active {
    border: 2px solid #2563eb;
    color: #2563eb;
    font-weight: bold;
    position: relative;
    padding: 15px 50px 15px 26px;
}
.category-select .chip.active::before {
    content: "";
    width: 24px;
    height: 24px;
    display: inline-block;
    background: url('../images/slices.png') -32px 0 no-repeat;
    position: absolute;
    right: 15px;
    top: 11px;
}
.category-select .chip[hidden] {
    display: none;
}
.category-select .more-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 26px;
    border: 1px solid #e7eaf2;
    border-radius: 14px;
    color: #24345d;
    font: inherit;
    cursor: pointer;
    background-color: #fff;
}
@media (max-width: 1100px) {
    .category-select .main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 650px) {
    .category-select .main-grid {
        grid-template-columns: 1fr;
    }
    .category-select .item {
        font-size: 18px;
    }
    .category-select .chip {
        padding: 12px 18px;
        font-size: 16px;
    }
    .category-select h3 {
        font-size: 24px;
    }
    .category-select .chip.active {
        padding-inline-start: 50px;
    }
}

/* Filter --------------------------------------------------------------- */
.filter {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px;
    padding: 20px 24px;
    background-color: #fff;
}

.filter .view-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter .btn {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: #667085;
    background-color: #fff;
    box-shadow: 0 5px 18px rgba(2, 26, 72, 0.08);
    cursor: pointer;
    transition:
            background-color 0.2s,
            box-shadow 0.2s,
            transform 0.2s;
}

.filter .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(2, 26, 72, 0.12);
}

.filter .btn-grid i {
    background-position: -80px 0;
}

.filter .btn-list i {
    background-position: -56px 0;
}

.filter .btn.active {
    background-color: #2563eb;
    box-shadow: 0 7px 20px rgba(37, 99, 235, 0.24);
}

.filter .btn-grid.active i {
    background-position: -80px -24px;
}

.filter .btn-list.active i {
    background-position: -56px -24px;
}

.filter .btn:focus-visible,
.filter-submit:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 3px;
}

.filter .wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 430px));
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
}

.filter .group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

.filter .group label {
    font-weight: 700;
    color: #394867;
}

.filter .select-wrapper {
    position: relative;
    width: 100%;
}

.filter .group select {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    border: 1px solid #dfe5f0;
    border-radius: 12px;
    color: #1d2b52;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    transition:
            border-color 0.2s,
            box-shadow 0.2s;
}

.filter .select-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 16px;
    background:
            url("../images/slices.png")
            -30px -46px
            no-repeat;
    transform: translateY(-50%);
    pointer-events: none;
}

.filter .group select:focus-visible {
    border-color: #2563eb;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.filter-submit {
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    background-color: #2563eb;
    cursor: pointer;
}

.products-js .filter-submit {
    display: none;
}

.products-js .filter {
    grid-template-columns: 120px minmax(0, 1fr);
}

html:not(.products-js) .filter .view-buttons {
    display: none;
}
html:not(.products-js) .filter {
    grid-template-columns: minmax(0, 1fr) auto;
}

/* Results -------------------------------------------------------------- */
#main .category-select button:focus-visible,
#main .category-select a:focus-visible,
#main .product-card a:focus-visible,
#main .pagination a:focus-visible,
#main .products-empty__reset:focus-visible,
#main .products-ajax-error button:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.products-results {
    position: relative;
    min-height: 180px;
    scroll-margin-top: 24px;
}

.view-toolbar {
    padding: 18px 0;
    text-align: left;
}

.view-toolbar .result-count {
    font-weight: 700;
    color: #20325b;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    transition: opacity 0.2s;
}

.product-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #e7eaf2;
    border-radius: 18px;
    background-color: #fff;
    box-shadow: 0 7px 25px rgba(2, 26, 72, 0.055);
    transition:
            border-color 0.25s,
            box-shadow 0.25s,
            transform 0.25s;
}

.product-card:hover {
    border-color: #cdd9f7;
    box-shadow: 0 14px 35px rgba(2, 26, 72, 0.11);
    transform: translateY(-4px);
}

.product-card__image {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: 18px;
    background-color: #f6f9ff;
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.product-card:hover .product-card__image img {
    transform: scale(1.035);
}

.product-card__tag {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #1748cc;
    font-weight: 700;
    background-color: #eaf0ff;
}

.product-card__placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    opacity: 0.35;
    background-color: #e8eefb;
}

.product-card__content {
    min-width: 0;
    overflow-wrap: anywhere;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
}

.product-card__brand {
    margin-bottom: 8px;
    color: #2563eb;
    font-weight: 200;
}

.product-card h3 {
    width: 100%;
    min-height: 64px;
    margin: 0 0 10px;
    line-height: 1.75;
}

.product-card h3 a {
    display: -webkit-box;
    overflow: hidden;
    color: #102650;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card h3 a:hover {
    color: #2563eb;
}

.product-card__model {
    margin: 0 0 10px;
    color: #65728c;
}

.product-card__description {
    overflow: hidden;
    display: -webkit-box;
    margin: 0 0 18px;
    color: #62708b;
    line-height: 1.9;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card__action {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1748cc;
    font-weight: 800;
}
.product-card__action svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}
.product-card__action:hover svg {
    transform: translateX(-4px);
}
/* List view ------------------------------------------------------------ */
.products-grid.products-grid--list {
    grid-template-columns: 1fr;
}

.products-grid--list .product-card {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.products-grid--list .product-card__image {
    aspect-ratio: 1;
}

.products-grid--list .product-card h3 {
    min-height: 0;
}

.products-grid--list .product-card__description {
    max-width: 800px;
    -webkit-line-clamp: 3;
}

/* Loading and AJAX error ----------------------------------------------- */
.products-results.is-loading .products-grid,
.products-results.is-loading .products-empty,
.products-results.is-loading .pagination {
    opacity: 0.45;
    pointer-events: none;
}

.products-results.is-loading::after {
    content: "";
    position: absolute;
    z-index: 5;
    top: 84px;
    left: 50%;
    width: 42px;
    height: 42px;
    border: 4px solid #dce6ff;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: products-spin 0.75s linear infinite;
}

@keyframes products-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .products-results.is-loading::after {
        animation-duration: 1.5s;
    }

    .product-card,
    .product-card__image img,
    .product-card__action svg,
    .category-select .item,
    .category-select .chip,
    .filter .btn {
        transition: none;
    }
}

.products-ajax-error {
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    background-color: #fff1f2;
}

.products-ajax-error button {
    flex: 0 0 auto;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background-color: #b42318;
    cursor: pointer;
}

/* Empty state ---------------------------------------------------------- */
.products-empty {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 1px dashed #cbd7ef;
    text-align: center;
    background-color: #f8faff;
}

.products-empty__icon {
    width: 82px;
    height: 82px;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d6e2ff;
    border-radius: 24px;
    color: #2563eb;
    background-color: #eaf0ff;
}

.products-empty__icon svg,
.product-card__placeholder svg{
    width: 48px;
    height: 48px;
}

.products-empty h2 {
    margin: 0 0 10px;
    color: #102650;
}

.products-empty p {
    margin: 0 0 20px;
    color: #66758f;
}

.products-empty__reset {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 11px;
    color: #fff;
    font-weight: 700;
    background-color: #2563eb;
}

/* Pagination ----------------------------------------------------------- */
.pagination {
    margin-top: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.pagination__pages {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination__page,
.pagination__control {
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border: 1px solid #dfe5f0;
    border-radius: 11px;
    color: #344563;
    background-color: #fff;
    transition:
            color 0.2s,
            border-color 0.2s,
            background-color 0.2s;
}

.pagination__page:hover,
.pagination__control:hover {
    border-color: #2563eb;
    color: #1748cc;
    background-color: #f3f7ff;
}

.pagination__page.active {
    border-color: #2563eb;
    color: #fff;
    font-weight: 800;
    background-color: #2563eb;
}

.pagination__control.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination__ellipsis {
    min-width: 28px;
    display: inline-flex;
    justify-content: center;
    color: #758198;
}

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1200px) {
    .filter,
    .products-js .filter,
    html:not(.products-js) .filter {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .filter .view-buttons {
        justify-content: flex-end;
    }

    .filter .wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-grid--list .product-card {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 650px) {
    .filter {
        gap: 20px;
        padding: 18px;
    }

    .filter .wrap {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .filter .view-buttons {
        justify-content: flex-start;
    }

    .products-grid,
    .products-grid--list {
        grid-template-columns: 1fr;
    }

    .products-grid--list .product-card {
        display: flex;
    }

    .products-grid--list .product-card__image {
        aspect-ratio: 1;
    }

    .pagination {
        gap: 8px;
        flex-wrap: wrap;
    }

    .pagination__pages {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
        flex: 1 0 100%;
        order: 1;
    }

    .pagination__page,
    .pagination__control {
        min-width: 40px;
        height: 40px;
        padding: 0 10px;
    }

    .pagination__control {
        font-size: 0;
    }

    .pagination__control::after {
        font-size: 14px;
    }

    .pagination__control:first-child::after {
        content: "›";
    }

    .pagination__control:last-child::after {
        content: "‹";
    }

    .products-ajax-error {
        align-items: flex-start;
        flex-direction: column;
    }
}
