/**
 * Icon Box Slider — styles v2 (fixed)
 * Path: wp-content/themes/YOUR-THEME/elementor-widgets/icon-box-slider.css
 */

/* ===== WRAPPER ===== */
.ibs-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}
.ibs-wrapper *,
.ibs-wrapper *::before,
.ibs-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================
   GRID MODE  (items <= threshold)
   ============================================ */
.ibs-grid {
    width: 100%;
}
.ibs-grid-inner {
    display: grid;
    grid-template-columns: repeat(var(--ibs-desktop-cols, 3), minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}
@media (max-width: 1024px) {
    .ibs-grid-inner {
        grid-template-columns: repeat(var(--ibs-tablet-cols, 2), minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .ibs-grid-inner {
        grid-template-columns: repeat(var(--ibs-mobile-cols, 1), minmax(0, 1fr));
    }
}

/* ============================================
   CARD  (used in both modes)
   ============================================ */
.ibs-card {
    display: flex;
    flex-direction: column;
    align-items: center;   /* default; overridden by alignment control */
    text-align: center;    /* default; overridden by alignment control */
    height: 100%;
    width: 100%;
    min-width: 0;          /* critical: allows grid/flex children to shrink */
}

/* Media */
.ibs-media {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    max-width: 100%;
}
.ibs-icon i {
    display: inline-flex;
    line-height: 1;
}
.ibs-icon svg {
    display: block;
}
.ibs-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Title / description */
.ibs-title {
    margin: 0 0 8px;
    line-height: 1.3;
    width: 100%;
}
.ibs-desc {
    margin: 0;
    line-height: 1.6;
    width: 100%;
}

/* Button */
.ibs-btn-wrap {
    margin-top: 16px;
    width: 100%;
}
.ibs-btn {
    display: inline-block;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
    line-height: 1;
    cursor: pointer;
}
.ibs-btn:hover {
    transform: translateY(-1px);
}

/* ============================================
   SLIDER MODE
   ============================================ */
.ibs-swiper {
    position: relative;
    width: 100%;
    padding-bottom: 40px;  /* room for pagination dots */
    overflow: hidden;
}

/* Swiper-wrapper must remain flex (Swiper sets this, but reinforce) */
.ibs-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
    box-sizing: content-box;
}

/* Each slide: Swiper sets width inline via JS — DO NOT override width */
.ibs-swiper .swiper-slide {
    height: auto;
    display: flex;
    flex-shrink: 0;        /* don't let flex collapse the slide */
}
.ibs-swiper .swiper-slide > .ibs-card {
    width: 100%;
}

/* ============================================
   CUSTOM ARROWS  (no dependency on Swiper font)
   ============================================ */
.ibs-arrow {
    position: absolute;
    top: calc(50% - 20px);  /* center vertical, offset above pagination */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #1a1a2e;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0;
}
.ibs-arrow:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ibs-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
}
.ibs-arrow-prev { left: -8px; }
.ibs-arrow-next { right: -8px; }

.ibs-arrow.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Re-anchor hover transform (because base uses translateY(-50%) implicitly via top calc) */
.ibs-arrow:hover { transform: scale(1.05); }

/* ============================================
   PAGINATION DOTS
   ============================================ */
.ibs-swiper .swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 5;
}
.ibs-swiper .swiper-pagination-bullet {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background: #cccccc;
    border-radius: 50%;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease, background .2s ease;
    border: none;
}
.ibs-swiper .swiper-pagination-bullet-active {
    background: #1a1a2e;
    opacity: 1;
    transform: scale(1.2);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .ibs-arrow-prev { left: 0; }
    .ibs-arrow-next { right: 0; }
    .ibs-arrow {
        width: 34px;
        height: 34px;
    }
    .ibs-arrow svg {
        width: 16px;
        height: 16px;
    }
}
