/* Cookie Consent — баннер и модалка настроек для expert-expres.ru.
 * 152-ФЗ compliant: «Принять все» и «Только необходимое» — равнозначные кнопки
 * одного размера. «Настроить» — text-link под текстом.
 * Brand accent: orange-red #da532c (как в e-head/footer).
 */

.cc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(35, 25, 20, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cc-overlay.cc-visible { opacity: 1; visibility: visible; }

.cc-banner {
    position: fixed;
    left: 20px; right: 20px; bottom: 20px;
    z-index: 999999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #2d2520;
    border-radius: 16px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 20px 50px -10px rgba(60, 30, 20, 0.25),
        0 4px 12px rgba(60, 30, 20, 0.08);
    padding: 24px 28px;
    max-width: 1100px;
    margin: 0 auto;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    transform: translateY(160%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, visibility 0.3s ease;
}
.cc-banner.cc-visible { transform: translateY(0); opacity: 1; visibility: visible; }

.cc-banner__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
}
.cc-banner__icon {
    flex: 0 0 auto;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1c64a 0%, #e9a32a 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(233, 163, 42, 0.35);
    flex-shrink: 0;
}
.cc-banner__icon svg { width: 30px; height: 30px; }

.cc-banner__body { min-width: 0; }
.cc-banner__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #da532c;
    letter-spacing: -0.01em;
}
.cc-banner__text { margin: 0; color: #4a3d35; font-size: 14.5px; }
.cc-banner__text-link { margin: 6px 0 0; font-size: 13.5px; color: #6a5c52; }

.cc-link-button {
    background: none; border: 0; padding: 0; margin: 0;
    font: inherit; color: #da532c;
    text-decoration: underline; text-underline-offset: 2px;
    cursor: pointer;
}
.cc-link-button:hover { color: #a83d20; }
.cc-link-button:focus-visible { outline: 2px solid #ffb74d; outline-offset: 3px; border-radius: 2px; }

.cc-banner__buttons {
    display: flex; gap: 10px;
    flex-wrap: nowrap; align-items: stretch;
    flex-shrink: 0;
}

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 46px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    border: 1.5px solid #da532c;
    background: #fff;
    color: #da532c;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.08s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
}
.cc-btn:hover { background: #fdeee7; }
.cc-btn:active { transform: translateY(1px); }
.cc-btn:focus-visible { outline: 3px solid #ffb74d; outline-offset: 2px; }
.cc-btn--primary {
    background: linear-gradient(135deg, #ef6a3c 0%, #da532c 100%);
    color: #fff;
    border-color: #da532c;
    box-shadow: 0 4px 14px rgba(218, 83, 44, 0.35);
}
.cc-btn--primary:hover {
    background: linear-gradient(135deg, #da532c 0%, #a83d20 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(218, 83, 44, 0.45);
}

.cc-link { color: #da532c; text-decoration: underline; text-underline-offset: 2px; }
.cc-link:hover { color: #a83d20; }

.cc-modal {
    position: fixed; inset: 0;
    z-index: 1000000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.cc-modal.cc-visible { opacity: 1; visibility: visible; }
.cc-modal__inner {
    background: #fff; color: #2d2520;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(60, 30, 20, 0.4);
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cc-modal.cc-visible .cc-modal__inner { transform: translateY(0) scale(1); }

.cc-modal__header {
    padding: 24px 28px 12px;
    border-bottom: 1px solid #f4ede8;
    display: flex; align-items: center; gap: 14px;
}
.cc-modal__header-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1c64a 0%, #e9a32a 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(233, 163, 42, 0.3);
    flex-shrink: 0;
}
.cc-modal__header-icon svg { width: 22px; height: 22px; }
.cc-modal__title { margin: 0; font-size: 20px; font-weight: 700; color: #da532c; letter-spacing: -0.01em; }
.cc-modal__body { padding: 20px 28px; overflow-y: auto; flex: 1 1 auto; }
.cc-modal__intro { margin: 0 0 18px; color: #5a4a40; }
.cc-modal__legal { margin: 18px 0 0; font-size: 13px; color: #7c6a5e; }
.cc-modal__footer {
    padding: 16px 28px 24px;
    border-top: 1px solid #f4ede8;
    display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}

.cc-category { padding: 16px 0; border-bottom: 1px solid #f4ede8; }
.cc-category:last-child { border-bottom: none; }
.cc-category__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cc-category__name { font-weight: 600; font-size: 16px; color: #2d2520; cursor: pointer; }
.cc-category__desc { margin: 8px 0 0; color: #5a4a40; font-size: 14px; }

.cc-toggle {
    position: relative; display: inline-block;
    width: 48px; height: 28px; flex: 0 0 auto;
}
.cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-toggle__slider {
    position: absolute; inset: 0;
    background: #d8cfc8;
    border-radius: 28px; cursor: pointer;
    transition: background 0.25s ease;
}
.cc-toggle__slider::before {
    content: "";
    position: absolute;
    width: 22px; height: 22px;
    top: 3px; left: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.cc-toggle input:checked + .cc-toggle__slider { background: linear-gradient(135deg, #ef6a3c 0%, #da532c 100%); }
.cc-toggle input:checked + .cc-toggle__slider::before { transform: translateX(20px); }
.cc-toggle input:focus-visible + .cc-toggle__slider { outline: 3px solid #ffb74d; outline-offset: 2px; }
.cc-toggle--disabled .cc-toggle__slider { background: #bbb0a8; cursor: not-allowed; opacity: 0.7; }

@media (max-width: 860px) {
    .cc-banner__inner { grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 14px 16px; }
    .cc-banner__icon { grid-row: 1; grid-column: 1; width: 48px; height: 48px; }
    .cc-banner__icon svg { width: 26px; height: 26px; }
    .cc-banner__body { grid-row: 1; grid-column: 2; }
    .cc-banner__buttons { grid-row: 2; grid-column: 1 / -1; flex-direction: column-reverse; gap: 8px; }
    .cc-btn { width: 100%; min-width: 0; }
}

@media (max-width: 720px) {
    .cc-banner { left: 12px; right: 12px; bottom: 12px; padding: 18px 18px; font-size: 14px; border-radius: 14px; }
    .cc-banner__title { font-size: 16px; }
    .cc-banner__text { font-size: 14px; }
    .cc-modal__inner { max-height: calc(100vh - 24px); border-radius: 16px; }
    .cc-modal__header { padding: 20px 20px 10px; }
    .cc-modal__body { padding: 16px 20px; }
    .cc-modal__footer { padding: 14px 20px 20px; flex-direction: column-reverse; }
    .cc-modal__footer .cc-btn { width: 100%; }
}

@media (max-width: 380px) {
    .cc-banner { padding: 16px 14px; }
    .cc-banner__icon { width: 40px; height: 40px; }
    .cc-banner__icon svg { width: 22px; height: 22px; }
    .cc-banner__title { font-size: 15px; }
    .cc-banner__text { font-size: 13.5px; }
    .cc-banner__text-link { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .cc-banner, .cc-overlay, .cc-modal, .cc-modal__inner,
    .cc-toggle__slider, .cc-toggle__slider::before, .cc-btn {
        transition: none !important;
    }
}

/* Скрываем старый шаблон cookie-плашки (если когда-то покажется) */
.cookie[role="alert"] { display: none !important; }
