/* =====================================================
   Универсальная пагинация — Family Hub
   Токены: #d4f5d1 (bg) / #a1c2bf (border) / #2e7d32 (accent)
   ===================================================== */

.pagination-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 24px auto;
    padding: 10px 8px;
    font-family: inherit;
    font-size: 14px;
}

/* --- Базовая кнопка --- */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #a1c2bf;
    border-radius: 8px;
    background: #d4f5d1;
    color: #111;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, transform 0.1s ease,
                box-shadow 0.15s ease, border-color 0.15s ease;
}

.pagination-btn:hover:not(.disabled):not(.pagination-btn--current) {
    background: #a1c2bf;
    border-color: #7fa8a4;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.15);
}

.pagination-btn:active:not(.disabled):not(.pagination-btn--current) {
    transform: translateY(0);
    box-shadow: none;
}

/* --- Стрелки « ‹ › » — крупнее символ --- */
.pagination-btn--arrow {
    font-size: 20px;
    font-weight: 600;
    color: #2e7d32;
}

/* --- Неактивная кнопка --- */
.pagination-btn.disabled {
    background: #f7f7f7;
    border-color: #e0e0e0;
    color: #bdbdbd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Текущая страница --- */
.pagination-btn--current {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
}

/* --- Многоточие --- */
.pagination-numbers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 36px;
    color: #6b6b6b;
    font-weight: 600;
    user-select: none;
}

/* --- Счётчик N / M — только на мобильном --- */
.pagination-counter {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 32px;
    padding: 0 8px;
    font-weight: 600;
    font-size: 14px;
    color: #2e7d32;
    letter-spacing: 0.3px;
}

/* --- Select --- */
.pagination-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    margin-left: 10px;
    padding: 8px 34px 8px 14px;

    border: 1px solid #a1c2bf;
    border-radius: 8px;
    background-color: #ffffff;
    /* Стрелка через SVG в цвет сайта */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%232e7d32' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;

    color: #111;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pagination-select:hover {
    border-color: #2e7d32;
    background-color: #f0f8f0;
}

.pagination-select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* =====================================================
   Мобильный режим — компактно
   ===================================================== */

@media (max-width: 640px) {
    .pagination-wrapper {
        gap: 4px;
        padding: 8px 4px;
        margin: 18px auto;
    }

    /* Скрываем номера — слишком мелко для пальца */
    .pagination-numbers {
        display: none;
    }

    /* Показываем счётчик */
    .pagination-counter {
        display: inline-flex;
    }

    .pagination-btn {
        width: 32px;
        height: 32px;
        font-size: 13px;
        border-radius: 6px;
    }

    .pagination-btn--arrow {
        font-size: 18px;
    }

    .pagination-select {
        margin-left: 6px;
        padding: 6px 28px 6px 10px;
        font-size: 13px;
        background-position: right 8px center;
        border-radius: 6px;
    }
}

/* Очень узкий экран — прячем и селект, оставляем стрелки и счётчик */
@media (max-width: 380px) {
    .pagination-select {
        display: none;
    }
}