/**
 * Pagination Styles
 *
 * Estilos personalizados para paginación
 * Template ref: css/style.css líneas 180-207
 *
 * @package ROI_Theme
 * @since 1.0.0
 */

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

.pagination {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    color: #495057;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.page-link:hover {
    color: var(--color-orange-primary);
    background-color: rgba(255, 133, 0, 0.1);
    border-color: var(--color-orange-primary);
    text-decoration: none;
}

.page-link:focus {
    color: var(--color-orange-primary);
    background-color: #e9ecef;
    border-color: var(--color-orange-primary);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 133, 0, 0.25);
}

/* Active page */
.page-item.active .page-link {
    color: #ffffff;
    background-color: var(--color-orange-primary);
    border-color: var(--color-orange-primary);
}

/* Disabled state */
.page-item.disabled .page-link {
    color: #adb5bd;
    background-color: #ffffff;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.5;
}

.page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

/* First and Last */
.page-item:first-child .page-link {
    border-radius: 6px;
}

.page-item:last-child .page-link {
    border-radius: 6px;
}

/* Prev and Next */
.page-item .page-link[rel="prev"],
.page-item .page-link[rel="next"] {
    font-weight: 600;
    padding: 0.5rem 1.125rem;
}

/* Ellipsis */
.page-item .page-link.dots {
    border: none;
    background: transparent;
    cursor: default;
}

.page-item .page-link.dots:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Responsive */
@media (max-width: 767.98px) {
    .pagination {
        margin-top: 2rem;
        margin-bottom: 1.5rem;
        font-size: 0.875rem;
    }

    .page-item {
        margin: 0 0.15rem;
    }

    .page-link {
        padding: 0.375rem 0.625rem;
        border-radius: 4px;
    }

    .page-item .page-link[rel="prev"],
    .page-item .page-link[rel="next"] {
        padding: 0.375rem 0.75rem;
    }

    /* Hide some page numbers on mobile, keep only current +/- 1 */
    .page-item:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .pagination {
        font-size: 0.813rem;
    }

    .page-link {
        padding: 0.3rem 0.5rem;
    }

    .page-item .page-link[rel="prev"],
    .page-item .page-link[rel="next"] {
        padding: 0.3rem 0.6rem;
    }
}

/* Print */
@media print {
    .pagination {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .page-link {
        transition: none;
    }

    .page-link:hover,
    .page-item.active .page-link:hover {
        transform: none;
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .page-link {
        color: #f8f9fa;
        background-color: #212529;
        border-color: #495057;
    }

    .page-link:hover {
        color: #ffffff;
        background-color: #343a40;
        border-color: var(--color-orange-primary);
    }

    .page-item.active .page-link {
        background: var(--color-orange-primary);
    }

    .page-item.disabled .page-link {
        color: #6c757d;
        background-color: #212529;
        border-color: #495057;
    }
}
