/* =========================================================
   Elementor M-Slider Widget — Styles
   ========================================================= */

/* ── Force full-width on Elementor's own wrappers ── */
.elementor-widget-ms_slider,
.elementor-widget-ms_slider .elementor-widget-container {
    width: 100%;
    display: block;
}

/* =========================================================
   M-Badge Standalone Widget
   ========================================================= */

/* Alignment wrapper */
.ms-badge-wrap {
    display: flex;
    width: 100%;
}

/* When used standalone: reset the bottom margin that only makes
   sense inside the slider's left panel */
.elementor-widget-ms_badge .ms-badge {
    margin-bottom: 0;
}

/* ── Wrapper ── */
.ms-wrap {
    display: flex;
    align-items: center;
    gap: 48px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* ── Left Panel (text / badge) ── */
.ms-left {
    flex: 0 0 220px;
    max-width: 220px;
    overflow: hidden;
}

.ms-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a3a6b;
    color: #fff;
    font-size: 12px;
    padding: 6px 14px 6px 6px;
    border-radius: 20px;
    margin-bottom: 32px;
    white-space: nowrap;
    font-weight: 500;
    font-family: inherit;
}

.ms-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f5c842;
    flex-shrink: 0;
}

.ms-text-clip {
    overflow: hidden;
}

.ms-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a7bd4;
    line-height: 1.15;
    margin: 0 0 14px;
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1), opacity 0.4s ease;
}

.ms-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;

    transform: translateY(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1) 0.05s, opacity 0.4s ease 0.05s;
}

/* ── Right Panel (images) ── */
.ms-right {
    flex: 1;
    display: flex;
    gap: 14px;
    align-items: flex-end;
    min-width: 0;
}

/* ── Main Image ── */
.ms-main {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    height: 360px;
    background: #ddd;
    position: relative;
    min-width: 0;
}

.ms-main-img {
    width: 100%;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* ── Main image animations ── */
.ms-img-enter-right {
    animation: msEnterRight 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ms-img-enter-left {
    animation: msEnterLeft 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ms-img-exit-left {
    animation: msExitLeft 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ms-img-exit-right {
    animation: msExitRight 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes msEnterRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes msEnterLeft {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes msExitLeft {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

@keyframes msExitRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

/* ── Right column (navs + thumb) ── */
.ms-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    /* children stretch to match the thumbnail width */
    flex-shrink: 0;
}

.ms-navs {
    display: flex;
    width: 100%;
    /* matches .ms-thumb width (widest child in .ms-col) */
    justify-content: space-between;
    align-items: center;
}

/* ── Navigation Buttons — full reset, no browser/Elementor defaults ── */
.ms-btn,
.ms-btn:hover,
.ms-btn:focus,
.ms-btn:active,
.ms-btn:focus-visible,
.ms-btn:focus-within {
    appearance: none;
    -webkit-appearance: none;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
}

/* Default SVG arrow (shown when no custom icon is uploaded) */
.ms-btn svg {
    width: 18px;
    height: 18px;
    stroke: #1a7bd4;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Custom uploaded icon — render as-is, no forced styling */
.ms-btn img {
    display: block;
    max-width: none;
    height: auto;
    object-fit: contain;
}

/* ── Thumbnail ── */
.ms-thumb {
    width: 155px;
    height: 115px;
    border-radius: 12px;
    overflow: hidden;
    background: #ddd;
    position: relative;
    flex-shrink: 0;
}

.ms-thumb-img {
    width: 100%;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* ── Thumbnail animations (re-use same keyframes) ── */
.ms-thumb-enter-right {
    animation: msEnterRight 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ms-thumb-enter-left {
    animation: msEnterLeft 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ms-thumb-exit-left {
    animation: msExitLeft 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}

.ms-thumb-exit-right {
    animation: msExitRight 0.5s cubic-bezier(.4, 0, .2, 1) forwards;
}


/* =========================================================
   RESPONSIVE — Tablet  (≤ 1024px)
   ========================================================= */
@media (max-width: 1024px) {
    .ms-wrap {
        gap: 24px;
        padding: 32px 20px;
    }

    .ms-left {
        flex: 0 0 180px;
        max-width: 180px;
    }

    .ms-title {
        font-size: 28px;
    }

    .ms-main {
        height: 300px;
    }

    .ms-thumb {
        width: 120px;
        height: 90px;
    }

    /* Prevent overlap: let nav buttons use a gap instead of
       relying on the thumbnail width as the container */
    .ms-navs {
        width: auto;
        justify-content: center;
        gap: 20px;
    }
}

/* =========================================================
   RESPONSIVE — Mobile landscape  (≤ 768px)
   ========================================================= */
@media (max-width: 768px) {
    .ms-wrap {
        flex-direction: column;
        gap: 20px;
        padding: 24px 16px;
        align-items: stretch;
    }

    /* Center badge + text on mobile */
    .elementor-widget-ms_slider .ms-left {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
    }

    /* Badge pill: inline-flex centers with text-align on parent */
    .elementor-widget-ms_slider .ms-left .ms-badge {
        display: inline-flex !important;
    }

    .ms-desc {
        max-width: 100%;
    }

    .ms-right {
        flex-direction: column;
        gap: 12px;
    }

    .ms-main {
        height: 240px;
        width: 100%;
        flex: none;
    }

    /* Nav row: full-width, centered with gap — thumbnail is hidden
       so space-between has no anchor; use gap instead */
    .ms-col {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 16px;
        width: 100%;
    }

    .ms-navs {
        width: auto;
        justify-content: center;
        gap: 32px;
    }

    .ms-thumb {
        display: none;
    }
}

/* =========================================================
   RESPONSIVE — Mobile portrait  (≤ 480px)
   ========================================================= */
@media (max-width: 480px) {
    .ms-wrap {
        padding: 20px 12px;
        gap: 16px;
    }

    .ms-title {
        font-size: 24px;
    }

    .ms-main {
        height: 200px;
    }

    .ms-badge {
        font-size: 11px;
        padding: 5px 12px 5px 5px;
    }

    .ms-btn {
        width: 40px;
        height: 40px;
    }

    .ms-btn svg {
        width: 16px;
        height: 16px;
    }
}