/* Cookie Consent Banner — above Bar D / modals so Safari taps hit the buttons */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    /* Sit above the labeled bottom nav so Accept/Decline are not covered */
    bottom: calc(var(--bottom-bar-height, 72px) + max(env(safe-area-inset-bottom, 0px), 6px));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    /* Above auth modal (2147483300) and app chrome — was 10000 and taps hit Bar D / modals */
    z-index: 2147483500;
    isolation: isolate;
    pointer-events: auto;
    transform: translate3d(0, calc(100% + 24px), 0);
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

:root[data-theme='dark'] .cookie-consent-banner {
    background: rgba(26, 15, 46, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-consent-banner--visible {
    transform: translate3d(0, 0, 0);
}

.cookie-consent-banner__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    justify-content: space-between;
    pointer-events: auto;
}

.cookie-consent-banner__text {
    flex: 1 1 300px;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text, #212529);
}

.cookie-consent-banner__link {
    color: var(--accent-purple, #468189);
    text-decoration: underline;
    pointer-events: auto;
    touch-action: manipulation;
}

.cookie-consent-banner__link:hover {
    color: var(--accent-pink, #77ACA2);
}

.cookie-consent-banner__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.cookie-consent-banner__btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    z-index: 2;
}

.cookie-consent-banner__btn--accept {
    background: var(--accent-purple, #468189);
    color: white;
}

.cookie-consent-banner__btn--accept:hover {
    background: var(--accent-pink, #77ACA2);
}

.cookie-consent-banner__btn--decline {
    background: var(--bg-secondary, rgba(0, 0, 0, 0.05));
    color: var(--text, #212529);
}

:root[data-theme='dark'] .cookie-consent-banner__btn--decline {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text, #E8E4ED);
}

.cookie-consent-banner__btn--decline:hover {
    background: var(--bg-secondary-hover, rgba(0, 0, 0, 0.1));
}

:root[data-theme='dark'] .cookie-consent-banner__btn--decline:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cookie-consent-message {
    position: fixed;
    bottom: calc(var(--bottom-bar-height, 72px) + 28px + max(env(safe-area-inset-bottom, 0px), 6px));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 2147483501;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.cookie-consent-message--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 12px 16px;
    }

    .cookie-consent-banner__content {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
    }

    .cookie-consent-banner__text {
        flex: 0 1 auto;
        font-size: 0.875rem;
    }

    .cookie-consent-banner__actions {
        width: 100%;
        margin-top: 0;
    }

    .cookie-consent-banner__btn {
        flex: 1;
        min-width: 0;
        min-height: 44px;
    }
}

/* Landing / non-app pages without a bottom bar */
body:not(.app-mode) .cookie-consent-banner {
    bottom: 0;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}
