/* ============================================================
 * Binnet Coverflow Carousel — v2.1.0
 * תיקון חיתוכים: גובה דינמי + buffer ב-needed + responsive defaults
 * ============================================================ */

.bcc-outer {
    --bcc-card-width: 28.59rem;
    --bcc-card-min-height: 19.625rem;
    --bcc-card-min-height-mobile: 22rem;
    --bcc-side-translate: 83%;
    --bcc-side-scale: 0.803;
    --bcc-side-opacity: 1;
    --bcc-blur: 16px;
    --bcc-arrows-gap: 8px;
    --bcc-grad-start: #2D487F;
    --bcc-grad-end: #B4C4E3;
    --bcc-grad-angle: 180deg;
    --bcc-transition-speed: 0.65s;

    direction: rtl;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 0 30px;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: var(--bcc-arrows-gap);
    overflow: hidden;
}

.bcc-outer *,
.bcc-outer *::before,
.bcc-outer *::after {
    box-sizing: border-box;
}

/* ===== ARROWS ===== */
.bcc-arrow {
    flex-shrink: 0;
    background: none !important;
    background-color: transparent !important;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px;
    -webkit-tap-highlight-color: transparent;
}

.bcc-arrow:hover,
.bcc-arrow:focus,
.bcc-arrow:active {
    background: none !important;
    background-color: transparent !important;
}

.bcc-arrow svg {
    width: 22px;
    height: 22px;
    stroke: #091B44;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

/* ===== VIEWPORT ===== */
.bcc-viewport {
    flex: 1;
    overflow: visible;
    position: relative;
    min-width: 0;
}

.bcc-track {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* גובה דינמי - יוגדר ע"י JS לפי הslide הכי גבוה.
       min-height מבטיח שעד שה-JS יתחיל, יש גובה. */
    min-height: var(--bcc-card-min-height);
}

/* ===== SLIDES (DESKTOP) ===== */
.bcc-slide {
    position: absolute;
    /* fluid: --bcc-card-actual-width מוגדר ע"י JS לפי viewport.
       fallback ל--bcc-card-width אם המסך רחב מספיק */
    width: var(--bcc-card-actual-width, var(--bcc-card-width));
    /* גובה דינמי - JS יקבע. min-height fallback. */
    min-height: var(--bcc-card-min-height);
    transition:
        transform  var(--bcc-transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.4s  cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s    linear var(--bcc-transition-speed),
        width      var(--bcc-transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.bcc-slide[data-pos="0"] {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 4;
    visibility: visible;
    transition:
        transform  var(--bcc-transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.4s  cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s    linear 0s;
}

.bcc-slide[data-pos="1"] {
    transform: translateX(calc(-1 * var(--bcc-side-translate))) scale(var(--bcc-side-scale));
    opacity: var(--bcc-side-opacity);
    z-index: 2;
    visibility: visible;
    transition:
        transform  var(--bcc-transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.4s  cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s    linear 0s;
}

.bcc-slide[data-pos="-1"] {
    transform: translateX(var(--bcc-side-translate)) scale(var(--bcc-side-scale));
    opacity: var(--bcc-side-opacity);
    z-index: 2;
    visibility: visible;
    transition:
        transform  var(--bcc-transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
        opacity    0.4s  cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s    linear 0s;
}

.bcc-slide[data-pos="2"],
.bcc-slide[data-pos="3"],
.bcc-slide[data-pos="4"] {
    transform: translateX(-140%) scale(0.75);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    visibility: hidden;
}

.bcc-slide[data-pos="-2"],
.bcc-slide[data-pos="-3"],
.bcc-slide[data-pos="-4"] {
    transform: translateX(140%) scale(0.75);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ===== CARD ===== */
.bcc-card {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background: rgba(230, 240, 255, 0.79);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    padding: 2.5rem;
    gap: 1rem;
}

.bcc-slide[data-pos="0"] .bcc-card {
    -webkit-backdrop-filter: blur(var(--bcc-blur));
    backdrop-filter: blur(var(--bcc-blur));
}

.bcc-card[data-border="gradient"]::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(var(--bcc-grad-angle), var(--bcc-grad-start), var(--bcc-grad-end));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

/* ===== TYPOGRAPHY ===== */
.bcc-icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    color: #FF000F;
    line-height: 1;
}

.bcc-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: currentColor;
}

.bcc-icon i {
    font-size: 1.5rem;
    color: inherit;
}

.bcc-label {
    font-size: 0.7375rem;
    font-weight: 400;
    letter-spacing: 0.37em;
    line-height: 100%;
    color: #FF000F;
    text-transform: uppercase;
    direction: ltr;
    flex-shrink: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.bcc-title {
    margin: 0;
    font-size: 1.2188rem;
    font-weight: 700;
    line-height: 1.625rem;
    letter-spacing: -0.0188rem;
    color: #091B44;
    flex-shrink: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.bcc-desc {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.375rem;
    letter-spacing: 0;
    color: #091B44;
    text-align: center;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.bcc-link {
    font-size: 1rem;
    font-weight: 400;
    line-height: 100%;
    color: #091B44;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.bcc-link:hover {
    gap: 0.7rem;
}

.bcc-link::after {
    content: '›';
    font-size: 1.2em;
    line-height: 1;
}

/* ============================================================
 * MOBILE — שקופית אחת מלאה
 * ============================================================ */
@media (max-width: 768px) {
    .bcc-outer {
        padding: 24px 6px 16px;
        gap: 2px;
    }

    .bcc-viewport {
        overflow: hidden;
    }

    .bcc-track {
        transform: none !important;
        min-height: var(--bcc-card-min-height-mobile) !important;
        width: 100%;
    }

    .bcc-slide {
        width: 100%;
        min-height: var(--bcc-card-min-height-mobile);
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: none !important;
        will-change: transform, opacity;
    }

    .bcc-slide[data-pos="0"] {
        transform: translateX(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 4;
        pointer-events: auto !important;
        transition:
            transform 0.45s cubic-bezier(0.33, 1, 0.68, 1),
            opacity   0.35s cubic-bezier(0.33, 1, 0.68, 1) !important;
    }

    .bcc-slide[data-pos="0"] .bcc-card {
        padding: 1.75rem 1.5rem;
        gap: 0.7rem;
    }

    .bcc-slide[data-pos="1"] {
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        visibility: visible !important;
        z-index: 2;
        pointer-events: none !important;
        transition:
            transform 0.45s cubic-bezier(0.33, 1, 0.68, 1),
            opacity   0.35s cubic-bezier(0.33, 1, 0.68, 1) !important;
    }

    .bcc-slide[data-pos="-1"] {
        transform: translateX(100%) !important;
        opacity: 0 !important;
        visibility: visible !important;
        z-index: 2;
        pointer-events: none !important;
        transition:
            transform 0.45s cubic-bezier(0.33, 1, 0.68, 1),
            opacity   0.35s cubic-bezier(0.33, 1, 0.68, 1) !important;
    }

    .bcc-slide[data-pos="2"],
    .bcc-slide[data-pos="3"],
    .bcc-slide[data-pos="4"] {
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: none !important;
    }

    .bcc-slide[data-pos="-2"],
    .bcc-slide[data-pos="-3"],
    .bcc-slide[data-pos="-4"] {
        transform: translateX(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: none !important;
    }

    .bcc-arrow { padding: 4px; }
    .bcc-arrow svg { width: 18px; height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .bcc-slide {
        transition: opacity 0.3s ease !important;
    }
}
