/**
 * Cookie-уведомление — тёмная тема SG (концепция Windows 11 26H2).
 *
 * Материал: плавающая Mica-панель — полупрозрачный слой #131313 + blur,
 * 1px-контур, внутренняя световая линия сверху, мягкая многослойная тень.
 * Геометрия: радиус карточек SG (--sg-radius: 12px), кнопки 8px.
 * Кнопки: primary — инверсия как у кнопок сайта (фон --sg-text, текст --sg-bg),
 * secondary — прозрачная с контуром (control stroke Fluent).
 * Focus — белое кольцо 2px с отступом 2px (Win11 focus rect на тёмном).
 * Токены — include/sotbit_origami/files/redesign.css.
 */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 9998;
    box-sizing: border-box;
    width: min(1240px, calc(100% - 40px));
    margin: 0 auto;
    padding: 18px 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--sg-radius, 12px);
    background-color: var(--sg-bg-elevated, #131313);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(rgba(19, 19, 19, 0.82), rgba(19, 19, 19, 0.82));
    -webkit-backdrop-filter: blur(32px) saturate(160%);
    backdrop-filter: blur(32px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 2px 6px rgba(0, 0, 0, 0.4),
        0 18px 48px rgba(0, 0, 0, 0.55);
    color: var(--sg-text, #fbfafa);
    font-family: 'Inter', Arial, sans-serif;
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.3s ease;
}

html[data-cookie-consent="accepted"] .cookie-banner,
html[data-cookie-consent="rejected"] .cookie-banner,
.cookie-banner--hidden {
    transform: translateY(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

.cookie-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Тема вешает на .fonts__main_comment Open Sans — внутри баннера только Inter */
.cookie-banner .cookie-banner__text,
body.sg-redesign .cookie-banner .cookie-banner__text {
    flex: 1 1 auto;
    max-width: 820px;
    margin: 0;
    color: rgba(251, 250, 250, 0.85) !important;
    font-family: 'Inter', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400;
    line-height: 1.5;
}

.cookie-banner .cookie-banner__link,
body.sg-redesign .cookie-banner .cookie-banner__link {
    color: var(--sg-text, #fbfafa) !important;
    text-decoration: underline;
    text-decoration-color: rgba(251, 250, 250, 0.45);
    text-underline-offset: 3px;
    white-space: nowrap;
    transition: text-decoration-color 0.2s ease;
}

.cookie-banner .cookie-banner__link:hover,
.cookie-banner .cookie-banner__link:focus-visible {
    text-decoration-color: currentColor;
}

.cookie-banner__actions {
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

/* Кнопки: собственные классы, вендорские .btn/.btn-primary не используются */
.cookie-banner .cookie-banner__btn {
    box-sizing: border-box;
    min-width: 132px;
    height: 40px;
    padding: 0 22px !important;
    border: 1px solid transparent;
    border-radius: 8px !important;
    background: transparent;
    font-family: 'Inter', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cookie-banner .cookie-banner__btn--accept {
    background: var(--sg-text, #fbfafa) !important;
    border-color: var(--sg-text, #fbfafa) !important;
    color: var(--sg-bg, #0a0a0a) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.cookie-banner .cookie-banner__btn--accept:hover {
    background: #ffffff !important;
    border-color: #ffffff !important;
}

.cookie-banner .cookie-banner__btn--reject {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: var(--sg-text, #fbfafa) !important;
}

.cookie-banner .cookie-banner__btn--reject:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--sg-border-hover, rgba(255, 255, 255, 0.2)) !important;
}

.cookie-banner .cookie-banner__btn:active {
    opacity: 0.85;
}

.cookie-banner .cookie-banner__btn:focus-visible {
    outline: 2px solid var(--sg-text, #fbfafa);
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .cookie-banner .cookie-banner__text {
        max-width: none;
    }

    .cookie-banner__actions {
        gap: 10px;
    }

    .cookie-banner .cookie-banner__btn {
        flex: 1 1 0;
        min-width: 0;
        height: 44px;
    }
}

@media (max-width: 767.98px) {
    .cookie-banner {
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
        padding: 16px;
    }

    .cookie-banner .cookie-banner__text {
        font-size: 13px !important;
    }

    /* Не перекрываем липкую панель оформления корзины (basket-layout.css) */
    body.sg-redesign--cart:has(.basket-checkout-section) .cookie-banner {
        bottom: calc(var(--sg-cart-bar-h, 118px) + 12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        transition: opacity 0.2s ease;
    }

    html[data-cookie-consent="accepted"] .cookie-banner,
    html[data-cookie-consent="rejected"] .cookie-banner,
    .cookie-banner--hidden {
        transform: none;
    }
}
