/* ============================================================
   AE Trust Bar Widget — Styles
   ============================================================ */

/* ── Wrapper ──────────────────────────────────────────────── */
.ae-trust-wrap {
    background-color: #3d3d3d;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* ── Swiper core ──────────────────────────────────────────── */
.ae-trust-swiper {
    width: 100%;
    height: 100%;
}

.ae-trust-swiper .swiper-wrapper {
    align-items: stretch;
}

.ae-trust-swiper .swiper-slide {
    height: auto;
    display: flex;
    align-items: stretch;
    /* KEY FIX: prevent slide from shrinking to text content width */
    flex-shrink: 0;
    box-sizing: border-box;
}

/* When slidesPerView = 'auto', Swiper sets width:auto on slides.
   We give them a sensible minimum so text doesn't wrap awkwardly. */
.ae-trust-swiper.swiper-slide-auto .swiper-slide,
.ae-trust-swiper .swiper-slide[style*="width: auto"],
.ae-trust-swiper .swiper-slide[style*="width:auto"] {
    min-width: 180px;
    max-width: 280px;
}

/* ══════════════════════════════════════════════════════════
   TRUST ITEM
   Desktop/Tablet : column  (icon above, label below)
   Mobile         : row     (icon left, label right)
   ══════════════════════════════════════════════════════════ */

/* Desktop & Tablet */
.ae-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 88px;
    padding: 18px 20px;
    width: 100%;
    text-decoration: none;
    transition: background-color 0.25s ease;
    cursor: default;
    box-sizing: border-box;
    /* Prevent text from collapsing the slide width */
    white-space: nowrap;
}

a.ae-trust-item { cursor: pointer; }

.ae-trust-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Allow label to wrap ONLY the label span, not the whole item */
.ae-trust-label {
    white-space: normal;
    word-break: break-word;
}

/* ── Mobile: horizontal row ───────────────────────────────── */
@media (max-width: 767px) {
    .ae-trust-item {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        min-height: 64px;
        padding: 12px 14px;
        text-align: left;
        white-space: normal; /* allow wrap on mobile */
    }
}

/* ── Divider ─────────────────────────────────────────────── */
.ae-trust-item--divider {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Last slide: no right border */
.ae-trust-swiper .swiper-slide:last-child .ae-trust-item--divider {
    border-right: none;
}

/* Mobile: right border between 2-per-row, no bottom border */
@media (max-width: 767px) {
    .ae-trust-item--divider {
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: none;
    }
    .ae-trust-swiper .swiper-slide:last-child .ae-trust-item--divider,
    .ae-trust-swiper .swiper-slide:nth-last-child(-n+1) .ae-trust-item--divider {
        border-right: none;
    }
}

/* ── Icon ─────────────────────────────────────────────────── */
.ae-trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.ae-trust-icon img {
    width: 52px;
    height: auto;
    display: block;
    opacity: 0.88;
    transition: opacity 0.2s ease;
    object-fit: contain;
    /* Prevent icon from stretching slide */
    flex-shrink: 0;
}

.ae-trust-item--invert .ae-trust-icon img {
    filter: brightness(0) invert(1);
}

.ae-trust-item:hover .ae-trust-icon img {
    opacity: 1;
}

/* ── Label ────────────────────────────────────────────────── */
.ae-trust-label {
    color: rgba(255, 255, 255, 0.88);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    max-width: 160px;
    display: block;
    white-space: normal;
    word-break: break-word;
}

/* Mobile: left-aligned, fills remaining row space */
@media (max-width: 767px) {
    .ae-trust-label {
        text-align: left;
        max-width: none;
        flex: 1;
        font-size: 12px;
        line-height: 1.35;
    }

    .ae-trust-icon img {
        width: 36px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .ae-trust-icon img { width: 44px; }
    .ae-trust-label    { font-size: 12px; }
    .ae-trust-item     { min-height: 80px; padding: 16px 14px; gap: 10px; }
}

/* ── Navigation arrows ────────────────────────────────────── */
.ae-trust-prev,
.ae-trust-next {
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    top: 50%;
    transform: translateY(-50%);
}

.ae-trust-prev { left: 8px; }
.ae-trust-next { right: 8px; }

.ae-trust-prev:hover,
.ae-trust-next:hover {
    background: #e8192c;
    color: #fff;
}

.ae-trust-prev::after,
.ae-trust-next::after {
    font-size: 11px;
    font-weight: 700;
}

/* ── Pagination dots ──────────────────────────────────────── */
.ae-trust-pagination {
    position: relative;
    margin-top: 10px;
    bottom: auto;
}

.ae-trust-pagination .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

.ae-trust-pagination .swiper-pagination-bullet-active {
    background: #e8192c;
}

/* ── Elementor editor preview ────────────────────────────── */
.ae-trust-editor .swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ae-trust-editor .swiper-wrapper::-webkit-scrollbar {
    display: none;
}

.ae-trust-editor .swiper-slide {
    min-width: 20%;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .ae-trust-editor .swiper-slide {
        min-width: 50%;
    }
}

/* ── Auto slidesPerView — give slides a natural width ─────── */
.ae-trust-has-auto .swiper-slide {
    width: auto !important;
    min-width: 180px;
    max-width: 300px;
}

/* In auto mode, item should not force 100% width */
.ae-trust-has-auto .ae-trust-item {
    width: auto;
    min-width: 180px;
}

/* ══════════════════════════════════════════════════════════
   STATIC FULL-WIDTH MODE
   When items count ≤ visible count — pure flexbox, no Swiper.
   Each item stretches equally to fill 100% of the bar width.
   ══════════════════════════════════════════════════════════ */

.ae-trust-static .ae-trust-static-row {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Each item grows equally to fill the full row */
.ae-trust-static .ae-trust-item {
    flex: 1 1 0;
    min-width: 0;  /* allow shrink below content size */
}

/* Remove border on the last item */
.ae-trust-item--no-border {
    border-right: none !important;
}

/* Mobile static: stack into 2-per-row grid */
@media (max-width: 767px) {
    .ae-trust-static .ae-trust-static-row {
        flex-wrap: wrap;
    }
    .ae-trust-static .ae-trust-item {
        flex: 1 1 50%;
        min-width: 50%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }
    /* 2nd column: no right border */
    .ae-trust-static .ae-trust-item:nth-child(2n) {
        border-right: none;
    }
    /* Last row: no bottom border */
    .ae-trust-static .ae-trust-item:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

/* Tablet static: 3-per-row */
@media (min-width: 768px) and (max-width: 1023px) {
    .ae-trust-static .ae-trust-static-row {
        flex-wrap: wrap;
    }
    .ae-trust-static .ae-trust-item {
        flex: 1 1 33.333%;
        min-width: 33.333%;
    }
}
