/* =========================================
   MODULE: PRODUCT PAGINATION
   Transforms the default Query Pagination 
   block into the custom Vortex UI natively.
   ========================================= */

/* 1. MAIN CONTAINER
 * Target the block globally so it works out of the box.
 * Added nowrap and max-content to override WordPress native wrapping.
 */
.wp-block-query-pagination {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    /* PREVENTS ARROWS FROM STACKING */
    align-items: center;
    justify-content: center;
    gap: 8px !important;
    margin: 40px auto;
    width: max-content !important;
    /* Forces container to fit the inline items */
    max-width: 100%;
}

/* 2. NUMBERS WRAPPER
 * The native block groups page numbers inside this inner div.
 */
.wp-block-query-pagination-numbers {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    /* PREVENTS NUMBERS FROM STACKING */
    align-items: center;
    gap: 8px !important;
}

/* 3. UNIVERSAL ITEM STYLING
 * Shape (40x40 rounded squares) for all interactable elements.
 */
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 12px;

    background-color: transparent;
    color: var(--wp--preset--color--custom-blanco-suave);

    font-size: 1rem;
    font-weight: 700;
    text-decoration: none !important;
    box-sizing: border-box;

    transition: background-color 0.2s ease, color 0.2s ease;
}

/* 4. ACTIVE STATE (Current Page)
 * Bright green background with black text.
 */
.wp-block-query-pagination .page-numbers.current {
    background-color: var(--wp--preset--color--accent-5) !important;
    color: var(--wp--preset--color--base) !important;
    pointer-events: none;
    border-radius: 12px;
}

/* 5. HOVER STATE
 * Applied to non-current items.
 */
.wp-block-query-pagination .page-numbers:not(.current):not(.dots):hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    background-color: var(--wp--preset--color--custom-gris-contraste) !important;
    color: var(--wp--preset--color--custom-blanco-suave);
}

/* 6. ELLIPSIS (Dots)
 * Resets sizing so the '...' doesn't stretch.
 */
.wp-block-query-pagination .page-numbers.dots {
    min-width: auto;
    padding: 0 4px;
    pointer-events: none;
    background: transparent !important;
    color: var(--wp--preset--color--custom-blanco-suave);
}

/* 7. TEXT-TO-ARROW REPLACEMENT
 * Collapses the raw text ("Next Page") and creates pure CSS chevrons.
 */
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    font-size: 0 !important;
    /* Hides native text visually */
    position: relative;
    padding: 0 !important;
    width: 40px;
}

/* Base CSS Chevron */
.wp-block-query-pagination-previous::after,
.wp-block-query-pagination-next::after {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--wp--preset--color--custom-blanco-suave);
    position: absolute;
    top: 50%;
    left: 50%;
    transition: inherit;
}

/* Previous Arrow (<) */
.wp-block-query-pagination-previous::after {
    border-left: 2px solid var(--wp--preset--color--custom-blanco-suave);
    /* -30% optically centers the open arrow inside the box */
    transform: translate(-30%, -50%) rotate(-45deg);
}

/* Next Arrow (>) */
.wp-block-query-pagination-next::after {
    border-right: 2px solid var(--wp--preset--color--custom-blanco-suave);
    /* -70% optically centers the open arrow inside the box */
    transform: translate(-70%, -50%) rotate(45deg);
}