/* ================================================================
   eSIM Travel — дизайн-система 2026
   Светлая/тёмная тема, mobile-first. Старые классы (glass-card,
   btn-gradient, offer-card…) сохранены и переоформлены.
   ================================================================ */

:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --surface-2: #f0f2f8;
    --border: #e4e7ef;
    --text: #0e1525;
    --muted: #5d6679;
    --accent: #4f46e5;
    --accent-2: #7c3aed;
    --accent-soft: #eef0ff;
    --accent-text: #3f37c9;
    --success: #0f9d58;
    --success-soft: #e6f6ee;
    --warn-soft: #fff4e0;
    --shadow-sm: 0 1px 2px rgba(14, 21, 37, .05), 0 1px 3px rgba(14, 21, 37, .06);
    --shadow: 0 4px 20px rgba(14, 21, 37, .07);
    --shadow-lg: 0 18px 50px rgba(14, 21, 37, .12);
    --radius: 18px;
    --radius-sm: 12px;
    --header-h: 64px;
    --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --hero-grad: radial-gradient(1200px 500px at 85% -10%, rgba(124, 58, 237, .14), transparent 60%),
                 radial-gradient(900px 500px at -10% 10%, rgba(79, 70, 229, .12), transparent 60%);

    /* алиасы для старых шаблонов */
    --glass-bg: var(--surface-2);
    --glass-border: var(--border);
    --card-bg: var(--surface);
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --shadow-color: rgba(14, 21, 37, .08);
    --btn-font-size: 1rem;
    --title-size: 1.15rem;
    --flag-size: 2.4rem;
    --card-padding: 24px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0b0f1a;
    --surface: #131a2a;
    --surface-2: #1a2236;
    --border: #252f47;
    --text: #e9edf6;
    --muted: #9aa4ba;
    --accent: #8b8cff;
    --accent-2: #a78bfa;
    --accent-soft: #1f2347;
    --accent-text: #b4b5ff;
    --success: #34d399;
    --success-soft: #0f2a22;
    --warn-soft: #2b2312;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .5);
    --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --hero-grad: radial-gradient(1200px 500px at 85% -10%, rgba(139, 92, 246, .18), transparent 60%),
                 radial-gradient(900px 500px at -10% 10%, rgba(99, 102, 241, .16), transparent 60%);
    --shadow-color: rgba(0, 0, 0, .4);
    color-scheme: dark;
}

/* ----------------------------------------------------------------
   БАЗА
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 8px; }

.container { max-width: 1200px; padding-left: 16px; padding-right: 16px; }
.muted { color: var(--muted); }
.text-muted { color: var(--muted) !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bootstrap-компоненты под тему */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text); border-color: var(--border); }
.form-control, .form-select { background-color: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 12px 14px; }
.form-control:focus, .form-select:focus { background-color: var(--surface); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.alert { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); --bs-breadcrumb-item-active-color: var(--muted); }
.dropdown-menu { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); }
.dropdown-item { color: var(--text); border-radius: 8px; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }

/* ----------------------------------------------------------------
   ФЛАГИ
   ---------------------------------------------------------------- */
.flag {
    width: 40px; height: 40px; flex: 0 0 40px;
    border-radius: 50%;
    background-size: cover; background-position: center;
    box-shadow: 0 0 0 1px var(--border), var(--shadow-sm);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px; background-color: var(--surface-2);
}
.flag.fi { width: 40px; line-height: 40px; }
.flag-lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 34px; }
.flag-sm { width: 24px; height: 24px; flex-basis: 24px; font-size: 14px; }

