/* ==========================================================================
   IMC Popup Widget — frontend styles
   Mirrors the layout of the Vue menu Popup.vue component.
   ========================================================================== */

/* ── Outer shell ── */
.imc-popup-widget {
    position: fixed;
    right: 15px;
    bottom: 15px;
    max-width: 240px;
    width: calc(100vw - 30px);
    overflow: hidden;
    border-radius: 5px;
    z-index: 9998;
    background-color: #585858; /* --imc_grey_mid */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.30);
}

/* ── Inner link / div ── */
.imc-popup-widget__inner {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    /* Reserve space for the orange accent bar at the bottom */
    padding-bottom: 5px;
}

/* Orange accent bar */
.imc-popup-widget__inner::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background-color: rgba(255, 70, 55, 1); /* --imc_orange */
    pointer-events: none;
}

/* ── Header (headline + optional text) ── */
.imc-popup-widget__header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px 10px;
}

.imc-popup-widget__headline {
    display: block;
    font-size: 0.778em;  /* ~14px at 18px base */
    line-height: 18px;
    color: #ffffff;
    font-weight: 600;
}

.imc-popup-widget__text {
    font-size: 0.722em;  /* slightly smaller than headline */
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.80);
    margin: 0;
}

/* ── Image ── */
.imc-popup-widget__image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    /* Extra bottom spacing to avoid sitting directly on the orange bar */
    margin-bottom: 5px;
}

.imc-popup-widget__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Close button ── */
.imc-popup-widget__close {
    position: absolute;
    right: 5px;
    bottom: 12px; /* sits just above the orange bar */
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #585858; /* matches card background */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background-color 0.15s ease;
}

.imc-popup-widget__close:hover,
.imc-popup-widget__close:focus-visible {
    background-color: #3a3a3a;
    outline: none;
}

.imc-popup-widget__close svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* ==========================================================================
   Mobile — horizontal strip layout (≤ 1024 px)
   ========================================================================== */
@media screen and (max-width: 1024px) {
    .imc-popup-widget {
        max-width: calc(100vw - 30px);
    }

    .imc-popup-widget__inner {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 5px; /* keep space for orange bar */
    }

    .imc-popup-widget__header {
        order: 1;
        flex: 1;
        min-width: 0; /* prevent flex blowout */
        padding: 10px 10px;
        gap: 4px;
    }

    .imc-popup-widget__image {
        order: 2;
        width: 55px;
        height: 55px;
        flex-shrink: 0;
        aspect-ratio: auto;
        margin-bottom: 5px;
    }

    /* Close button switches to inline flow, no longer absolutely positioned */
    .imc-popup-widget__close {
        position: relative;
        right: auto;
        bottom: auto;
        order: 3;
        flex-shrink: 0;
        margin: 0 10px 5px 0;
    }
}
