/* =========================================================
   Floating Strip Banner – Stylesheet  v1.3.0
   Half-width white card · rounded corners · fixed position
   ========================================================= */

:root {
    --fsb-color: #1a1a1a;
    --fsb-z:     99998;
}

/* =========================================================
   Outer wrapper – positions the card in the viewport
   ========================================================= */
.fsb-strip {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    pointer-events: none;
    z-index: var(--fsb-z);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.fsb-strip.fsb-bottom { bottom: 0; top: auto; }
.fsb-strip.fsb-top    { top: 0;    bottom: auto; }

/* Hidden / out */
.fsb-strip.fsb-hidden {
    pointer-events: none;
    opacity: 0;
    transform: translateY(40px);
}
.fsb-strip.fsb-top.fsb-hidden {
    transform: translateY(-40px);
}

@media (prefers-reduced-motion: reduce) {
    .fsb-strip            { transition: opacity 0.15s linear; }
    .fsb-strip.fsb-hidden { transform: none; }
}

/* =========================================================
   Preview in admin (non-fixed)
   ========================================================= */
.fsb-strip.fsb-preview {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    padding: 0;
    background: none;
}

/* =========================================================
   White card – responsive width, rounded corners
   ========================================================= */
.fsb-card {
    pointer-events: auto;
    position: relative;        /* anchor for absolute × on mobile */
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: nowrap;

    width: clamp(320px, 65%, 950px);

    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
    padding: 14px 42px 14px 18px;
    color: var(--fsb-color);
    border: 1px solid rgba(0, 0, 0, 0.07);
}

/* =========================================================
   Logo – flexible width based on image size
   ========================================================= */
.fsb-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.fsb-logo img {
    max-height: 44px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

/* =========================================================
   Text – flexible, expands to fill available space
   ========================================================= */
.fsb-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fsb-line {
    display: block;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--fsb-color);
}

.fsb-line1 {
    font-size: 0.9rem;
    font-weight: 700;
}

.fsb-line2 {
    font-size: 0.8rem;
    opacity: 0.75;
}

/* =========================================================
   CTA button – mirrors .p-button (Agilysys brand)
   ========================================================= */
.fsb-cta {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fsb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    background-color: rgb(132 189 0);
    color: #ffffff;
    font-family: DMSans-Regular, 'DM Sans', sans-serif;
    font-size: clamp(12px, 1.8vw, 14px);
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease, box-shadow 150ms ease;
    -webkit-font-smoothing: antialiased;
}

.fsb-btn:hover {
    background-color: rgb(82 82 82);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    text-decoration: none;
}

.fsb-btn:focus-visible {
    outline: 3px solid rgb(132 189 0);
    outline-offset: 3px;
}

/* =========================================================
   Close (×) – positioned at edge, never overlaps content
   ========================================================= */
.fsb-close {
    position: absolute;
    top: 0px;
    right: 0px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    line-height: 0;
    color: var(--fsb-color);
    opacity: 0.45;
    transition: opacity 0.2s, background-color 0.2s;
    touch-action: manipulation;
    z-index: 10;
}

.fsb-close:hover,
.fsb-close:focus-visible {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.03);
    outline: 2px solid #eee;
    outline-offset: 1px;
}

/* =========================================================
   Responsive – Large Desktop (1025px+)
   Logo flexible, text expands to fill space
   ========================================================= */
