/* ==========================================================================
   Cookie consent — плашка уведомления об использовании файлов cookie
   Вписана в дизайн-систему v3: бирюза #079db5 / латунь #e8a13c / OpenSans
   ========================================================================== */

.cookie-bar {
    /* токены сайта с безопасными фолбэками */
    --ck-accent: var(--v3-accent, #079db5);
    --ck-accent-deep: var(--v3-accent-deep, #056e80);
    --ck-brass: var(--v3-star, #e8a13c);
    --ck-ink: var(--v3-ink, #1c2b33);
    --ck-ink-soft: var(--v3-ink-soft, #4a5b66);
    --ck-line: var(--v3-line, #dde4e8);
    --ck-ease: var(--v3-ease, cubic-bezier(0.16, 1, 0.3, 1));

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    padding: 0 16px calc(20px + env(safe-area-inset-bottom, 0px));
    pointer-events: none; /* кликабельная только сама карточка */
    transform: translateY(calc(100% + 48px));
    opacity: 0;
    transition:
        transform 0.65s var(--ck-ease),
        opacity 0.4s ease;
    will-change: transform, opacity;
}

.cookie-bar.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.cookie-bar .shell {
    margin: 0 auto;
    max-width: 1270px;
    width: 100%;
}

/* --- карточка ------------------------------------------------------------ */

.cookie-card {
    pointer-events: auto;
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 32px;
    overflow: hidden;
    padding: 22px 28px 22px 0;
    border: 1px solid var(--ck-line);
    border-radius: 14px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(7, 157, 181, 0.06), transparent 55%),
        linear-gradient(160deg, #ffffff 55%, #f5fafb 100%);
    box-shadow:
        0 1px 2px rgba(28, 43, 51, 0.06),
        0 24px 64px -24px rgba(5, 110, 128, 0.38);
}

/* --- вертикальная рейка «Cookie» ----------------------------------------- */

.cookie-rail {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-height: 96px;
    margin-right: 24px;
    border-radius: 13px 0 0 13px;
    background:
        radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1.4px) 0 0 / 10px 10px,
        linear-gradient(180deg, var(--ck-accent) 0%, var(--ck-accent-deep) 100%);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.08);
}

.cookie-rail-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: #ffedd0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    user-select: none;
}

/* --- типографика ---------------------------------------------------------- */

.cookie-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #a8700d; /* глубокая латунь: контрастно на белом */
}

.cookie-eyebrow::before {
    content: "";
    flex: none;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ck-brass), #d18a24);
}

.cookie-title {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ck-ink);
}

.cookie-text {
    margin: 0;
    max-width: 68ch;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ck-ink-soft);
}

.cookie-text a {
    color: var(--ck-accent-deep);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(7, 157, 181, 0.35);
    text-underline-offset: 3px;
    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

.cookie-text a:hover {
    color: var(--ck-accent);
    text-decoration-color: currentColor;
}

/* --- латунная кнопка ------------------------------------------------------ */

.cookie-actions {
    display: flex;
    align-items: center;
}

.btn-brass {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    color: #2e1c05;
    background: linear-gradient(180deg, #f3b45a 0%, var(--ck-brass) 46%, #d8912a 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(146, 84, 7, 0.25),
        0 1px 2px rgba(28, 43, 51, 0.18),
        0 10px 24px -10px rgba(216, 145, 42, 0.65);
    transition:
        transform 0.25s var(--ck-ease),
        box-shadow 0.25s var(--ck-ease),
        filter 0.2s ease;
}

.btn-brass:hover {
    transform: translateY(-1px);
    filter: saturate(1.06) brightness(1.02);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(146, 84, 7, 0.25),
        0 2px 4px rgba(28, 43, 51, 0.16),
        0 14px 30px -10px rgba(216, 145, 42, 0.75);
}

.btn-brass:active {
    transform: translateY(0);
    filter: brightness(0.98);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 2px 4px rgba(146, 84, 7, 0.28),
        0 1px 2px rgba(28, 43, 51, 0.16);
}

.btn-brass:focus-visible {
    outline: 2px solid var(--ck-accent-deep);
    outline-offset: 2px;
}

.btn-sm-pad {
    padding: 12px 26px;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.01em;
}

/* --- каскадное появление элементов ---------------------------------------- */

.cookie-rail,
.cookie-body,
.cookie-actions {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.5s ease,
        transform 0.6s var(--ck-ease);
}

.is-visible .cookie-rail {
    transition-delay: 0.05s;
}

.is-visible .cookie-body {
    transition-delay: 0.12s;
}

.is-visible .cookie-actions {
    transition-delay: 0.2s;
}

.is-visible .cookie-rail,
.is-visible .cookie-body,
.is-visible .cookie-actions {
    opacity: 1;
    transform: none;
}

/* --- мобильная версия ------------------------------------------------------ */

@media (max-width: 860px) {
    .cookie-bar {
        padding: 0 12px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .cookie-card {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 20px 20px;
    }

    .cookie-rail {
        width: auto;
        min-height: 0;
        margin: 0 -20px 16px;
        padding: 9px 0;
        border-radius: 13px 13px 0 0;
        box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
    }

    .cookie-rail-text {
        writing-mode: horizontal-tb;
        transform: none;
        letter-spacing: 0.38em;
    }

    .cookie-title {
        font-size: 18px;
    }

    .cookie-text {
        font-size: 14px;
    }

    .cookie-actions {
        margin-top: 16px;
    }

    .cookie-actions .btn-brass {
        width: 100%;
    }
}

/* --- доступность и печать --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    .cookie-bar,
    .cookie-rail,
    .cookie-body,
    .cookie-actions,
    .btn-brass {
        transition: none !important;
        transform: none !important;
    }
}

@media print {
    .cookie-bar {
        display: none !important;
    }
}
