/* ================================================================
   cookie-consent.css — Blue Nook Realty
   GDPR cookie consent banner + floating re-open trigger
   ================================================================ */

/* ── Banner — base (off-screen, hidden) ─────────────────────── */
.bnr-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 28px 0;
    background: #12161c;          /* dark, matches footer background */
    border-top: 2px solid var(--Primary, #00B0F0);
    box-shadow: 0 -6px 48px rgba(0, 0, 0, .55);
    transform: translateY(100%);
    transition: transform .42s cubic-bezier(.16, 1, .3, 1);
    will-change: transform;
}

/* ── Visible state ──────────────────────────────────────────── */
.bnr-cookie-banner.bnr-is-visible {
    transform: translateY(0);
}

/* ── Hiding state (slide back down) ────────────────────────── */
.bnr-cookie-banner.bnr-is-hiding {
    transform: translateY(100%);
    pointer-events: none;
}

/* ── Inner flex container ───────────────────────────────────── */
.bnr-cookie-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    padding-right: 52px;          /* clearance for close button */
}

/* ── Left: icon + text ──────────────────────────────────────── */
.bnr-cookie-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex: 1 1 320px;
    min-width: 0;
}

/* Cookie icon badge */
.bnr-cookie-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background: var(--Primary, #00B0F0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

/* Heading */
.bnr-cookie-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    margin: 0 0 8px;
    line-height: 1.35;
}

/* Body text */
.bnr-cookie-desc {
    color: rgba(255, 255, 255, .75);
    font-size: .9rem;
    line-height: 1.7;
    margin: 0;
}

/* Inline privacy policy link */
.bnr-cookie-link {
    color: var(--Primary, #00B0F0);
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
    transition: color .15s;
}
.bnr-cookie-link:hover,
.bnr-cookie-link:focus { color: #fff; outline: none; }

/* ── Right: action buttons ──────────────────────────────────── */
.bnr-cookie-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Base button — WCAG 44×44px min touch target */
.bnr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 13px 28px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background .2s, border-color .2s, color .2s, box-shadow .15s, transform .15s;
    white-space: nowrap;
    outline: none;
    text-decoration: none;
}

/* Focus ring — visible keyboard focus only */
.bnr-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 176, 240, .55);
}

/* Subtle lift on click */
.bnr-btn:active {
    transform: translateY(1px);
}

/* Accept (filled / primary) */
.bnr-btn--primary {
    background: var(--Primary, #00B0F0);
    border-color: var(--Primary, #00B0F0);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 176, 240, .30);
}
.bnr-btn--primary:hover {
    background: var(--Hover, #0090c5);
    border-color: var(--Hover, #0090c5);
    color: #fff;
    box-shadow: 0 6px 22px rgba(0, 176, 240, .45);
}

/* Reject (ghost / outline) */
.bnr-btn--outline {
    background: transparent;
    border-color: rgba(255, 255, 255, .35);
    color: rgba(255, 255, 255, .85);
}
.bnr-btn--outline:hover {
    border-color: rgba(255, 255, 255, .70);
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

/* ── Dismiss (×) close button ───────────────────────────────── */
.bnr-cookie-close {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 18px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, .55);
    transition: color .2s, background .2s, border-color .2s;
    outline: none;
    padding: 0;
    font-size: .95rem;
    line-height: 1;
    flex-shrink: 0;
}
.bnr-cookie-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .28);
}
.bnr-cookie-close:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 176, 240, .55);
}

/* ── Floating re-open trigger ───────────────────────────────── */
.bnr-cookie-trigger {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9998;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--Primary, #00B0F0);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 176, 240, .45);
    transition: transform .22s, box-shadow .22s;
    outline: none;
    padding: 0;
}
.bnr-cookie-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0, 176, 240, .60);
}
.bnr-cookie-trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 176, 240, .55), 0 4px 18px rgba(0, 176, 240, .30);
}

/* Tooltip on hover */
.bnr-cookie-trigger::after {
    content: 'Cookie Preferences';
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #12161c;
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    border: 1px solid rgba(255, 255, 255, .14);
    letter-spacing: .02em;
}
.bnr-cookie-trigger:hover::after { opacity: 1; }

/* ── Consent-rejected overlay on map containers ─────────────── */
/* Applied by JS when user rejects and a Mapbox map is on the page */
.bnr-map-blocked {
    position: relative;
    min-height: 160px;
}
.bnr-map-blocked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #f0f4f8;
    border-radius: inherit;
    z-index: 10;
    display: flex;
}
.bnr-map-notice {
    position: absolute;
    inset: 0;
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 28px;
    background: #f0f4f8;
    border-radius: inherit;
}
.bnr-map-notice p {
    font-size: .9rem;
    color: #555;
    max-width: 300px;
    line-height: 1.65;
    margin: 0;
}
.bnr-map-notice button {
    font-size: .88rem;
    padding: 10px 22px;
    min-height: 44px;
    border-radius: 7px;
    background: var(--Primary, #00B0F0);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background .2s;
    outline: none;
}
.bnr-map-notice button:hover { background: var(--Hover, #0090c5); }
.bnr-map-notice button:focus-visible { box-shadow: 0 0 0 3px rgba(0,176,240,.5); }

/* ── Responsive — tablet (≤ 991px) ─────────────────────────── */
@media (max-width: 991px) {
    .bnr-cookie-banner {
        padding: 24px 0;
    }
    .bnr-cookie-inner {
        gap: 24px;
    }
    .bnr-btn {
        padding: 12px 22px;
        font-size: .9rem;
    }
}

/* ── Responsive — mobile (≤ 767px) ─────────────────────────── */
@media (max-width: 767px) {
    .bnr-cookie-banner {
        padding: 22px 0;
    }
    .bnr-cookie-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding-right: 48px;
    }
    .bnr-cookie-content {
        flex: 1 1 100%;
    }
    .bnr-cookie-title {
        font-size: 1rem;
    }
    .bnr-cookie-desc {
        font-size: .875rem;
    }
    .bnr-cookie-actions {
        width: 100%;
        flex-wrap: nowrap;
        gap: 12px;
    }
    .bnr-btn {
        flex: 1;
        justify-content: center;
        padding: 13px 16px;
        font-size: .875rem;
        min-height: 48px;
    }
    .bnr-cookie-close {
        top: 18px;
        transform: none;
    }
    .bnr-cookie-trigger {
        bottom: 18px;
        left: 18px;
        width: 46px;
        height: 46px;
    }
}

/* ── Responsive — small phones (≤ 420px) ───────────────────── */
@media (max-width: 420px) {
    .bnr-cookie-actions {
        flex-wrap: wrap;
    }
    .bnr-btn {
        flex: 1 1 100%;
        font-size: .875rem;
    }
    .bnr-cookie-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .bnr-cookie-banner,
    .bnr-cookie-trigger,
    .bnr-cookie-close,
    .bnr-btn {
        transition: none;
    }
}

/* ── High-contrast mode ─────────────────────────────────────── */
@media (forced-colors: active) {
    .bnr-cookie-banner {
        border-top: 2px solid ButtonText;
    }
    .bnr-btn--primary {
        background: ButtonText;
        color: ButtonFace;
    }
    .bnr-btn--outline {
        border-color: ButtonText;
        color: ButtonText;
    }
}
