.cookie-consent {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 4800;
    width: min(520px, calc(100vw - 2rem));
    color: var(--text-primary, #111827);
}

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

.cookie-consent-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color, #e3ebf3);
    border-radius: 8px;
    background: var(--bg-card, #ffffff);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.cookie-consent-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.cookie-consent-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary, #111827);
}

.cookie-consent-text {
    margin: 0.35rem 0 0;
    color: var(--text-secondary, #334155);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-consent-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color, #e3ebf3);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #334155);
}

.cookie-consent-close:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text-primary, #111827);
}

.cookie-consent-options {
    display: grid;
    gap: 0.65rem;
}

.cookie-consent-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem;
    border: 1px solid var(--border-color, #e3ebf3);
    border-radius: 8px;
    background: var(--bg-secondary, #f8fafc);
}

.cookie-consent-option strong {
    display: block;
    color: var(--text-primary, #111827);
    font-size: 0.9rem;
}

.cookie-consent-option span {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
    line-height: 1.35;
}

.cookie-consent-switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
}

.cookie-consent-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cookie-consent-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background-color 160ms ease;
}

.cookie-consent-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 160ms ease;
}

.cookie-consent-switch input:checked + .cookie-consent-slider {
    background: var(--primary-color, #1565c0);
}

.cookie-consent-switch input:checked + .cookie-consent-slider::before {
    transform: translateX(18px);
}

.cookie-consent-switch input:disabled + .cookie-consent-slider {
    opacity: 0.7;
}

.cookie-consent-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.cookie-consent-link {
    color: var(--primary-color, #1565c0);
    font-weight: 600;
    text-decoration: none;
}

.cookie-consent-link:hover {
    text-decoration: underline;
}

html:not([data-theme="light"]) .cookie-consent-panel {
    background: var(--bg-card, #111827);
    border-color: var(--border-color, rgba(148, 163, 184, 0.18));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

html:not([data-theme="light"]) .cookie-consent-option {
    background: color-mix(in srgb, var(--bg-card, #111827) 88%, #ffffff 12%);
}

@media (max-width: 575.98px) {
    .cookie-consent {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
    }

    .cookie-consent-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cookie-consent-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
