.cookie-consent {
    position: relative;
    z-index: 1000 !important;
}

body.cookie-preferences-open {
    overflow: hidden;
}

.cookie-consent__banner {
    position: fixed;
    right: 24px;
    bottom: 90px;
    width: min(460px, calc(100vw - 32px));
    padding: 22px;
    border-radius: 24px;
    background: rgba(12, 16, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 60px rgba(2, 8, 23, 0.38);
}

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

.cookie-consent__kicker {
    display: inline-block;
    margin-bottom: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.cookie-consent__copy h2,
.cookie-preferences__head h2 {
    margin: 0 0 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    letter-spacing: -0.03em;
}

.cookie-consent__copy p,
.cookie-preferences__description,
.cookie-option p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

.cookie-consent__link {
    display: inline-flex;
    margin-top: 14px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.cookie-consent__actions,
.cookie-preferences__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.cookie-consent__btn {
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

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

.cookie-consent__btn--primary {
    color: #03111f;
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    box-shadow: 0 18px 28px rgba(34, 211, 238, 0.2);
}

.cookie-consent__btn--secondary {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-consent__btn--ghost {
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.cookie-preferences {
    position: fixed;
    inset: 0;
    z-index: 1000 !important;
}

.cookie-preferences__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 23, 0.68);
    backdrop-filter: blur(8px);
}

.cookie-preferences__panel {
    position: relative;
    width: min(680px, calc(100vw - 32px));
    margin: 7vh auto 0;
    padding: 26px;
    border-radius: 28px;
    background: rgba(12, 16, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 64px rgba(2, 8, 23, 0.45);
}

.cookie-preferences__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cookie-preferences__close {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
}

.cookie-preferences__list {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-option h3 {
    margin: 0 0 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
}

.cookie-option__state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.14);
    color: var(--accent-primary);
    font-weight: 700;
    white-space: nowrap;
}

.cookie-switch {
    position: relative;
    display: inline-flex;
    width: 56px;
    height: 32px;
    flex-shrink: 0;
}

.cookie-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.cookie-switch__track {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.28);
    transition: background 0.2s ease;
}

.cookie-switch__track::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.cookie-switch input:checked + .cookie-switch__track {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
}

.cookie-switch input:checked + .cookie-switch__track::after {
    transform: translateX(24px);
}

@media (max-width: 768px) {
    .cookie-consent__banner {
        right: 16px;
        bottom: 82px;
        width: calc(100vw - 32px);
        padding: 18px;
        border-radius: 20px;
    }

    .cookie-preferences__panel {
        margin-top: 4vh;
        padding: 20px;
        border-radius: 22px;
    }

    .cookie-option {
        align-items: flex-start;
        flex-direction: column;
    }

    .cookie-option__state,
    .cookie-switch {
        margin-top: 6px;
    }
}

/* Dark theme overrides - ensure visibility on dark backgrounds */
[data-theme="dark"] .cookie-consent__banner {
    background: rgba(12, 16, 28, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .cookie-consent__btn--primary {
    color: #03111f;
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    box-shadow: 0 18px 28px rgba(34, 211, 238, 0.25);
}

[data-theme="dark"] .cookie-consent__btn--secondary {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .cookie-consent__btn--ghost {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .cookie-preferences {
    background: rgba(2, 8, 23, 0.85);
}

[data-theme="dark"] .cookie-preferences__backdrop {
    background: rgba(2, 8, 23, 0.75);
}

[data-theme="dark"] .cookie-preferences__panel {
    background: rgba(12, 16, 28, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cookie-option {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cookie-preferences__close {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

/* Light theme overrides - ensure visibility on light backgrounds */
[data-theme="light"] .cookie-consent__banner {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cookie-consent__kicker {
    color: var(--accent-primary, #007a8c);
}

[data-theme="light"] .cookie-consent__copy h2,
[data-theme="light"] .cookie-preferences__head h2 {
    color: #0f172a;
}

[data-theme="light"] .cookie-consent__copy p,
[data-theme="light"] .cookie-preferences__description,
[data-theme="light"] .cookie-option p {
    color: #475569;
}

[data-theme="light"] .cookie-consent__link {
    color: var(--accent-primary, #007a8c);
}

[data-theme="light"] .cookie-consent__btn--primary {
    color: #ffffff;
    background: linear-gradient(135deg, #007a8c, #005f6b);
    box-shadow: 0 18px 28px rgba(0, 122, 140, 0.25);
}

[data-theme="light"] .cookie-consent__btn--secondary {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .cookie-consent__btn--ghost {
    color: #64748b;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .cookie-preferences__backdrop {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .cookie-preferences__panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .cookie-option {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cookie-option h3 {
    color: #0f172a;
}

[data-theme="light"] .cookie-option__state {
    background: rgba(0, 122, 140, 0.12);
    color: #007a8c;
}

[data-theme="light"] .cookie-preferences__close {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

[data-theme="light"] .cookie-switch__track {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .cookie-switch__track::after {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .cookie-switch input:checked + .cookie-switch__track {
    background: linear-gradient(135deg, #007a8c, #005f6b);
}