/* ----------------------------------------------------------------
   ШАПКА
   ---------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 1030;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.logo:hover { color: var(--text); }
.logo-mark {
    width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
    display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav > a, .nav-drop > button {
    color: var(--text); font-weight: 550; font-size: .95rem; padding: 8px 12px; border-radius: 10px;
    background: none; border: 0; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.main-nav > a:hover, .nav-drop > button:hover, .main-nav > a.active { background: var(--surface-2); color: var(--text); }
.nav-drop { position: relative; }
.nav-drop-panel {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px);
    width: 520px; padding: 14px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transition: .18s ease;
}
.nav-drop:hover .nav-drop-panel, .nav-drop:focus-within .nav-drop-panel { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-drop-panel .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.nav-drop-panel a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: .93rem; font-weight: 500; }
.nav-drop-panel a:hover { background: var(--surface-2); }
.nav-drop-panel .all { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 10px; display: flex; justify-content: space-between; }
.nav-drop-panel .all a { color: var(--accent); font-weight: 650; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.05rem; transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.burger { display: none; }

/* мобильное меню */
.mobile-menu {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 1029;
    background: var(--bg); padding: 16px 16px 100px; overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s ease;
}
.mobile-menu.open { transform: none; opacity: 1; visibility: visible; }
.mobile-menu .m-links a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; font-size: 1.05rem; font-weight: 600; color: var(--text); border-bottom: 1px solid var(--border); }
.mobile-menu .m-links i { color: var(--accent); width: 22px; }
.mobile-menu h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
.chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

/* нижняя навигация (мобильные) */
.bottom-nav { display: none; }

@media (max-width: 991.98px) {
    .main-nav { display: none; }
    .burger { display: inline-flex; }
    .header-actions { margin-left: auto; }
}
@media (max-width: 767.98px) {
    :root { --header-h: 58px; }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .bottom-nav {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1031;
        height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
    }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--muted); }
    .bottom-nav a i { font-size: 1.25rem; }
    .bottom-nav a.active { color: var(--accent); }
    .header-cta { display: none !important; }
}

/* ----------------------------------------------------------------
   КНОПКИ
   ---------------------------------------------------------------- */
.btn-primary-x, .btn-gradient {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--grad); color: #fff !important; border: 0; border-radius: 12px;
    padding: 12px 22px; font-weight: 650; font-size: .98rem; line-height: 1.2; cursor: pointer;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s;
    text-decoration: none; white-space: nowrap;
}
.btn-primary-x:hover, .btn-gradient:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent); color: #fff; }
.btn-primary-x:active, .btn-gradient:active { transform: none; }
.btn-ghost, .btn-glass {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--surface); color: var(--text) !important; border: 1px solid var(--border);
    border-radius: 12px; padding: 11px 20px; font-weight: 600; font-size: .95rem; cursor: pointer; transition: .15s; text-decoration: none;
}
.btn-ghost:hover, .btn-glass:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.btn-success-glass { display: inline-flex; align-items: center; gap: 8px; background: var(--success); color: #fff !important; border: 0; border-radius: 12px; padding: 12px 22px; font-weight: 650; }
.btn-lg-x { padding: 15px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------
   КАРТОЧКИ
   ---------------------------------------------------------------- */
.card-x, .glass-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-sm); color: var(--text); position: relative;
}
.glass-card .card-glow, .card-glow { display: none; }
@media (max-width: 575.98px) { .card-x, .glass-card { padding: 18px; border-radius: 16px; } }

/* ----------------------------------------------------------------
   СЕКЦИИ
   ---------------------------------------------------------------- */
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); margin: 0; }
.section-head p { color: var(--muted); margin: 6px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 767.98px) { .section { padding: 36px 0; } }

/* ----------------------------------------------------------------
   HERO
   ---------------------------------------------------------------- */
