/* #20 Cookie: плашка */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 24px 24px;
    display: flex;
    justify-content: center;
    z-index: 1500;
    transform: translateY(calc(100% + 24px));
    transition: transform .5s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner__inner {
    position: relative;
    width: min(880px, 100%);
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    padding: 18px 22px 18px 20px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
    pointer-events: auto;
    overflow: hidden;
}

.cookie-banner__inner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .85;
}

.cookie-banner__icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
    animation: cookiePulse 3.2s ease-in-out infinite;
}

.cookie-banner__icon .svg-icon {
    width: 24px;
    height: 24px;
}

@keyframes cookiePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 0 0 0 var(--accent-bg);
    }
    50% {
        transform: scale(1.06);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 0 0 8px transparent;
    }
}

.cookie-banner__text {
    flex: 1 1 320px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.cookie-banner__text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.cookie-btn {
    position: relative;
    padding: 10px 22px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

.cookie-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
    filter: brightness(1.06);
}

.cookie-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.cookie-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.cookie-btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
    box-shadow: none;
}

.cookie-btn--ghost:hover {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

.cookie-btn--link {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    box-shadow: none;
    padding: 10px 14px;
    text-decoration: none;
}

.cookie-btn--link:hover {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    box-shadow: none;
    transform: none;
    filter: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* #21 Cookie: модалка настроек */
.cookie-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(.97);
    width: min(640px, 94vw);
    max-height: 86vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
    display: flex;
    flex-direction: column;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.cookie-modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cookie-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.cookie-modal__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 10px;
}

.cookie-modal__icon .svg-icon {
    width: 22px;
    height: 22px;
}

.cookie-modal__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.cookie-modal__subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.cookie-modal__legal {
    margin-top: 10px;
    padding: 9px 12px;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
}

.cookie-modal__close {
    margin-left: auto;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.cookie-modal__close:hover {
    background: var(--border);
    color: var(--text-primary);
}

.cookie-modal__body {
    padding: 18px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color var(--transition), background var(--transition);
}

.cookie-item:hover {
    border-color: var(--accent);
}

.cookie-item--locked {
    background: var(--bg-secondary);
}

.cookie-item__head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-item__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-item__badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
}

.cookie-item__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 8px;
}

.cookie-item__meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}

.cookie-switch {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.cookie-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-switch__track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    transition: background var(--transition);
}

.cookie-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform var(--transition);
}

.cookie-switch input:checked + .cookie-switch__track {
    background: var(--accent);
}

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

.cookie-switch input:disabled + .cookie-switch__track {
    opacity: .55;
    cursor: not-allowed;
}

.cookie-switch input:focus-visible + .cookie-switch__track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.cookie-modal--anim .cookie-switch__track {
    transition: background .6s ease;
}

.cookie-modal--anim .cookie-modal__footer {
    opacity: .5;
    pointer-events: none;
}

.cookie-modal__footer .cookie-btn--link {
    margin-right: auto;
}