/* =============================================================================
   OLIVA — Widget Grilla de Productos v1.0
   ============================================================================= */

/* ── Swiper container: en desktop actúa como grid ───────────────────────────── */
.oliva-widget-wrap .oliva-widget-swiper {
    overflow: visible;
}

@media (min-width: 1025px) {
    .oliva-widget-wrap .oliva-widget-swiper {
        overflow: visible !important;
    }
    .oliva-widget-wrap .oliva-widget-swiper .swiper-wrapper {
        display: grid !important;
        transform: none !important;
        grid-template-columns: repeat(var(--oliva-cols, 4), 1fr) !important;
        padding: 1px 0 0 1px !important;
        flex-wrap: unset !important;
    }
    .oliva-widget-wrap .oliva-widget-swiper .swiper-slide {
        width: auto !important;
        flex-shrink: unset !important;
        transform: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .oliva-widget-wrap .oliva-widget-swiper {
        overflow: visible !important;
    }
    .oliva-widget-wrap .oliva-widget-swiper .swiper-wrapper {
        display: grid !important;
        transform: none !important;
        grid-template-columns: repeat(var(--oliva-cols-tablet, 3), 1fr) !important;
        padding: 1px 0 0 1px !important;
        flex-wrap: unset !important;
    }
    .oliva-widget-wrap .oliva-widget-swiper .swiper-slide {
        width: auto !important;
        flex-shrink: unset !important;
        transform: none !important;
    }
}

/* ── Tarjeta: altura fija idéntica al archive y related products ─────────────── */
.oliva-widget-wrap .oliva-producto-card {
    height: 520px !important;
}

/* ── Márgenes negativos solo en grid (desktop/tablet) ───────────────────────── */
@media (min-width: 768px) {
    .oliva-widget-wrap .oliva-producto-card {
        margin: -1px 0 0 -1px !important;
    }
}

/* ── Slider móvil (<768px) ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .oliva-widget-wrap .oliva-widget-swiper {
        overflow: hidden !important;
    }
    .oliva-widget-wrap .oliva-widget-swiper .swiper-wrapper {
        padding: 0 !important;
    }
    .oliva-widget-wrap .oliva-producto-card {
        width: 80vw !important;
        max-width: 320px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        border: 1px solid #AFAFAF !important;
    }
}

/* ── Loading state ───────────────────────────────────────────────────────────── */
.oliva-widget-wrap .oliva-widget-grid.oliva-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ── Paginación numerada ─────────────────────────────────────────────────────── */
.oliva-widget-pages {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 32px 0;
}

.oliva-page-btn {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #AFAFAF;
    background: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    padding: 0 10px;
    transition: background 0.2s ease, color 0.2s ease;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}

.oliva-page-btn.is-active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.oliva-page-btn:hover:not(.is-active) {
    background: #f5f5f5;
}

.oliva-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ── Load More dentro del widget ─────────────────────────────────────────────── */
.oliva-widget-wrap .oliva-load-more-wrap {
    grid-column: 1 / -1;
}