.hero { background: var(--hero-grad); padding: 64px 0 40px; position: relative; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -.035em; margin: 14px 0 14px; max-width: 820px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead-x { font-size: clamp(1.02rem, 1.8vw, 1.2rem); color: var(--muted); max-width: 640px; margin-bottom: 26px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: .85rem; font-weight: 600; color: var(--text); box-shadow: var(--shadow-sm); }
.hero-badge b { background: var(--success-soft); color: var(--success); padding: 2px 8px; border-radius: 99px; font-size: .75rem; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stats span { color: var(--muted); font-size: .88rem; }
@media (max-width: 767.98px) { .hero { padding: 32px 0 24px; } .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .hero-stats strong { font-size: 1.2rem; } }

/* поиск */
.search-box { position: relative; max-width: 640px; }
.search-box .field {
    display: flex; align-items: center; gap: 10px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; padding: 8px 8px 8px 18px;
    box-shadow: var(--shadow); transition: .15s;
}
.search-box .field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent), var(--shadow); }
.search-box .field i { color: var(--muted); font-size: 1.1rem; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1.05rem; padding: 10px 0; min-width: 0; }
.search-box input::placeholder { color: var(--muted); }
.search-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 50;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
    padding: 6px; max-height: 360px; overflow-y: auto; display: none;
}
.search-results.open { display: block; }
.search-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 550; }
.search-results a:hover, .search-results a.hl { background: var(--surface-2); }
.search-results a .price { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .9rem; }
.search-results .empty { padding: 14px; color: var(--muted); }
.quick-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.quick-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .88rem; font-weight: 550; }
.quick-chips a:hover { border-color: var(--accent); }
.quick-chips .flag { width: 22px; height: 22px; flex-basis: 22px; font-size: 13px; }

/* ----------------------------------------------------------------
   СЕТКИ СТРАН
   ---------------------------------------------------------------- */
.dest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dest-card {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    color: var(--text); transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.dest-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); color: var(--text); }
.dest-card .meta { min-width: 0; flex: 1; }
.dest-card .name { font-weight: 650; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-card .sub { color: var(--muted); font-size: .85rem; }
.dest-card .sub b { color: var(--text); font-weight: 650; }
.dest-card .go { color: var(--muted); transition: .15s; }
.dest-card:hover .go { color: var(--accent); transform: translateX(2px); }
@media (max-width: 575.98px) {
    .dest-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dest-card { padding: 12px; gap: 10px; border-radius: 14px; }
    .dest-card .flag { width: 32px; height: 32px; flex-basis: 32px; font-size: 18px; }
    .dest-card .name { font-size: .92rem; }
    .dest-card .sub { font-size: .78rem; }
    .dest-card .go { display: none; }
}

/* компактный список (все страны) */
.dest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 16px; }
.dest-list a { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; color: var(--text); font-size: .95rem; }
.dest-list a:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.dest-list a .p { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
@media (max-width: 575.98px) { .dest-list { grid-template-columns: 1fr; } }

/* табы */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 18px; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: 0 0 auto; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); font-weight: 600; font-size: .9rem; cursor: pointer; transition: .15s; white-space: nowrap;
}
.tab:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab .n { opacity: .6; font-weight: 500; margin-left: 4px; }
.tab-panel[hidden] { display: none; }

/* ----------------------------------------------------------------
   ФИЧИ / ШАГИ
   ---------------------------------------------------------------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 12px; }
.feature h3 { font-size: 1.05rem; margin: 0 0 6px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }
@media (max-width: 991.98px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .features { gap: 10px; } .feature { padding: 16px; } .feature p { font-size: .85rem; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before { counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.step h3 { font-size: 1.05rem; margin: 0 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: .93rem; }
@media (max-width: 767.98px) { .steps { grid-template-columns: 1fr; gap: 10px; } .step { display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; padding: 16px; } .step::before { grid-row: span 2; margin: 0; } }

/* ----------------------------------------------------------------
   СТРАНИЦА СТРАНЫ
   ---------------------------------------------------------------- */
