.cookie-banner,
.cookie-banner * {
    box-sizing: border-box;
}

.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 10060;
    width: min(650px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
    overflow: auto;
    padding: 20px 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    font-family: Inter, Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(100% + 48px));
    transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
}

[data-theme="dark"] .cookie-banner,
body.dark .cookie-banner {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(20, 20, 30, 0.96);
    color: #f8fafc;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.cookie-banner.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cookie-icon {
    flex: 0 0 auto;
    font-size: 1.2rem;
    line-height: 1;
}

.cookie-copy {
    flex: 1 1 auto;
    min-width: 190px;
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.cookie-copy strong {
    color: #111827;
}

[data-theme="dark"] .cookie-copy,
body.dark .cookie-copy {
    color: #a8b0c0;
}

[data-theme="dark"] .cookie-copy strong,
body.dark .cookie-copy strong {
    color: #f8fafc;
}

.cookie-btns {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.cookie-consent-button {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cookie-consent-button:hover {
    transform: translateY(-1px);
}

.cookie-consent-button:focus-visible {
    outline: 3px solid rgba(139, 92, 246, 0.34);
    outline-offset: 2px;
}

.cookie-consent-button--essential {
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(148, 163, 184, 0.08);
    color: inherit;
}

.cookie-consent-button--accept {
    border: 0;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
    box-shadow: 0 8px 22px rgba(168, 85, 247, 0.3);
}

@media (max-width: 768px) {
    .cookie-banner {
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
        padding: 16px;
        border-radius: 18px;
    }

    .cookie-inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 12px;
    }

    .cookie-copy {
        min-width: 0;
        font-size: 0.88rem;
    }

    .cookie-btns {
        grid-column: 1 / -1;
        width: 100%;
    }

    .cookie-consent-button {
        flex: 1 1 0;
    }

    body.cookie-consent-pending .chat-widget,
    body.cookie-consent-pending .a11y-trigger,
    body.cookie-consent-pending .a11y-panel,
    body.cookie-consent-pending .mobile-cta {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

@media (max-width: 420px) {
    .cookie-btns {
        flex-direction: column;
    }

    .cookie-consent-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-consent-button {
        transition: none;
    }
}
