/**
 * Cookie-consent banner styles (вёрстка по образцу webmotor:
 * компактная карточка, пилюли-кнопки, полное окно с аккордеоном и тумблерами).
 * Все цвета/размеры — CSS-переменные, назначаются JS-ом (applyDesignVars).
 */

.wacc-root {
    --wacc-bg: #ffffff;
    --wacc-text: #333333;
    --wacc-accent: #0078ee;
    --wacc-accent-text: #ffffff;
    --wacc-border: #e5e7eb;
    --wacc-radius: 8px;
    --wacc-font-size: 13px;
    --wacc-padding: 16px;
    --wacc-width: 340px;
    position: static;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.45;
}

/* тёмная тема посетителя: включается data-wacc-dark="1" (JS по prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
    .wacc-root[data-wacc-dark="1"] .wacc__box {
        background: var(--wacc-dark-bg);
        color: var(--wacc-dark-text);
        border-color: var(--wacc-dark-border);
    }
    .wacc-root[data-wacc-dark="1"] .wacc__btn--accept {
        background: var(--wacc-dark-accent);
        color: var(--wacc-dark-accent-text);
    }
    .wacc-root[data-wacc-dark="1"] .wacc__btn--ghost {
        background: transparent;
        color: var(--wacc-dark-text);
        border-color: var(--wacc-dark-border);
    }
    .wacc-root[data-wacc-dark="1"] .wacc__policy { color: var(--wacc-dark-accent); }
    .wacc-root[data-wacc-dark="1"] .wacc__full-heading,
    .wacc-root[data-wacc-dark="1"] .wacc__full-subhead,
    .wacc-root[data-wacc-dark="1"] .wacc__status { color: var(--wacc-dark-text); opacity: .75; }
}

.wacc-root *, .wacc-root *::before, .wacc-root *::after { box-sizing: border-box; }

/* затемнение страницы (модальное окно) */
.wacc__overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
}

/* обёртка позиции */
.wacc {
    position: fixed;
    z-index: 100000;
    display: flex;
}

.wacc--bar-top { left: 0; right: 0; top: 0; }
.wacc--bar-bottom { left: 0; right: 0; bottom: 0; }
.wacc--card_tl, .wacc--card_tr, .wacc--card_bl, .wacc--card_br { max-width: calc(100vw - 24px); }
.wacc--card_tl { top: 16px; left: 16px; }
.wacc--card_tr { top: 16px; right: 16px; justify-content: flex-end; }
.wacc--card_bl { bottom: 16px; left: 16px; }
.wacc--card_br { bottom: 16px; right: 16px; justify-content: flex-end; }
.wacc--modal {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
}
.wacc--modal .wacc__box { pointer-events: auto; max-height: calc(100vh - 32px); overflow-y: auto; }

.wacc--bar-top, .wacc--bar-bottom { animation: wacc-slide .3s ease-out; }
.wacc--card_tl, .wacc--card_tr, .wacc--card_bl, .wacc--card_br, .wacc--modal { animation: wacc-fade .25s ease-out; }
.wacc--no-anim, .wacc--no-anim .wacc__box { animation: none !important; }

@keyframes wacc-slide {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
@keyframes wacc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* карточка */
.wacc__box {
    background: var(--wacc-bg);
    color: var(--wacc-text);
    font-size: var(--wacc-font-size);
    border: 1px solid var(--wacc-border);
    border-radius: var(--wacc-radius);
    width: var(--wacc-width);
    max-width: 100%;
    box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}
.wacc--flat .wacc__box { box-shadow: none; }
.wacc--bar-top .wacc__box, .wacc--bar-bottom .wacc__box {
    width: 100%;
    max-width: none;
}

/* --- краткая форма --- */

.wacc__short { display: block; }
.wacc__short[hidden] { display: none; }

.wacc__short-info { padding: var(--wacc-padding) var(--wacc-padding) 0; }

.wacc__title {
    display: block;
    font-weight: 600;
    font-size: 1.08em;
    margin: 0 0 4px;
    color: inherit;
}

.wacc__msg { margin: 0; font-size: .96em; opacity: .85; }
.wacc__msg:last-child { margin-bottom: 0; }
.wacc__policy { color: var(--wacc-accent); text-decoration: underline; }
.wacc__policy:hover { text-decoration: none; }

.wacc__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: calc(var(--wacc-padding) * .75) var(--wacc-padding) var(--wacc-padding);
}
.wacc__short-controls { justify-content: space-between; }

