/* Elementor Tab Carousel v1.4.0 */

.etc-tab-carousel {
    --etc-slides: 1;
    --etc-gap: 20px;
    --etc-slide-width: calc((100% - (var(--etc-gap) * (var(--etc-slides) - 1))) / var(--etc-slides));
    --etc-tabs-gap: 0px;
    --etc-tabs-align: center;
    --etc-tabs-justify: center;
    --etc-bar-grow: 0;
    --etc-bar-bg: transparent;
    --etc-nav-size: 48px;
    --etc-nav-offset: 0px;
    --etc-transition: 500ms;
    --etc-bleed: 0px;
    --etc-slide-fx: 400ms;
    width: 100%;
    position: relative;
}

/* ---------------------------------------------------------------
 * Tab titles
 * ------------------------------------------------------------- */

.etc-tab-carousel-nav-wrap {
    display: flex;
    justify-content: var(--etc-tabs-align, center);
    width: 100%;
    margin-bottom: 28px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}
.etc-tab-carousel-nav-wrap::-webkit-scrollbar { display: none; }

/*
 * `safe` stops the start of the bar being clipped (and made unreachable)
 * when it is centered but wider than the widget.
 */
@supports (justify-content: safe center) {
    .etc-tab-carousel-nav-wrap {
        justify-content: safe var(--etc-tabs-align, center);
    }
}

/*
 * flex-grow 0 = segmented control that hugs its titles.
 * flex-grow 1 = bar stretches the full widget width.
 */
.etc-tab-carousel-nav {
    display: flex;
    align-items: stretch;
    justify-content: var(--etc-tabs-justify, center);
    flex: var(--etc-bar-grow, 0) 0 auto;
    gap: var(--etc-tabs-gap);
    background-color: var(--etc-bar-bg, transparent);
    border-radius: 999px;
    padding: 6px;
}