.page-hero { background: var(--hero-grad); padding: 28px 0 30px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 14px; padding: 0; list-style: none; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs li + li::before { content: '›'; margin-right: 6px; opacity: .6; }
.page-hero .title-row { display: flex; align-items: center; gap: 16px; }
.page-hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; margin: 0; }
.page-hero .sub { color: var(--muted); margin: 10px 0 0; font-size: 1.05rem; max-width: 760px; }
.fact-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.fact { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; font-size: .9rem; font-weight: 550; }
.fact i { color: var(--accent); }
.fact b { font-weight: 750; }
@media (max-width: 575.98px) {
    .page-hero { padding: 18px 0 22px; }
    .page-hero .title-row { gap: 12px; }
    .page-hero .flag-lg { width: 48px; height: 48px; flex-basis: 48px; font-size: 26px; }
    .fact { font-size: .82rem; padding: 6px 10px; }
}

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.sticky-aside { position: sticky; top: calc(var(--header-h) + 16px); }
.layout-2 > * { min-width: 0; }
@media (max-width: 991.98px) { .layout-2 { grid-template-columns: minmax(0, 1fr); } .sticky-aside { position: static; } }

/* фильтры тарифов */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin-bottom: 14px; }
.filters::-webkit-scrollbar { display: none; }
.filters .tab { font-size: .88rem; padding: 7px 14px; }
.sort-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.sort-row select { width: auto; padding: 6px 30px 6px 10px; font-size: .9rem; border-radius: 10px; }

