/* Подключаем шрифт для надписи под логотипом */
@import url('https://fonts.googleapis.com/css2?family=Graduate&display=swap');

/* ===== Палитра ===== */
:root {
    --orange: #ff9800;
    --orange-600: #e68a00;
    --text: #111;
    --muted: #f7f7f7;
    --border: #eee;
    --white: #fff;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fafafa;
    color: var(--text);
}

/* ===== Header ===== */
header {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px 24px;

    background: var(--white);
    color: var(--text);
    padding: 2.2em 1.2em 1.2em;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(17, 17, 17, .06);
}

/* Логотип и надпись под ним */
.logo-block {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

/* Адаптивный логотип */
.site-logo {
    display: block;
    height: clamp(88px, 18vw, 176px);
    width: auto;
    max-width: 92vw;
}

/* Надпись под логотипом */
.logo-text {
    font-family: 'Graduate', serif;
    font-size: clamp(1rem, 3vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
}

/* Языки — в самом верху справа */
header .lang-switch {
    position: absolute;
    top: 10px;
    right: max(12px, env(safe-area-inset-right));
    display: flex;
    gap: 8px;
}

header .lang-switch button {
    background: var(--white);
    color: var(--text);
    border: 1px solid #ffd9a1;
    padding: 6px 12px;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(17, 17, 17, .05);
    transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

header .lang-switch button:hover {
    transform: translateY(-1px);
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

header .lang-switch button.active {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

/* ===== Панель пользователя — в одну строку под логотипом, справа */
header .user-nav {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;

    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Бейдж пользователя */
header .user-nav .user-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #fff, #fff8ee);
    color: var(--text);
    border: 1px solid #ffe3b8;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(17, 17, 17, .04);
    font-weight: 600;
}

/* Кнопки аккаунта */
header .user-nav .btn-dashboard {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 14px;
    text-decoration: none;
    background: var(--orange);
    color: #fff;
    border: 1px solid var(--orange-600);
    box-shadow: 0 6px 16px rgba(255, 152, 0, .25);
    font-weight: 700;
    transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}

header .user-nav .btn-dashboard:hover {
    transform: translateY(-1px);
    background: var(--orange-600);
    box-shadow: 0 8px 20px rgba(230, 138, 0, .28);
}

/* Вторичная (например, «Выйти») */
header .user-nav .btn-dashboard.secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid #ffd9a1;
    box-shadow: 0 4px 12px rgba(17, 17, 17, .06);
}

header .user-nav .btn-dashboard.secondary:hover {
    background: #fff7e6;
}

/* ===== Мобильная адаптация ===== */
@media (max-width: 640px) {
    header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
        text-align: center;
        padding: 3.4em 12px 14px;
    }

    .site-logo {
        height: clamp(76px, 20vw, 144px);
        max-width: 96vw;
    }

    header .lang-switch {
        right: max(10px, env(safe-area-inset-right));
    }

    header .lang-switch button {
        padding: 5px 10px;
    }

    header .user-nav {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        width: 100%;
        max-width: 520px;
        justify-content: center;
        gap: 10px 12px;
    }

    header .user-nav .user-info {
        flex: 1 1 100%;
        justify-content: center;
    }

    header .user-nav .btn-dashboard {
        flex: 1 1 100%;
        width: 100%;
        text-align: center;
    }
}

/* SOS и Parking кнопки */
.action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.action-buttons a img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.action-buttons a:hover img {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}


@media (max-width: 600px) {
    .action-buttons a img {
        width: 90px;
        height: 90px;
    }
}

/*Cookies*/
#cookie-banner.visible {
    display: flex;
}

#cookie-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 17, 17, 0.85);
    /* тёмный фон */
    color: #fff;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    flex-direction: column;
    text-align: center;
    padding: 20px;
}

/* Текст баннера */
#cookie-text {
    font-size: 1rem;
    margin-bottom: 10px;
}

/* Кнопка согласия */
#cookie-btn {
    background: #ff9800;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, transform 0.1s;
}

