/* =========================================================
   Cookie-баннер these-guys.ru
   Mobile-first: базовые стили = мобильный (<640px),
   @media (min-width: 640px) = планшет/десктоп.
   Брейкпоинт ровно 639/640px (стандартная сетка сайта).
   ========================================================= */

.cookie-banner,
.cookie-banner *,
.cookie-banner *::before,
.cookie-banner *::after {
    box-sizing: border-box;
}

/* ---------- Контейнер: мобильный (нижний лист) ---------- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    z-index: 1010;
    background: #FFFFFF;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.10);
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    animation: cookieBannerIn 350ms cubic-bezier(.34, 1.56, .64, 1) both;
}

/* ---------- Текст ---------- */
.cookie-banner__text {
    margin: 0;
    padding-right: 36px; /* место под крестик */
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.5;
    color: #1C1F24;
}

.cookie-banner__link {
    color: #0A0A0A;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity .15s ease;
}

.cookie-banner__link:hover {
    opacity: .75;
    text-decoration: underline; /* подчёркивание не убираем */
}

/* ---------- Кнопки ---------- */
.cookie-banner__buttons {
    display: flex;
    flex-direction: column; /* мобильный: столбец */
    gap: 10px;
    margin-top: 16px;
}

.cookie-banner__btn {
    flex: 0 0 auto; /* в column flex не даём высоте схлопнуться под flex-basis */
    width: 100%;
    height: 44px; /* мобильный тач-таргет >= 44px (Apple HIG / Material) */
    padding: 0 16px;
    border-radius: 12px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform .15s ease, background-color .15s ease, color .15s ease;
}

.cookie-banner__btn:focus-visible {
    outline: 3px solid #0A0A0A;
    outline-offset: 3px;
}

/* Первичная — «Хорошо, понимаю» */
.cookie-banner__btn--primary {
    background: #FFCE00;
    color: #000;
    border: none;
}

.cookie-banner__btn--primary:hover {
    background: #FED501;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 206, 0, 0.28);
}

.cookie-banner__btn--primary:active {
    transform: translateY(0);
}

/* Вторичная — «Отклонить» */
.cookie-banner__btn--secondary {
    background: #FFFFFF;
    color: #0A0A0A;
    border: 2px solid #0A0A0A;
}

.cookie-banner__btn--secondary:hover {
    background: #0A0A0A;
    color: #FFFFFF;
    transform: translateY(-1px);
}

.cookie-banner__btn--secondary:active {
    transform: translateY(0);
}

/* ---------- Крестик ---------- */
.cookie-banner__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: #292929;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease, color .15s ease;
}

.cookie-banner__close:hover,
.cookie-banner__close:focus {
    background: rgba(10, 10, 10, 0.06);
    color: #0A0A0A;
}

.cookie-banner__close:focus-visible {
    outline: 2px solid #0A0A0A;
    outline-offset: 2px;
}

.cookie-banner__close svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ---------- Закрытие ---------- */
.cookie-banner.is-closing {
    animation: cookieBannerOut 200ms ease-out both;
    pointer-events: none;
}

/* ---------- Анимации ---------- */
@keyframes cookieBannerIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes cookieBannerOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes cookieBannerIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
    .cookie-banner {
        animation: cookieBannerIn 200ms ease-out both;
    }
    .cookie-banner.is-closing {
        animation: none;
    }
    .cookie-banner__btn:hover,
    .cookie-banner__btn:active {
        transform: none;
    }
}

/* ---------- Планшет / десктоп (>= 640px) ---------- */
@media (min-width: 640px) {
    .cookie-banner {
        left: 24px;
        right: auto;
        bottom: 24px;
        width: calc(100% - 48px);
        max-width: 400px;
        border-radius: 20px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
        padding: 24px;
    }

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

    .cookie-banner__buttons {
        flex-direction: row;
        gap: 12px;
    }

    .cookie-banner__btn {
        flex: 1 1 0; /* в row flex главная ось = ширина, height задаёт высоту */
        height: 34px;
        border-radius: 11px;
    }

    .cookie-banner__close {
        top: 16px;
        right: 16px;
    }
}


/* Внутренние страницы: крестик cookie-баннера до 44px (тач-таргет).
   Главная не затрагивается (body без .internal). [cookie internal close target] */
body.internal .cookie-banner__close { width: 44px; height: 44px; }
