/*
 * Property SERP pagination.
 *
 * Search-only and loaded only by resources/themes/property/views/search/
 * index.blade.php. Cars keeps its existing .serp-pagination implementation.
 */

.hzp-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.hzp-serp-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    margin-top: 28px;
}

.hzp-serp-pagination__pages {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.hzp-serp-pagination__button {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--hzp-line, #d9dee8);
    border-radius: 10px;
    background: #fff;
    color: var(--hzp-ink, #171923);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.hzp-serp-pagination__button:hover,
.hzp-serp-pagination__button:focus-visible {
    border-color: var(--hzp-red, #0745d9);
    color: var(--hzp-red, #0745d9);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(7 69 217 / 12%);
}

.hzp-serp-pagination__button.is-current {
    border-color: var(--hzp-red, #0745d9);
    background: var(--hzp-red, #0745d9);
    color: #fff;
    box-shadow: 0 8px 20px rgb(7 69 217 / 20%);
}

.hzp-serp-pagination__button.is-disabled {
    cursor: not-allowed;
    color: var(--hzp-muted, #7d8492);
    opacity: .45;
}

.hzp-serp-pagination__button.is-disabled:hover {
    border-color: var(--hzp-line, #d9dee8);
    color: var(--hzp-muted, #7d8492);
    box-shadow: none;
}

.hzp-serp-pagination__button--arrow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

[dir="rtl"] .hzp-serp-pagination__button--arrow svg {
    transform: scaleX(-1);
}

.hzp-serp-pagination__ellipsis {
    display: inline-flex;
    min-width: 22px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--hzp-muted, #7d8492);
    font-weight: 700;
}

.hzp-serp-pagination__size {
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.hzp-serp-pagination__select {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.hzp-serp-pagination__select select {
    min-width: 166px;
    height: 42px;
    appearance: none;
    border: 1px solid var(--hzp-line, #d9dee8);
    border-radius: 10px;
    background: #fff;
    color: var(--hzp-ink, #171923);
    cursor: pointer;
    padding: 0 42px 0 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
}

[dir="rtl"] .hzp-serp-pagination__select select {
    padding: 0 14px 0 42px;
}

.hzp-serp-pagination__select select:hover,
.hzp-serp-pagination__select select:focus-visible {
    border-color: var(--hzp-red, #0745d9);
    outline: 0;
    box-shadow: 0 0 0 3px rgb(7 69 217 / 12%);
}

.hzp-serp-pagination__select svg {
    position: absolute;
    inset-inline-end: 14px;
    width: 16px;
    height: 16px;
    pointer-events: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.hzp-serp-pagination__apply {
    min-height: 42px;
    margin-inline-start: 8px;
    border: 1px solid var(--hzp-red, #0745d9);
    border-radius: 10px;
    background: var(--hzp-red, #0745d9);
    color: #fff;
    padding: 0 16px;
    font: inherit;
    font-weight: 700;
}

@media (max-width: 720px) {
    .hzp-serp-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-top: 22px;
    }

    .hzp-serp-pagination__pages {
        gap: 6px;
    }

    .hzp-serp-pagination__button {
        min-width: 44px;
        height: 44px;
        border-radius: 11px;
    }

    .hzp-serp-pagination__ellipsis {
        min-width: 16px;
        height: 44px;
    }

    .hzp-serp-pagination__size {
        align-self: center;
        margin-inline-start: 0;
    }

    .hzp-serp-pagination__select select {
        min-width: 180px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .hzp-serp-pagination__pages {
        gap: 5px;
    }

    .hzp-serp-pagination__ellipsis,
    .hzp-serp-pagination__button:not(.hzp-serp-pagination__button--arrow):not(.is-current):not(.is-edge):not(.is-near) {
        display: none;
    }
}

@media (max-width: 340px) {
    .hzp-serp-pagination__button:not(.hzp-serp-pagination__button--arrow):not(.is-current):not(.is-edge) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hzp-serp-pagination__button {
        transition: none;
    }
}
