/**
 * MEXC sticky promo bar (best-altcoins-to-buy).
 * Mobile: art left, content right (logo, title, CTA), close top-right.
 * Desktop: full container width, art left, text block + CTA distributed.
 */

.fc-mexc-bar {
    position: fixed;
    left: var(--fc-spacing-lg, 1.5rem);
    right: var(--fc-spacing-lg, 1.5rem);
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    z-index: 999999;
    width: auto;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
}

.fc-mexc-bar.is-visible {
    pointer-events: auto;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
}

.fc-mexc-bar.is-dismissed {
    display: none !important;
}

.fc-mexc-bar *,
.fc-mexc-bar *::before,
.fc-mexc-bar *::after {
    box-sizing: border-box;
}

/* ---- Panel ---- */
.fc-mexc-bar__panel {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    padding: 12px;
    background: #0c0d10;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

/* ---- Close ---- */
.fc-mexc-bar__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.fc-mexc-bar__close:hover,
.fc-mexc-bar__close:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.06);
}

.fc-mexc-bar__close:focus-visible {
    outline: 2px solid #2b7fff;
    outline-offset: 2px;
}

/* ---- Visual / artwork ---- */
.fc-mexc-bar__visual {
    flex: 0 0 auto;
    width: 116px;
    align-self: stretch;
}

.fc-mexc-bar__art {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 116px;
    object-fit: cover;
    border-radius: 12px;
}

/* ---- Body (logo + title + cta) ---- */
.fc-mexc-bar__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding-right: 26px;
}

.fc-mexc-bar__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.fc-mexc-bar__logo {
    display: block;
    width: auto;
    height: 18px;
    max-width: 110px;
    object-fit: contain;
    object-position: left center;
}

.fc-mexc-bar__title {
    margin: 0;
    font-family: var(--fc-font-heading, system-ui, sans-serif);
    font-size: clamp(0.95rem, 4.2vw, 1.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #fff;
}

.fc-mexc-bar__title-accent {
    color: #2b7fff;
}

/* ---- CTA ---- */
.fc-mexc-bar__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    background: #0054e9;
    color: #fff !important;
    font-family: var(--fc-font-body, system-ui, sans-serif);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 6px 16px rgba(0, 84, 233, 0.4);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.fc-mexc-bar__cta:hover,
.fc-mexc-bar__cta:focus-visible {
    color: #fff !important;
    text-decoration: none !important;
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.fc-mexc-bar__cta:focus-visible {
    outline: 2px solid #2b7fff;
    outline-offset: 2px;
}

.fc-mexc-bar__cta-arrow {
    font-size: 1.125rem;
    line-height: 1;
}

/* ============================================================
   Desktop: full container width, spacious horizontal layout
   ============================================================ */
@media (min-width: 769px) {
    .fc-mexc-bar {
        right: auto;
    }

    .fc-mexc-bar__panel {
        align-items: center;
        gap: 22px;
        padding: 16px;
        padding-right: 20px;
        border-radius: 20px;
    }

    .fc-mexc-bar__close {
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    .fc-mexc-bar__visual {
        width: 140px;
        align-self: center;
    }

    .fc-mexc-bar__art {
        height: 90px;
        min-height: 0;
        max-height: 90px;
        border-radius: 14px;
    }

    .fc-mexc-bar__body {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 28px;
        padding-right: 36px;
    }

    .fc-mexc-bar__text {
        gap: 12px;
    }

    .fc-mexc-bar__logo {
        height: 26px;
        max-width: 150px;
    }

    .fc-mexc-bar__title {
        font-size: clamp(1.375rem, 2vw, 1.875rem);
        line-height: 1.12;
        max-width: 30rem;
    }

    .fc-mexc-bar__cta {
        flex: 0 0 auto;
        width: auto;
        min-height: 52px;
        padding: 0 28px;
        font-size: 1.0625rem;
        border-radius: 12px;
    }

    .fc-mexc-bar__cta-arrow {
        font-size: 1.3rem;
    }
}

/* Keep back-to-top button clear of the bar */
body.fc-has-mexc-bar-visible .fc-page-topup {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 769px) {
    body.fc-has-mexc-bar-visible .fc-page-topup {
        bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
    }
}