.etc-tab-carousel-tab {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    margin: 0;
    padding: 18px 34px;
    background: transparent;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
    font: inherit;
    line-height: 1.2;
    white-space: nowrap;
    transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.etc-tab-carousel-tab.is-active {
    position: relative;
    z-index: 1;
}

.etc-tab-carousel-tab:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ---------------------------------------------------------------
 * Stage / viewport / track
 * ------------------------------------------------------------- */

/*
 * Neighbour bleed. The clipping box of `overflow` is the padding box, so
 * horizontal padding widens the visible area while negative margins of the
 * same size keep the content box - and therefore the slide sizing - aligned
 * with the widget. calc(50vw - 50%) resolves to exactly the distance from the
 * widget edge to the browser edge, giving a full-bleed strip.
 *
 * content-box is required: with Elementor's global border-box the padding
 * would eat the declared width and collapse the content box to nothing.
 */
.etc-tab-carousel.etc-bleed-viewport { --etc-bleed: calc(50vw - 50%); }
.etc-tab-carousel.etc-bleed-hidden { --etc-bleed: 0px; }

.etc-tab-carousel-stage {
    position: relative;
    width: 100%;
}

.etc-tab-carousel-viewport {
    box-sizing: content-box;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    margin-left: calc(-1 * var(--etc-bleed));
    margin-right: calc(-1 * var(--etc-bleed));
    padding-left: var(--etc-bleed);
    padding-right: var(--etc-bleed);
}

/*
 * A bleeding carousel is wider than the page. Clip on the root rather than
 * letting it create a horizontal scrollbar. `clip` is used in preference to
 * `hidden` because `hidden` on the root turns it into a scroll container and
 * breaks position: sticky elsewhere on the page.
 */
html.etc-has-bleed,
html.etc-has-bleed body {
    overflow-x: clip;
}

@supports not (overflow-x: clip) {
    html.etc-has-bleed,
    html.etc-has-bleed body {
        overflow-x: hidden;
    }
}

/* Grab cursor only when dragging is actually enabled. */
.etc-tab-carousel.is-draggable .etc-tab-carousel-viewport {
    cursor: grab;
}

.etc-tab-carousel.is-dragging .etc-tab-carousel-viewport {
    cursor: grabbing;
}

/*
 * While a drag is in progress nothing inside may be selected, and every
 * element shows the grabbing cursor rather than its own text/pointer one.
 */
.etc-tab-carousel.is-dragging,
.etc-tab-carousel.is-dragging .etc-tab-carousel-viewport * {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.etc-tab-carousel.is-dragging .etc-tab-carousel-viewport * {
    cursor: grabbing !important;
}

/* Neighbouring slides advertise that clicking them brings them to center. */
.etc-tab-carousel.is-click-to-center .etc-tab-carousel-slide:not(.is-active) {
    cursor: pointer;
}

.etc-tab-carousel-track {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: var(--etc-gap);
    width: 100%;
    max-width: none;
    transition-property: transform;
    transition-duration: var(--etc-transition);
    transition-timing-function: cubic-bezier(.25, .8, .25, 1);
    will-change: transform;
}

.etc-tab-carousel.is-dragging .etc-tab-carousel-track {
    transition-duration: 0ms !important;
}

/*
 * Elementor containers (.e-con) carry their own flex + width rules, so the
 * slide sizing has to win explicitly or every slide collapses to auto width.
 */
.etc-tab-carousel-track > .etc-tab-carousel-slide,
.etc-tab-carousel-track > .e-con.etc-tab-carousel-slide {
    flex: 0 0 var(--etc-slide-width) !important;
    width: var(--etc-slide-width) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    position: relative;
    transition: opacity var(--etc-slide-fx, 400ms) ease,
                transform var(--etc-slide-fx, 400ms) ease,
                box-shadow var(--etc-slide-fx, 400ms) ease;
}

.etc-tab-carousel-slide--empty {
    min-height: 1px;
}

/*
 * Cloned slides exist only to make the loop seamless. The clone itself stays
 * clickable so it can be brought to the center, but nothing inside it is
 * interactive - those links and buttons are duplicates of the real slide.
 */
.etc-tab-carousel-slide[data-etc-clone] {
    pointer-events: auto;
}

.etc-tab-carousel-slide[data-etc-clone] * {
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ---------------------------------------------------------------
 * Navigation
 * ------------------------------------------------------------- */

.etc-tab-carousel-arrow {
    position: absolute;
    z-index: 5;
    top: 50%;
    width: var(--etc-nav-size);
    height: var(--etc-nav-size);
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0;
    font-size: calc(var(--etc-nav-size) * .72);
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}

.etc-tab-carousel-prev { left: var(--etc-nav-offset); }
.etc-tab-carousel-next { right: var(--etc-nav-offset); }
.etc-tab-carousel-arrow:disabled { opacity: .35; cursor: default; }

.etc-tab-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.etc-tab-carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: currentColor;
    opacity: .45;
    cursor: pointer;
    transition: opacity 220ms ease, transform 220ms ease;
}
.etc-tab-carousel-dot.is-active { opacity: 1; transform: scale(1.2); }

/* ---------------------------------------------------------------
 * Editor
 * The carousel stays live in the editor (minus clones and autoplay)
 * so tab selection previews the real behaviour.
 * ------------------------------------------------------------- */

.elementor-editor-active .etc-tab-carousel-viewport,
.elementor-editor-preview .etc-tab-carousel-viewport {
    overflow: hidden;
}

.elementor-editor-active .etc-tab-carousel-slide.elementor-element-empty,
.elementor-editor-preview .etc-tab-carousel-slide.elementor-element-empty {
    min-height: 120px;
}

/* ---------------------------------------------------------------
 * Editor - stacked preview
 * A horizontal strip parks every slide after the first outside the
 * widget, which makes those containers unreachable. Stacking them
 * keeps every nested container visible and editable.
 * ------------------------------------------------------------- */

.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-viewport {
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-track {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    gap: 26px;
    transform: none !important;
    transition: none !important;
    counter-reset: etc-slide;
}

.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-track > .etc-tab-carousel-slide,
.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-track > .e-con.etc-tab-carousel-slide {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    counter-increment: etc-slide;
    outline: 1px dashed rgba(105, 114, 125, .45);
    outline-offset: 5px;
    opacity: 1 !important;
}

.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-slide.is-active {
    outline-color: #93003f;
    outline-width: 2px;
}

/* Editor-only marker so each stacked container is identifiable. */
.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-slide[data-carousel-index]::after {
    content: "Tab " counter(etc-slide);
    position: absolute;
    top: 0;
    right: 0;
    z-index: 9;
    padding: 3px 8px;
    border-radius: 0 0 0 4px;
    background: #515962;
    color: #fff;
    font: 600 10px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    pointer-events: none;
}

.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-slide.is-active[data-carousel-index]::after {
    background: #93003f;
}

.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-arrow,
.etc-tab-carousel.etc-editor-stacked .etc-tab-carousel-dots {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .etc-tab-carousel-track { transition-duration: 0ms !important; }
    .etc-tab-carousel-slide { transition: none !important; }
    .etc-tab-carousel-nav-wrap { scroll-behavior: auto; }
}

@media (max-width: 767px) {
    .etc-tab-carousel-nav-wrap { justify-content: flex-start; }
}