.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan {
    display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 18px; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative;
}
.plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--text); }
.plan .vol { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.plan .vol small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan .dur { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.plan .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 14px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 650; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tag.t-5g { background: var(--accent-soft); color: var(--accent-text); }
.tag.t-unl { background: var(--success-soft); color: var(--success); }
.plan .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan .price { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.plan .price small { font-size: .8rem; color: var(--muted); font-weight: 600; }
.plan .buy { padding: 8px 14px; font-size: .88rem; border-radius: 10px; box-shadow: none; }
.plan.best::after { content: 'Выгодно'; position: absolute; top: -9px; right: 14px; font-size: .7rem; font-weight: 750; background: var(--success); color: #fff; padding: 2px 8px; border-radius: 99px; }
.plans-more { margin-top: 16px; text-align: center; }
@media (max-width: 575.98px) {
    .plans { grid-template-columns: 1fr 1fr; gap: 8px; }
    .plan { padding: 14px; border-radius: 14px; }
    .plan .vol { font-size: 1.3rem; }
    .plan .dur { font-size: .82rem; }
    .plan .tags { margin: 8px 0 10px; }
    .plan .foot { flex-direction: column; align-items: stretch; }
    .plan .price { font-size: 1.1rem; }
    .plan .buy { width: 100%; }
}

/* таблица цен */
.price-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
.price-table th, .price-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.price-table th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.price-table tr:last-child td { border-bottom: 0; }
.price-table td.r { text-align: right; font-weight: 750; white-space: nowrap; }
.price-table a { color: var(--text); font-weight: 600; }
.price-table a:hover { color: var(--accent); }
@media (max-width: 575.98px) { .price-table th, .price-table td { padding: 10px 8px; font-size: .88rem; } }

/* текст статьи */
.prose { color: var(--text); font-size: 1.02rem; line-height: 1.75; }
.prose p { margin: 0 0 14px; color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
.prose h2 { font-size: 1.4rem; margin: 30px 0 12px; }
.prose h3 { font-size: 1.12rem; margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose code { background: var(--surface-2); color: var(--accent-text); padding: 2px 6px; border-radius: 6px; }
.note { display: flex; gap: 12px; background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; font-size: .95rem; color: var(--text); }
.note i { color: var(--accent); font-size: 1.2rem; }
.note.ok { background: var(--success-soft); }
.note.ok i { color: var(--success); }

/* FAQ */
.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 650; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--muted); transition: .2s; }
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--accent); }
.faq-item .a { padding: 0 18px 16px; color: var(--muted); }

/* sidebar покупки */
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.side-card h2, .side-card h3 { font-size: 1.05rem; margin: 0 0 12px; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; font-size: .93rem; }
.checklist i { color: var(--success); }

/* ----------------------------------------------------------------
   СТРАНИЦА ТАРИФА
   ---------------------------------------------------------------- */
.offer-head { display: flex; gap: 16px; align-items: center; }
.offer-big { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.spec { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.spec span { display: block; color: var(--muted); font-size: .8rem; }
.spec b { font-size: 1rem; }
.buy-bar { display: none; }
@media (max-width: 991.98px) {
    .buy-bar {
        display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1032;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px rgba(0,0,0,.08);
    }
    .buy-bar .p { font-size: 1.25rem; font-weight: 800; }
    .buy-bar .btn-primary-x { flex: 1; }
}

/* ----------------------------------------------------------------
   БАННЕРЫ (партнёрские)
   ---------------------------------------------------------------- */
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.promo {
    position: relative; overflow: hidden; border-radius: 16px; aspect-ratio: 2.2 / 1; display: flex; align-items: flex-end;
    color: #fff; box-shadow: var(--shadow-sm); isolation: isolate;
}
.promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .4s ease; }
.promo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 20%, rgba(0,0,0,.65) 100%); z-index: -1; }
.promo:hover img { transform: scale(1.04); }
.promo .txt { padding: 14px 16px; }
.promo .t { font-weight: 750; font-size: 1rem; line-height: 1.25; color: #fff; }
.promo .d { font-size: .82rem; opacity: .85; color: #fff; }
.promo .ad { position: absolute; top: 10px; right: 10px; font-size: .65rem; background: rgba(0,0,0,.45); color: #fff; padding: 2px 6px; border-radius: 6px; }
@media (max-width: 767.98px) {
    .promo-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
    .promo-grid::-webkit-scrollbar { display: none; }
    .promo { scroll-snap-align: start; }
}

/* ----------------------------------------------------------------
   НОВОСТИ (тизеры)
   ---------------------------------------------------------------- */
.news-teasers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.news-teaser { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: .15s; }
.news-teaser:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.news-teaser img { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: var(--surface-2); }
.news-teaser .b { padding: 16px; }
.news-teaser .c { font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.news-teaser h3 { font-size: 1rem; margin: 6px 0 0; line-height: 1.35; }
@media (max-width: 767.98px) { .news-teasers { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------
   ФУТЕР
   ---------------------------------------------------------------- */
.site-footer, .footer-glass { background: var(--surface); border-top: 1px solid var(--border); padding: 48px 0 28px; margin-top: 40px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent); }
.site-footer .about { color: var(--muted); margin: 12px 0; max-width: 320px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.pay-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-badges span { border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; font-size: .78rem; font-weight: 600; color: var(--muted); }
@media (max-width: 991.98px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 575.98px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; } .footer-grid > div:first-child { grid-column: 1 / -1; } .site-footer { padding-top: 32px; } }

/* ----------------------------------------------------------------
   СОВМЕСТИМОСТЬ: старые классы
   ---------------------------------------------------------------- */
.offer-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; height: 100%; }
.offer-card .offer-title { font-weight: 700; }
.offer-card .offer-desc { color: var(--muted); font-size: .9rem; }
.offer-price { font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; color: var(--text); }
.badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-size: .82rem; font-weight: 650; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.badge-pending { background: var(--warn-soft); color: #b26a00; border-color: transparent; }
.badge-paid, .badge-fulfilled { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-failed, .badge-canceled { background: #fdecec; color: #c62828; border-color: transparent; }
[data-theme="dark"] .badge-pending { color: #f5b74e; }
[data-theme="dark"] .badge-failed, [data-theme="dark"] .badge-canceled { background: #3a1717; color: #ff8a80; }
.pulse-glow { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.animate-in { animation: fadeUp .4s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* flash */
.flash-wrap { position: fixed; top: calc(var(--header-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 1040; width: min(560px, calc(100% - 32px)); display: grid; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); animation: fadeUp .25s ease both; }
.flash.success { border-left-color: var(--success); }
.flash.danger { border-left-color: #e53935; }
.flash.warning { border-left-color: #f59e0b; }
.flash button { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

/* Заголовки на градиентных плашках старых шаблонов (новости, промо) */
.article-hero h1, .article-hero h2, .news-hero h1, .news-hero h2,
.esim-promo-block h2, .esim-promo-block h3, .esim-in-article h3, .esim-in-article h4,
.country-hero h2 { color: #fff; }

/* ----------------------------------------------------------------
   ШИРОКИЕ ЭКРАНЫ + независимость базовой сетки от Bootstrap
   ---------------------------------------------------------------- */
.container { width: 100%; margin-left: auto; margin-right: auto; }
.d-block { display: block; }
@media (min-width: 1400px) { .container { max-width: 1320px; } }
@media (min-width: 1700px) { .container { max-width: 1440px; } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
.hero-visual { position: relative; padding: 44px 24px 56px 48px; }
@media (max-width: 991.98px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { display: none; } }

.hv-card {
    position: relative; border-radius: 28px; padding: 26px; max-width: 460px; margin-left: auto;
    background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); overflow: hidden;
}
.hv-card::before { content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%; background: rgba(255,255,255,.1); right: -120px; top: -140px; }
.hv-card::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.07); left: -80px; bottom: -110px; }
.hv-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.hv-top .st { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: .9rem; background: rgba(255,255,255,.18); padding: 6px 12px; border-radius: 99px; }
.hv-top .st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.25); }
.hv-top i { font-size: 1.6rem; opacity: .9; }
.hv-country { display: flex; align-items: center; gap: 14px; margin-top: 26px; position: relative; z-index: 1; }
.hv-country .flag { width: 52px; height: 52px; flex-basis: 52px; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.hv-country b { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.hv-country span { opacity: .85; font-size: .9rem; }
.hv-usage { margin-top: 26px; position: relative; z-index: 1; }
.hv-usage .row-x { display: flex; justify-content: space-between; font-size: .88rem; opacity: .9; margin-bottom: 8px; }
.hv-bar { height: 10px; background: rgba(255,255,255,.22); border-radius: 99px; overflow: hidden; }
.hv-bar span { display: block; height: 100%; width: 64%; background: #fff; border-radius: 99px; }
.hv-list { margin-top: 24px; display: grid; gap: 8px; position: relative; z-index: 1; }
.hv-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; transition: background .15s; }
.hv-list a:hover { background: rgba(255,255,255,.24); color: #fff; }
.hv-list .flag { width: 28px; height: 28px; flex-basis: 28px; }
.hv-list .p { margin-left: auto; font-weight: 750; }
.hv-chip {
    position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 10px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px;
    padding: 10px 14px; box-shadow: var(--shadow-lg); font-weight: 650; font-size: .9rem;
}
.hv-chip i { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.hv-chip small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.hv-chip.c1 { left: 0; bottom: 8px; }
.hv-chip.c1 i { background: var(--success-soft); color: var(--success); }
.hv-chip.c2 { right: 0; top: 0; }
@media (min-width: 992px) and (max-width: 1199.98px) { .hv-chip { display: none; } .hero-visual { padding: 0; } }
.hv-chip.c2 i { background: var(--accent-soft); color: var(--accent); }

/* ===== Переключатель языка ===== */
.lang-switch {
    height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border);
    display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem;
    color: var(--text); background: var(--surface); text-decoration: none; white-space: nowrap;
}
.lang-switch:hover { color: var(--text); border-color: var(--muted); }

/* ===== Выбор срока и способа оплаты ===== */
.days-picker { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.days-picker input { max-width: 110px; text-align: center; font-weight: 700; }
.days-picker button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.2rem; font-weight: 700; }
.days-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.days-chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; }
.days-chips button.on { border-color: var(--accent); color: var(--accent); }
.pay-methods { display: grid; gap: 6px; margin: 4px 0 12px; }
.pay-methods label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; cursor: pointer; font-size: .92rem; }
.pay-methods input { accent-color: var(--accent); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 12px; font-weight: 600; }
.total-row b { font-size: 1.4rem; }
