/* ========== Cookie banner (нижняя плашка) ========== */
.ccn-cookie-banner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 99998;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
    padding: 18px 22px;
    animation: ccnCookieSlideUp .35s ease;
    max-width: 1180px;
    margin: 0 auto;
}
@keyframes ccnCookieSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.ccn-cookie-banner[hidden] { display: none !important; }

.ccn-cookie-banner__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.ccn-cookie-banner__text { flex: 1 1 380px; min-width: 280px; }
.ccn-cookie-banner__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}
.ccn-cookie-banner__text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #475569;
}
.ccn-cookie-banner__text a { color: #14b8a6; text-decoration: underline; }

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

/* Кнопки */
.ccn-cookie-btn {
    appearance: none;
    border: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
    line-height: 1.2;
}
.ccn-cookie-btn--primary {
    background: #14b8a6;
    color: #ffffff;
}
.ccn-cookie-btn--primary:hover { background: #0d9488; }
.ccn-cookie-btn--secondary {
    background: #f1f5f9;
    color: #1e293b;
}
.ccn-cookie-btn--secondary:hover { background: #e2e8f0; }
.ccn-cookie-btn--link {
    background: transparent;
    color: #14b8a6;
    padding: 10px 14px;
    text-decoration: underline;
}
.ccn-cookie-btn--link:hover { color: #0d9488; }

/* ========== Модалка настроек ========== */
.ccn-cookie-modal[hidden] { display: none !important; }
.ccn-cookie-modal {
    position: fixed; inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ccn-cookie-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    animation: ccnCookieFade .2s ease;
}
@keyframes ccnCookieFade {
    from { opacity: 0; } to { opacity: 1; }
}
.ccn-cookie-modal__content {
    position: relative;
    background: #ffffff;
    color: #1e293b;
    border-radius: 14px;
    padding: 28px 28px 22px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .35);
    animation: ccnCookieScale .2s ease;
}
@keyframes ccnCookieScale {
    from { transform: scale(.96); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}
.ccn-cookie-modal__close {
    position: absolute;
    top: 12px; right: 14px;
    border: none; background: transparent;
    font-size: 28px; line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 4px 8px;
}
.ccn-cookie-modal__close:hover { color: #0f172a; }
.ccn-cookie-modal__title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.ccn-cookie-modal__lead {
    margin: 0 0 20px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.ccn-cookie-cat {
    padding: 14px 0;
    border-top: 1px solid #e2e8f0;
}
.ccn-cookie-cat:last-of-type { border-bottom: 1px solid #e2e8f0; }
.ccn-cookie-cat__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.ccn-cookie-cat h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.ccn-cookie-cat p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

/* Тумблер */
.ccn-cookie-toggle {
    position: relative;
    display: inline-block;
    width: 42px; height: 24px;
    flex: 0 0 auto;
    cursor: pointer;
}
.ccn-cookie-toggle input { opacity: 0; width: 0; height: 0; }
.ccn-cookie-toggle__slider {
    position: absolute; inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .2s;
}
.ccn-cookie-toggle__slider::before {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ccn-cookie-toggle input:checked + .ccn-cookie-toggle__slider {
    background: #14b8a6;
}
.ccn-cookie-toggle input:checked + .ccn-cookie-toggle__slider::before {
    transform: translateX(18px);
}
.ccn-cookie-toggle--locked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    font-size: 12px;
    color: #14b8a6;
    font-weight: 600;
    cursor: not-allowed;
}
.ccn-cookie-toggle--locked input { display: none; }

.ccn-cookie-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    flex-wrap: wrap;
}

/* Ссылка «Настройки cookie» в футере */
.ccn-cookie-settings-link {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font-size: 13px;
    opacity: .85;
}
.ccn-cookie-settings-link:hover { opacity: 1; color: #14b8a6; }

/* Тёмная тема */
[data-theme="dark"] .ccn-cookie-banner,
body.dark-theme .ccn-cookie-banner,
[data-theme="dark"] .ccn-cookie-modal__content,
body.dark-theme .ccn-cookie-modal__content {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .ccn-cookie-banner__title,
[data-theme="dark"] .ccn-cookie-modal__title,
[data-theme="dark"] .ccn-cookie-cat h3,
body.dark-theme .ccn-cookie-banner__title,
body.dark-theme .ccn-cookie-modal__title,
body.dark-theme .ccn-cookie-cat h3 { color: #f1f5f9; }
[data-theme="dark"] .ccn-cookie-banner__text p,
[data-theme="dark"] .ccn-cookie-modal__lead,
[data-theme="dark"] .ccn-cookie-cat p,
body.dark-theme .ccn-cookie-banner__text p,
body.dark-theme .ccn-cookie-modal__lead,
body.dark-theme .ccn-cookie-cat p { color: #94a3b8; }
[data-theme="dark"] .ccn-cookie-btn--secondary,
body.dark-theme .ccn-cookie-btn--secondary {
    background: #334155; color: #e2e8f0;
}
[data-theme="dark"] .ccn-cookie-btn--secondary:hover,
body.dark-theme .ccn-cookie-btn--secondary:hover { background: #475569; }
[data-theme="dark"] .ccn-cookie-cat,
body.dark-theme .ccn-cookie-cat { border-color: #334155; }

/* Мобильные */
@media (max-width: 640px) {
    .ccn-cookie-banner { padding: 16px; left: 8px; right: 8px; bottom: 8px; }
    .ccn-cookie-banner__inner { gap: 14px; }
    .ccn-cookie-banner__actions { width: 100%; }
    .ccn-cookie-btn { flex: 1 1 auto; }
    .ccn-cookie-modal__content { padding: 22px 18px 18px; }
    .ccn-cookie-modal__actions { justify-content: stretch; }
    .ccn-cookie-modal__actions .ccn-cookie-btn { flex: 1 1 auto; }
}
