/* ============================================================
   WTB Product Grid
   Ported from DLK-Theme (.dlk- -> .wtb-).
   ============================================================ */

/* ------------------------------------------------------------
   Grid container
   ------------------------------------------------------------ */
.wtb-product-grid {
    position: relative;
}

.wtb-product-grid--loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ------------------------------------------------------------
   Grid items
   ------------------------------------------------------------ */
.wtb-product-grid__items {
    display: grid;
    grid-template-columns: repeat(4, minmax(310px, 1fr));
    gap: 32px 20px;

    margin-bottom: 32px;

    @media (max-width: 1024px) {
        grid-template-columns: repeat(2, minmax(310px, 1fr));
    }

    @media (max-width: 768px) {
        grid-template-columns: repeat(1, minmax(310px, 1fr));
    }
}

/* List mode — single column */
.wtb-product-grid--list .wtb-product-grid__items {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* ------------------------------------------------------------
   Layout toggle (grid / list view switcher)
   ------------------------------------------------------------ */
.wtb-layout-toggle {
    display: flex;
    gap: 4px;
}

.wtb-layout-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--e-global-color-primary, #024887);
    border-radius: 4px;
    color: var(--e-global-color-primary, #024887);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;

    &:hover {
        background: #e6edf3;
    }

    &.wtb-layout-toggle__btn--active {
        background: var(--e-global-color-primary, #024887);
        color: #fff;
        cursor: default;
    }
}

/* ------------------------------------------------------------
   Empty state
   ------------------------------------------------------------ */
.wtb-product-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;

    p {
        margin-bottom: 16px;
    }

    .wtb-btn {
        background-color: var(--e-global-color-accent);
        font-size: 18px;
        font-weight: 500;
        fill: var(--e-global-color-8dcaf53);
        color: var(--e-global-color-8dcaf53);
        padding: 10px 50px 10px 50px;
        border-radius: 5px;

        transition: background-color .3s ease-in-out;

        &:hover {
            background-color: var(--e-global-color-5a964de);
            color: var(--e-global-color-8dcaf53);
        }
    }

}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.wtb-product-grid__pagination-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;

    /* Numbered page buttons (box style) */
    button.wtb-page-btn {
        display: flex;
        width: 48px;
        height: 48px;
        justify-content: center;
        align-items: center;
        border-radius: 8px;
        border: 1px solid #526e80;
        background: #fff;
        cursor: pointer;
        color: #526e80;
        font-family: var(--e-global-typography-primary-font-family), sans-serif;;
        font-size: 20px;
        font-weight: 700;
        line-height: normal;
        padding: 0;
        transition: all 0.15s ease-in-out;

        &:hover,
        &:focus {
            color: #fff;
            border-radius: 8px;
            border: 1px solid #526e80;
            background: #526e80;
        }
    }


    button.wtb-page-btn--active {
        color: #fff;
        background: #526e80;
        border-color: #526e80;
        cursor: default;
    }

    /* First / last page buttons (underlined text, no box) */
    button.wtb-page-edge {
        display: flex;
        align-items: center;
        height: 48px;
        padding: 0 4px;
        background: none;
        border: none;
        cursor: pointer;
        color: #024887;
        font-family: "FS Joey", sans-serif;
        font-size: 20px;
        font-weight: 700;
        line-height: normal;
        text-decoration-line: underline;
        text-decoration-style: solid;
        text-decoration-skip-ink: none;
        text-underline-offset: auto;
        text-underline-position: from-font;

        &:hover,
        &:focus {
            background-color: transparent;
            color: #009FE3;
        }
    }

    button.wtb-page-edge--active {
        cursor: default;
    }

    /* Ellipsis separator */
    .wtb-page-ellipsis {
        display: flex;
        align-items: center;
        height: 48px;
        padding: 0 4px;
        color: #A3A3A3;
        font-family: "FS Joey", sans-serif;
        font-size: 20px;
        font-weight: 700;
        line-height: normal;
        user-select: none;
    }

    /* Prev / Next arrow buttons */
    button.wtb-page-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 48px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        color: #526e80;

        &:hover,
        &:focus {
            opacity: 0.7;
            background-color: transparent;
        }

        .wtb-page-arrow__icon {
            display: flex;
            align-items: center;
        }

        .wtb-page-arrow__icon--left {
            transform: scaleX(-1);
        }
    }
}