/* пилюли (по образцу webmotor) */
.wacc__btn {
    font-family: inherit;
    font-size: .96em;
    line-height: 1.2;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: opacity .15s ease, background .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.wacc__btn:hover { opacity: .88; }
.wacc__btn--accept {
    background: var(--wacc-accent);
    color: var(--wacc-accent-text);
    border-color: var(--wacc-accent);
    font-weight: 600;
}
.wacc__btn--ghost {
    background: transparent;
    color: var(--wacc-text);
    border-color: var(--wacc-border);
}
.wacc__short-controls .wacc__btn--accept { margin-right: auto; }

/* --- полное окно --- */

.wacc__full { display: block; }
.wacc__full[hidden] { display: none; }

.wacc__full-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px var(--wacc-padding);
    border-bottom: 1px solid var(--wacc-border);
}
.wacc__back {
    flex: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    cursor: pointer;
    border-radius: 50%;
}
.wacc__back:hover { background: rgba(0, 0, 0, 0.06); }
.wacc__back svg { width: 14px; height: 14px; }
.wacc__full-title { font-weight: 500; font-size: .96em; opacity: .7; }

.wacc__full-sub { padding: calc(var(--wacc-padding) * .8) var(--wacc-padding) 4px; }
.wacc__full-subhead { display: block; font-weight: 500; font-size: 1.05em; opacity: .7; margin: 0 0 2px; }
.wacc__full-note { display: block; font-size: .92em; opacity: .8; }

/* строки категорий: аккордеон + тумблер */
.wacc__switches {
    display: flex;
    flex-direction: column;
    max-height: 44vh;
    overflow-y: auto;
    padding: 4px 0;
}

.wacc__cat { display: block; }
.wacc__cat-top {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px var(--wacc-padding);
    background: transparent;
    border: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.wacc__cat-chevron {
    flex: none;
    width: 10px;
    height: 10px;
    opacity: .5;
    transition: transform .2s ease;
}
.wacc__cat.is-open .wacc__cat-chevron { transform: rotate(90deg); }
.wacc__cat-title { font-weight: 500; font-size: .96em; }

.wacc__cat-side {
    margin-left: auto;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wacc__status { font-size: .82em; opacity: .75; }
.wacc__status--always { color: var(--wacc-accent); opacity: 1; }
.wacc__status.is-on { color: var(--wacc-accent); opacity: 1; }

/* тумблер */
.wacc__toggle {
    position: relative;
    flex: none;
    width: 34px;
    height: 18px;
    margin: 0;
    border-radius: 999px;
    background: #c4c9d2;
    cursor: pointer;
    transition: background .2s ease;
    border: none;
    padding: 0;
}
.wacc__toggle::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform .2s ease;
}
.wacc__toggle.is-on { background: var(--wacc-accent); }
.wacc__toggle.is-on::after { transform: translateX(16px); }
.wacc__toggle--lock { opacity: .55; cursor: default; background: var(--wacc-accent); }

.wacc__cat-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    padding: 0 var(--wacc-padding) 0 calc(var(--wacc-padding) + 20px);
    font-size: .92em;
    opacity: .8;
}
.wacc__cat.is-open .wacc__cat-content { max-height: 220px; padding-bottom: 10px; }

/* элемент повторного открытия */
.wacc-reopen {
    position: fixed;
    z-index: 99998;
    cursor: pointer;
    border: none;
    padding: 0;
    background: none;
    font-family: inherit;
    opacity: .55;
    transition: opacity .15s ease;
}
.wacc-reopen:hover { opacity: 1; }
.wacc-reopen--btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.wacc-reopen--link {
    font-size: 13px;
    text-decoration: underline;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}
.wacc-reopen--tl { top: 12px; left: 12px; }
.wacc-reopen--tr { top: 12px; right: 12px; }
.wacc-reopen--bl { bottom: 12px; left: 12px; }
.wacc-reopen--br { bottom: 12px; right: 12px; }

/* мобильные устройства */
@media (max-width: 640px) {
    .wacc--card_tl, .wacc--card_tr, .wacc--card_bl, .wacc--card_br {
        left: 10px !important;
        right: 10px !important;
        top: auto;
        bottom: 10px;
        justify-content: stretch;
        max-width: none;
    }
    .wacc--card_tl, .wacc--card_tr { bottom: auto; top: 10px; }
    .wacc__box { width: 100% !important; max-height: calc(100vh - 24px); overflow-y: auto; }
    .wacc__btns .wacc__btn { flex: 1 1 auto; text-align: center; }
    .wacc__switches { max-height: none; }
    .wacc-reopen--tl, .wacc-reopen--tr { top: 8px; }
    .wacc-reopen--bl, .wacc-reopen--br { bottom: 8px; }
}