@media (min-width: 1025px) {
    .fsb-card {
        width: clamp(700px, 65%, 950px);
        gap: 24px;
        padding: 16px 48px 16px 20px;
    }

    .fsb-logo { flex: 0 0 auto; }
    .fsb-logo img { max-height: 48px; max-width: 240px; }
    .fsb-text { flex: 1 1 auto; }
    .fsb-line1    { font-size: 0.95rem; }
    .fsb-line2    { font-size: 0.85rem; }

    .fsb-btn {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* =========================================================
   Responsive – Small Desktop / Large Tablet (769px - 1024px)
   Logo flexible, text expands to fill space
   ========================================================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .fsb-card {
        width: clamp(320px, 75%, 850px);
        gap: 18px;
        padding: 14px 42px 14px 16px;
    }

    .fsb-logo { flex: 0 0 auto; }
    .fsb-logo img { max-height: 42px; max-width: 180px; }
    .fsb-text { flex: 1 1 auto; }
    .fsb-line1    { font-size: 0.88rem; }
    .fsb-line2    { font-size: 0.78rem; }

    .fsb-btn {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* =========================================================
   Responsive – Tablet (481px - 768px)
   Logo flexible, text expands to fill space
   ========================================================= */
@media (max-width: 768px) and (min-width: 481px) {
    .fsb-card {
        width: clamp(320px, 88%, 680px);
        gap: 14px;
        padding: 12px 38px 12px 14px;
    }

    .fsb-logo { flex: 0 0 auto; }
    .fsb-logo img { max-height: 38px; max-width: 140px; }
    .fsb-text { flex: 1 1 auto; }
    .fsb-line1    { font-size: 0.82rem; }
    .fsb-line2    { font-size: 0.75rem; }

    .fsb-btn {
        font-size: 14px;
        padding: 6px 10px;
    }
}

/* =========================================================
   Responsive – Mobile ≤ 480 px
   Layout (top→bottom):  Logo → Text → Button (50% wide)
   × pinned to top-right corner of the card
   ========================================================= */
@media (max-width: 480px) {
    .fsb-strip {
        padding: 10px 0px 70px 35px;
        align-items: flex-end;
    }

    .fsb-card {
        width: clamp(280px, 90%, 380px);
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        border-radius: 10px;
        padding: 38px 14px 14px 14px;   /* top padding for close button */
    }

    /* × already positioned at top-right; no mobile override needed */
    .fsb-close {
        opacity: 0.55;
    }

    .fsb-logo {
        order: 0;
        align-self: flex-start;
        flex: 0 0 auto;
    }

    .fsb-logo img {
        max-height: 70px;
        max-width: 100%;
    }

    .fsb-text {
        order: 1;
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    /* Allow text to wrap on mobile */
    .fsb-line {
        white-space: normal;
        text-overflow: unset;
        overflow: visible;
    }

    .fsb-line1 { font-size: 0.85rem; }
    .fsb-line2 { font-size: 0.78rem; }

    .fsb-cta {
        order: 2;
        width: 50%;
        flex: 0 0 auto;
    }

    .fsb-btn {
        width: 100%;
        justify-content: center;
        font-size: 13px;
        padding: 10px 12px;
        white-space: normal;
        text-align: center;
    }
}

/* =========================================================
   Re-open floating trigger tab
   Appears at center-bottom after the strip is closed.
   Hidden by default; JS adds .fsb-trigger-visible to show it.
   Positioned center to avoid conflict with Alix overlay (right-side).
   ========================================================= */
.fsb-trigger {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(16px) scale(0.9);
    z-index: var(--fsb-z);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgb(132 189 0);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 10px 18px 10px 14px;
    font-family: DMSans-Regular, 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    -webkit-font-smoothing: antialiased;
    white-space: nowrap;
}

.fsb-trigger.fsb-trigger-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

.fsb-trigger:hover {
    background: rgb(82 82 82);
    box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

.fsb-trigger:focus-visible {
    outline: 3px solid rgb(132 189 0);
    outline-offset: 3px;
}

.fsb-trigger svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .fsb-trigger {
        bottom: 16px;
        font-size: 12px;
        padding: 9px 14px 9px 12px;
    }
}

/* =========================================================
   Responsive – Very Small Mobile (≤ 360px)
   Ultra-compact layout for small phones
   ========================================================= */
@media (max-width: 360px) {
    .fsb-strip {
        padding: 8px 0px 70px 20px;
    }

    .fsb-card {
        width: clamp(260px, 95%, 320px);
        gap: 8px;
        padding: 36px 12px 12px 12px;
    }

    .fsb-logo img {
        max-height: 70px;
        max-width: 100%;
    }

    .fsb-line1 { font-size: 0.80rem; }
    .fsb-line2 { font-size: 0.72rem; }

    .fsb-btn {
        font-size: 14px;
        padding: 8px 10px;
    }

    .fsb-trigger {
        bottom: 12px;
        font-size: 11px;
        padding: 8px 12px 8px 10px;
    }
}
