/* --------------------------------------------------------------------------
   Cookie Consent Banner
   GDPR-compliant informational banner for essential cookies
   -------------------------------------------------------------------------- */

.hh-cookie-banner {
    position: fixed;
    bottom: 1rem;
    left: 0;
    right: 0;
    z-index: 9000;
    padding: 0 1rem;
    pointer-events: none;
    animation: hh-cookie-slide-up 0.4s ease-out;
}

/* Keep the last controls scrollable above the fixed banner. Without this
   clearance, long pages can end with their final action physically behind the
   consent card even though the control is technically in the viewport. */
.hh-app:has(.hh-cookie-banner) .hh-content {
    padding-bottom: calc(0.75rem + 72px + env(safe-area-inset-bottom, 0px) + var(--hh-android-mobile-nav-lift, 0px) + 8rem);
    scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 8rem);
}

.hh-app:has(.hh-cookie-banner) .hh-content--document {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px) + 8rem);
    scroll-padding-bottom: 8rem;
}

.hh-cookie-banner-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(30, 30, 33, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    pointer-events: auto;
}

.hh-cookie-banner-text {
    flex: 1 1 280px;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.hh-cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.hh-cookie-banner-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.hh-cookie-banner-link:hover,
.hh-cookie-banner-link:focus-visible {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.hh-cookie-banner-accept {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    min-height: 36px;
    background: var(--hh-action-primary-bg);
    color: var(--hh-action-primary-fg);
    border: none;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hh-cookie-banner-accept:hover {
    background: var(--hh-action-primary-bg-hover);
    box-shadow: 0 2px 8px rgba(196, 97, 108, 0.3);
}

.hh-cookie-banner-accept:active {
    transform: scale(0.97);
}

.hh-cookie-banner-accept:focus-visible {
    outline: 2px solid #C4616C;
    outline-offset: 2px;
}

.hh-cookie-banner-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border-radius: 2px;
}

@keyframes hh-cookie-slide-up {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Mobile: clear the fixed bottom navigation ── */
@media (max-width: 768px) {
    .hh-app--mobile-nav .hh-cookie-banner {
        bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Stack vertically only on the narrowest screens. */
@media (max-width: 480px) {
    .hh-app:has(.hh-cookie-banner) .hh-content {
        padding-bottom: calc(0.75rem + 72px + env(safe-area-inset-bottom, 0px) + var(--hh-android-mobile-nav-lift, 0px) + 11rem);
        scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 11rem);
    }

    .hh-app:has(.hh-cookie-banner) .hh-content--document {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px) + 11rem);
        scroll-padding-bottom: 11rem;
    }

    .hh-cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .hh-cookie-banner-text {
        flex: 0 1 auto;
    }

    .hh-cookie-banner-actions {
        justify-content: flex-end;
    }
}

@media (min-width: 769px) {
    .hh-app:has(.hh-cookie-banner) .hh-content {
        padding-bottom: 8rem;
        scroll-padding-bottom: 8rem;
    }
}

/* ── Paper (light) theme override ── */
[data-hh-theme="paper"] .hh-cookie-banner-inner,
.hh-app--paper .hh-cookie-banner-inner {
    background: rgba(247, 245, 242, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(0, 0, 0, 0.04) inset;
}

[data-hh-theme="paper"] .hh-cookie-banner-text,
.hh-app--paper .hh-cookie-banner-text {
    color: rgba(28, 26, 23, 0.85);
}

[data-hh-theme="paper"] .hh-cookie-banner-link,
.hh-app--paper .hh-cookie-banner-link {
    color: rgba(28, 26, 23, 0.55);
}

[data-hh-theme="paper"] .hh-cookie-banner-link:hover,
.hh-app--paper .hh-cookie-banner-link:hover {
    color: rgba(28, 26, 23, 0.9);
}
