/* =====================================================
   BN Site Tools — Frontend CSS
   ===================================================== */

/* ── Sticky Header ─────────────────────────────────── */
.bnm-header-sticky {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.bnm-header-sticky.bnm-scrolled {
    box-shadow: 0 2px 20px rgba(27, 38, 59, 0.12);
}

/* ── Promo Banner ──────────────────────────────────── */
.bnm-promo-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 2.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    position: relative;
    z-index: 1001;
    gap: 0.5rem;
}

.bnm-promo-banner.bnm-banner--top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.bnm-promo-banner.bnm-banner--bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
}

.bnm-promo-banner.bnm-banner--dismissed {
    display: none !important;
}

.bnm-banner__inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.bnm-banner__link {
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
    color: inherit !important;
}

.bnm-banner__link:hover {
    opacity: 0.85;
}

.bnm-banner__close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: inherit;
    opacity: 0.7;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    transition: opacity 0.2s;
}

.bnm-banner__close:hover {
    opacity: 1;
}

/* Push page content down when banner is at top */
body.bnm-banner-top-active {
    padding-top: 42px;
}

body.bnm-banner-bottom-active {
    padding-bottom: 42px;
}

/* ── Sticky Bottom Buttons ─────────────────────────── */
.bnm-sticky-buttons {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    pointer-events: none;
}

/* Offset above a bottom banner */
body.bnm-banner-bottom-active .bnm-sticky-buttons {
    bottom: calc(42px + 1.25rem);
}

.bnm-sticky-btn {
    pointer-events: all;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(27, 38, 59, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    border: none;
    cursor: pointer;
}

.bnm-sticky-btn:hover,
.bnm-sticky-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(27, 38, 59, 0.28);
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.bnm-sticky-btn__icon {
    font-size: 1.05em;
    line-height: 1;
}

.bnm-sticky-btn__label {
    line-height: 1;
}

/* ── Promo Popup ───────────────────────────────────── */
.bnm-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 21, 37, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.bnm-popup-overlay[hidden] {
    display: none !important;
}

.bnm-popup-overlay.bnm-popup--visible {
    opacity: 1;
}

.bnm-popup {
    position: relative;
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(15, 21, 37, 0.28);
    max-width: 540px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(28px) scale(0.97);
    transition: transform 0.35s ease;
}

.bnm-popup-overlay.bnm-popup--visible .bnm-popup {
    transform: translateY(0) scale(1);
}

.bnm-popup__image {
    width: 100%;
    max-height: 240px;
    overflow: hidden;
    flex-shrink: 0;
}

.bnm-popup__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bnm-popup__content {
    padding: 2rem 2rem 2.25rem;
}

.bnm-popup__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    line-height: 1.2;
}

.bnm-popup__body {
    font-size: 0.97rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.bnm-popup__cta {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
}

.bnm-popup__cta:hover {
    opacity: 0.88;
    transform: translateY(-2px);
}

.bnm-popup__close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s;
}

.bnm-popup__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
    .bnm-sticky-buttons {
        bottom: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
    }

    .bnm-sticky-btn {
        padding: 0.6rem 1rem;
        font-size: 0.82rem;
    }

    .bnm-popup__content {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .bnm-promo-banner {
        font-size: 0.82rem;
        padding: 0.55rem 2.5rem;
    }
}