#cookie-btn:hover {
    background: #e68a00;
    transform: translateY(-1px);
}

/* Ссылка на политику */
#cookie-link {
    color: #ff9800;
    font-weight: bold;
    text-decoration: underline;
    margin-top: 8px;
    display: inline-block;
}

#cookie-link:hover {
    color: #e68a00;
}

/* ===== ABO banner: точечная оптимизация под узкие экраны ===== */
.abo-banner {
    position: relative;
    /* если крестик внутри баннера — будет в его пределах */
}

.abo-banner h3,
.abo-banner p {
    overflow-wrap: anywhere;
    word-wrap: break-word;
    line-height: 1.35;
}

@media (max-width: 430px) {
    .abo-banner {
        padding: 16px;
        /* компактнее на iPhone шириной ~430px */
        border-radius: 12px;
    }

    .abo-banner h3 {
        margin: 0 0 10px;
        font-size: 1rem;
        padding-right: 48px;
        /* запас под ✕, если он в самом баннере */
    }

    .abo-banner ul {
        margin: 8px 0 12px 18px;
    }

    .abo-banner p {
        margin: 0;
    }
}

/* Если крестик в самом баннере */
.abo-banner .close,
.abo-banner .abo-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
}


/* ===== SweetAlert2: фикс перекрытия заголовка крестиком на iPhone ===== */

/* Базовые правки */
.swal2-popup {
    box-sizing: border-box;
}

/* Делаем «карман» справа под крестик для всего контента алерта */
.swal2-popup .swal2-html-container {
    padding-right: 3.25rem !important;
    /* резерв под .swal2-close */
    box-sizing: border-box;
}

/* Если используется .swal2-title — тоже даём запас */
.swal2-popup .swal2-title {
    padding-right: 3.25rem !important;
    box-sizing: border-box;
}

/* Сам крестик — фиксированная позиция и размер */
.swal2-popup .swal2-close {
    position: absolute !important;
    top: .5rem !important;
    right: .5rem !important;
    width: 2.2rem !important;
    height: 2.2rem !important;
    line-height: 2.2rem !important;
    border-radius: 50%;
    background: rgba(0, 0, 0, .04);
}

/* Точечная адаптация для узких экранов (iPhone ~430px) */
@media (max-width: 430px) {
    .swal2-popup {
        padding-top: 1.1rem;
        /* чуть больше воздуха сверху */
    }

    .swal2-popup .swal2-html-container,
    .swal2-popup .swal2-title {
        padding-right: 4.25rem !important;
        /* больше запас под крестик */
    }
}

/* iOS Safari: бывает авто-увеличение шрифта — увеличим запас динамически */
@supports (-webkit-touch-callout: none) {

    .swal2-popup .swal2-html-container,
    .swal2-popup .swal2-title {
        padding-right: max(4.25rem, 14vw) !important;
    }
}

/* 1) Share button: мобилка — фикс невалидного 'stretch' */
@media (max-width: 560px) {
    .share-block {
        justify-content: flex-start;
    }

    /* было: stretch (невалидно) */
    .share-block .share-btn {
        width: 100%;
    }
}

/* 2) Баннер: вернуть белый текст и защититься от градиентных/глобальных правил */
main.container .abo-banner {
    background: #004d3b !important;
    color: #fff !important;
    border-radius: 12px;
}

main.container .abo-banner h1,
main.container .abo-banner h2,
main.container .abo-banner h3,
main.container .abo-banner p,
main.container .abo-banner li,
main.container .abo-banner strong,
main.container .abo-banner span {
    color: #fff !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #fff !important;
    /* критично для Safari/Chrome */
    text-shadow: none !important;
}

/* Списки читаемее */
main.container .abo-banner ul {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: disc;
}

/* 3) Кнопка-крестик баннера (если используешь класс .close-btn) */
main.container .abo-banner .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: #fff;
    color: #000;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    font: 700 20px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    cursor: pointer;
}