/* =========================================================================
   КАТАЛОГ ЖЕТОНОВ: СТРАНИЦА ГОРОДА (city-styles.css)
   ========================================================================= */

/* ===== ОБЩИЙ КОНТЕЙНЕР ===== */
.token-page.city-archive-page {
    width: 100%;
    max-width: 1800px; /* СТРОГО как в token-styles.css */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    
    /* Синхронизировано пиксель в пиксель */
    padding-top: 20px; 
    padding-bottom: clamp(40px, 6vw, 120px);
    
    padding-left: clamp(20px, calc(20px + (120 - 20) * ((100vw - 1200px) / (1834 - 1200))), 120px);
    padding-right: clamp(20px, calc(20px + (120 - 20) * ((100vw - 1200px) / (1834 - 1200))), 120px);
}

/* ===== КАСТОМНАЯ НАВИГАЦИОННАЯ ЛИНИЯ (ХЛЕБНЫЕ КРОШКИ) ===== */
/* Полная копия .token-breadcrumbs: те же свойства, свойства line-height отсутствуют, как и в оригинале */
.city-archive-page .token-navigation-line {
    font-family: 'Bahnschrift', sans-serif;
    font-size: clamp(13px, 0.9vw, 17px); 
    font-weight: 400; 
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #a1b7ca;
    
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* РАЗРЕШАЕМ перенос блоков на новую строку */
    gap: 0;
    margin-bottom: 50px; /* СТРОГО как в token-styles.css */

}

/* Ссылки внутри навигации (СТРОГО по оригиналу) */
.city-archive-page .token-navigation-line a {
    color: #a1b7ca;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap; /* Название страны или региона больше никогда не разобьется на 2 строки */
    display: inline-block;
}

.city-archive-page .token-navigation-line a:hover {
    color: #759cb8;
}

/* Разделители (СТРОГО копия .token-breadcrumbs .separator) */
.city-archive-page .token-navigation-line .nav-arrow {
    cursor: default;
    pointer-events: none;
    font-weight: 700; 
    color: #bbb496;
    margin: 0 4px;
    display: inline-block;
    white-space: nowrap;
}

/* Возвращаем красивый отступ между текстом ссылки и стрелочкой */
.city-archive-page .token-navigation-line span a {
    margin-right: -2px; /* Если покажется мало, можешь поставить 5px или 6px */
}


/* ===== ЗАГОЛОВОК ГОРОДА ===== */
.city-archive-page .token-title {
    font-family: 'Bahnschrift', sans-serif;
    font-size: clamp(35px, 10vw, 80px);
    text-align: center;
    letter-spacing: 0.02em; 
    text-transform: uppercase;
    font-weight: 300;
    color: #b8b4a3;
    margin-top: 0;
    line-height: 1.1;
    margin-bottom: clamp(20px, 3.5vw, 50px);
    cursor: default !important;
}

/* ===== СЕТКА ЖЕТОНОВ ===== */
.city-archive-page .tokens-museum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 256px); 
    grid-column-gap: 4px; 
    grid-row-gap: 4px;    
    margin: 0 auto;
    margin-bottom: clamp(35px, 5vw, 60px); 
    
    width: 100%;
    max-width: 1560px; 
    justify-content: center;
}

/* ===== ПЛИТКА ЖЕТОНА ===== */
.city-archive-page .token-grid-card {
    width: 256px; 
    height: 256px; 
    text-decoration: none;
    display: block;
    box-sizing: border-box;
    container-type: inline-size; 
}

.city-archive-page .token-grid-card .token-card-image-box {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.21);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Изображения внутри плитки (Аверс / Реверс) */
.city-archive-page .token-grid-card .token-card-image-box img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important; 
    box-sizing: border-box !important;
    object-fit: cover !important; 
    display: block !important;
    transition: opacity 0.25s ease-in-out !important;
}

.city-archive-page .token-grid-card .token-card-image-box .img-avers {
    opacity: 1 !important;
    z-index: 1 !important; 
}

.city-archive-page .token-grid-card .token-card-image-box .img-revers {
    opacity: 0 !important;
    z-index: 2 !important; 
}

.city-archive-page .token-grid-card:hover .token-card-image-box .img-avers {
    opacity: 1 !important;
}

.city-archive-page .token-grid-card:hover .token-card-image-box .img-revers {
    opacity: 1 !important;
}

/* ===== ГОД ПРИ НАВЕДЕНИИ ===== */
.city-archive-page .token-grid-card .token-card-year {
    position: absolute;
    bottom: 8px; 
    left: 50%;
    transform: translateX(-50%); 
    font-family: 'Bahnschrift', sans-serif;
    font-size: 7.8cqw; 
    font-weight: 100;         
    color: #b8b4a3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 3;
    opacity: 0; 
    transition: opacity 0.2s ease;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
}

.city-archive-page .token-grid-card:hover .token-card-year {
    opacity: 1;
}

/* На тач-устройствах подсказка остаётся видимой всё удержание плитки,
   даже когда Chrome отменяет hover из-за начала прокрутки. */
.city-archive-page .token-grid-card.token-tile.touch-pressed .token-card-year {
    opacity: 1 !important;
}

.city-archive-page .token-grid-card.token-tile.touch-released .token-card-year {
    opacity: 0 !important;
}

/* Сообщение, если коллекция пуста */
.city-archive-page .no-tokens-msg {
    font-family: 'Bahnschrift', sans-serif;
    color: #9f978a;
    font-size: 18px;
    text-align: center;
    margin-top: 50px;
}

/* ===== НИЖНИЙ БЛОК ДРУГИХ ГОРОДОВ ===== */
.city-archive-page .city-archive-separator {
    border: none;
    height: clamp(1px, 0.2vw, 4px); 
    background: #202c3c; 
    
    margin-top: clamp(30px, 6vw, 100px); 
    /* ИСПРАВЛЕНО: Уменьшили расстояние между полоской и городами */
    margin-bottom: clamp(8px, 1.5vw, 20px); 
    margin-left: auto;
    margin-right: auto;
    
    /* ИСПРАВЛЕНО: Уменьшили ширину полоски примерно на 15% (было 80%, стало 68%) */
    width: 68%; 
    display: block;
}

.city-archive-page .other-cities-bar {
    text-align: center;
    font-family: 'Bahnschrift', sans-serif;
    font-size: calc(clamp(13px, 0.9vw, 17px) * 1.5); 
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 0; 
    line-height: 1.5;
}

.city-archive-page .other-city-link {
    color: #a1b7ca;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
}

.city-archive-page .other-city-link:hover {
    color: #759cb8;
}

/* Разделители городов */
.city-archive-page .other-cities-bar .separator {
    /* ИСПРАВЛЕНО: Динамический марджин по бокам от 5px на больших до ~3px на мелких */
    margin: 0 clamp(3px, 0.4vw, 5px); 
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.city-archive-page .other-cities-bar .separator::before {
    content: "";
    display: block;
    /* ИСПРАВЛЕНО: Размер кружочка адаптивный от 7px до 4px */
    width: clamp(4px, 0.5vw, 7px);
    height: clamp(4px, 0.5vw, 7px);
    background-color: #b8b4a3;
    /* Радиус скругления делаем большим, чтобы круг оставался кругом при любом размере */
    border-radius: 50%; 
}


/* ===== АДАПТИВНОСТЬ ===== */

/* 1. ЭТАП ДИНАМИЧЕСКОГО УМЕНЬШЕНИЯ ДЛЯ 3-Х КОЛОНОК */
@media (max-width: 815px) {
    .city-archive-page .tokens-museum-grid {
        grid-template-columns: repeat(3, 1fr); 
        grid-column-gap: 4px;
        grid-row-gap: 4px;
        max-width: 100%;
    }
    
    .city-archive-page .token-grid-card {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
    
    .city-archive-page .token-navigation-line {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* 2. МОБИЛЬНЫЙ ПОРОГ (550px и меньше) */
@media (max-width: 550px) {
    .token-page.city-archive-page {
        padding-left: clamp(4px, 1.8vw, 15px); 
        padding-right: clamp(4px, 1.8vw, 15px);
    }

    .city-archive-page .tokens-museum-grid {
        grid-template-columns: repeat(2, 1fr); 
        grid-column-gap: clamp(1px, calc(1px + (4 - 1) * ((100vw - 320px) / (550 - 320))), 4px);
        grid-row-gap: clamp(1px, calc(1px + (4 - 1) * ((100vw - 320px) / (550 - 320))), 4px);
    }
    
    .city-archive-page .token-grid-card {
        border-radius: 10px;
    }
    
    .city-archive-page .token-grid-card .token-card-image-box {
        border-radius: 10px;
    }
    
    .city-archive-page .token-grid-card .token-card-image-box img {
        border-radius: 10px;
    }

    .city-archive-page .token-grid-card .token-card-year {
        bottom: 6px;
    }
    
    .city-archive-page .token-navigation-line {
        margin-bottom: 25px;
    }
    
    .city-archive-page .token-title {
        margin-bottom: 20px; 
    }
    
    .city-archive-page .other-cities-bar {
        font-size: calc(clamp(13px, 0.9vw, 17px) * 1.1);
    }
    
    .city-archive-page .other-cities-bar .separator {
        margin: 0 10px;
    }
}

/* =========================================================================
   ИСКОРКА "НОВЫЙ ЭКЗЕМПЛЯР" (ОБНОВЛЕННЫЙ ДИЗАЙН)
   ========================================================================= */

.token-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    cursor: pointer;
    color: #fbe25f; /* Новый цвет */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.sparkle-icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 3px rgba(0,0,0,0.5));
}

.badge-tooltip {
    position: absolute;
    top: 35px;
    right: 0;
    width: 170px;
    background: rgba(16, 15, 11, 0.768);
    color: #d6c050;
    padding: 3px 3px; /* Меньше паддингов, чтобы текст был плотнее */
    font-family: 'Bahnschrift', sans-serif;
    font-size: 13px; /* Шрифт чуть крупнее */
    line-height: 1.2;
    text-transform: uppercase;
    text-align: center;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.badge-tooltip span {
    display: block;
    margin: 2px 0; /* Минимизируем отступы между строками */
}

/* Показываем при наведении или активности */
.token-new-badge:hover .badge-tooltip,
.token-new-badge.is-active .badge-tooltip {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.1s ease, visibility 0.1s ease;
}

@media (max-width: 550px) {
    .token-new-badge { top: 6px; right: 6px; }
    .sparkle-icon { width: 20px; height: 20px; }
    .badge-tooltip { width: 140px; right: -5px; }
}

/* Анимация флипа */
@keyframes sparkleFlip {
    0% {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    100% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

.token-new-badge {
    /* Изначально скрываем, чтобы они появлялись по анимации */
    opacity: 0;
    pointer-events: none; /* Запрещаем клики по умолчанию */
}

.token-new-badge.is-ready {
    pointer-events: auto; /* Разрешаем клики, только когда искорка готова */
}

/* Класс, который JS будет добавлять для запуска */
.token-new-badge.animate-in {
    animation: sparkleFlip 0.6s ease-out forwards;
}


/* =========================================================================
   СТРАНИЦА СТРАНЫ (ДОПОЛНЕНИЕ ДЛЯ КАТАЛОГА)
   ========================================================================= */

/* Контейнер страницы страны */
.country-archive-page {
    display: flex;
    flex-direction: column;
}

/* =========================================================================
   ИДЕАЛЬНЫЙ АДАПТИВНЫЙ ЗАГОЛОВОК СТРАНЫ (УМНОЕ СЖАТИЕ)
   ========================================================================= */

/* Контейнер страницы страны */
.country-archive-page {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Умный заголовок страны (Динамическая ширина под длину слова) */
.country-archive-page .token-title {
    font-family: 'Golos Text', 'GolosTextWebDemibold', sans-serif;
    font-weight: 600; 
    color: #b8b4a3;
    margin: -12px auto clamp(5px, 1.5vw, 10px) auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
    text-align: center;
    cursor: default !important;
    
    /* Жесткие правила против переносов строки */
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;

    /* НАСТРОЙКА ДИНАМИЧЕСКОЙ ШИРИНЫ:
       1. clamp(80vw, 72vw + (1.5vw * var(--letters)), 92vw) — вычисляет доступную ширину.
          - Для КИТАЙ (5 букв): формула даст ~79.5vw. Упрется в минималку, займет ~80% экрана.
          - Для АЗЕРБАЙДЖАН (11 букв): формула даст ~88.5vw. Выделит слову больше места по бокам!
       2. Полученный объем пространства мы делим на количество букв через calc().
       3. min(80px, ...) по-прежнему защищает десктоп от гигантизма.
    */
    font-size: min(86px, calc(clamp(85vw, 75vw + (2.5vw * var(--letters)), 98vw) / var(--letters)));
}

/* Блок со списком всех городов страны (без нижней полоски) */
.country-archive-page .other-cities-block {
    /* Сделали динамический отступ вниз до секций с городами: от 35px на мобилках до 60px на десктопе */
    margin-bottom: clamp(35px, 4vw, 60px);
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    max-width: 90%;
    border-bottom: none; 
    padding-bottom: 0;
}

.country-archive-page .other-cities-list {
    font-family: 'Bahnschrift', sans-serif;
    font-size: 19px;
    letter-spacing: 0.5px;
    display: table;
    width: fit-content;
    margin: 0 auto;
    text-align: center;
    text-transform: uppercase;
}

.country-archive-page .other-cities-row {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
    white-space: nowrap;
}

/* Ссылки на города в строке */
.country-archive-page .other-city-link {
    color: #a1b7ca;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: baseline;
}

.country-archive-page .other-city-link:hover {
    color: #759cb8;
}

/* Псевдоразделитель учитывается при расчёте ширины строки. */
.country-archive-page .other-city-link::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0.75em;
    margin: 0 clamp(8px, 1vw, 12px);
    border-left: 2px solid #b8b4a3;
    vertical-align: baseline;
    transform: translateY(clamp(-2px, 0.1vw, 1px)) translateZ(0);
    cursor: default;
}

/* Последняя ссылка списка — до того, как JavaScript соберёт физические строки. */
.country-archive-page .other-cities-list > .other-city-link:last-child::after {
    display: none;
}

/* Последний город каждой уже собранной строки. */
.country-archive-page .other-cities-row .other-city-link:last-child::after {
    display: none;
}

/* Секции конкретных городов на странице — ТЕПЕРЬ ОНИ УПРАВЛЯЮТ СЕТКОЙ */
.country-archive-page .country-city-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, 256px); 
    grid-column-gap: 4px; 
    grid-row-gap: 4px;    
    margin: 0 auto;
    margin-bottom: clamp(45px, 5.5vw, 80px); /* Твой стандартный отступ между блоками городов */
    width: 100%;
    max-width: 1560px; 
    justify-content: center; /* Центрируем всю пачку колонок на экране */
}

.country-archive-page .country-city-section:last-child {
    margin-bottom: 0;
}

/* Виртуально растворяем старый контейнер сетки, чтобы карточки подчинялись правилам родительской секции */
.country-archive-page .country-city-section .tokens-museum-grid {
    display: contents !important;
}

/* Заголовок-ссылка конкретного города над его личной плиткой */
.country-archive-page .city-section-title {
    grid-column: 1 / -1; /* Растягиваем блок заголовка СТРОГО от первой до последней активной колонки плиток */
    
    font-family: 'Bahnschrift', sans-serif;
    font-size: clamp(24px, 2.5vw, 34px);
    font-weight: 100;
    margin: 0 0 0 0; /* Динамический отступ вниз до плиток */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left; /* Текст прижат влево внутри границ активной сетки */
    padding-left: clamp(1px, 1.2vw, 10px);
}

.country-archive-page .city-section-title a {
    color: #a1b7ca;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.country-archive-page .city-section-title a:hover {
    color: #759cb8;
}


/* ===== АДАПТИВНОСТЬ ДЛЯ СТРАНИЦЫ СТРАНЫ (Синхронизация с брейкпоинтами городов) ===== */

/* 1. ЭТАП ДИНАМИЧЕСКОГО УМЕНЬШЕНИЯ ДЛЯ 3-Х КОЛОНОК (до 815px) */
@media (max-width: 815px) {
    .country-archive-page .country-city-section {
        grid-template-columns: repeat(3, 1fr); 
        grid-column-gap: 4px;
        grid-row-gap: 4px;
    }
}

/* 2. МОБИЛЬНЫЙ ПОРОГ (550px и меньше) */
@media (max-width: 550px) {
    .country-archive-page .token-title {
        margin-top: 15px;
    }

    .country-archive-page .country-city-section {
        grid-template-columns: repeat(2, 1fr); 
        grid-column-gap: clamp(1px, calc(1px + (4 - 1) * ((100vw - 320px) / (550 - 320))), 4px);
        grid-row-gap: clamp(1px, calc(1px + (4 - 1) * ((100vw - 320px) / (550 - 320))), 4px);
        margin-bottom: 50px; /* Расстояние между городами на мобилке */
    }

    .country-archive-page .city-section-title {
        /* Динамический отступ слева в полную синхронизацию с твоими паддингами мобильной сетки */
        padding-left: 0;
    }
    
    /* Добавляем "воздуха" сверху перед самым первым городом, чтобы контент не слипался со списком */
    .country-archive-page .other-cities-block {
        margin-bottom: 55px; 
    }

    /* Дополнительно увеличиваем расстояние между блоками городов, если их несколько, чтобы они визуально разделялись */
    .country-city-section {
        margin-bottom: 50px;
    }
}

@media (max-width: 500px) {
    .country-archive-page .other-cities-block {
        max-width: 98%;
    }
}

/* =========================================================================
   КАТАЛОГ ЖЕТОНОВ: СТРАНИЦА РЕГИОНА (Дополнения)
   ========================================================================= */

/* Блок обертки для разделения стран */
.region-country-block {
    margin-bottom: clamp(40px, 6vw, 80px);
}

/* Заголовки стран на странице регионов */
.region-archive-page .region-country-title {
    font-family: 'Bahnschrift', sans-serif;
    font-size: clamp(24px, 4vw, 38px);
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 400;
    margin: 0 auto 10px auto;
    line-height: 1.2;
}

.region-archive-page .region-country-title a {
    color: #b8b4a3;
    text-decoration: none;
    transition: color 0.2s ease;
}

.region-archive-page .region-country-title a:hover {
    color: #fff;
}

/* Специфический отступ для списка городов на странице региона */
.region-archive-page .region-country-block .other-cities-block {
    margin-bottom: clamp(15px, 2.5vw, 30px);
}

/* КОНТЕЙНЕР ДЛЯ ГОРОДА И ГОДА НА ПЛИТКЕ (страницы региона и страны) */
.country-archive-page .token-card-meta-container {
    position: absolute !important;
    bottom: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: column !important; /* Строго вертикальный стек */
    align-items: center !important;    /* Центрируем строго по оси */
    justify-content: center !important;
    width: 90% !important;
    pointer-events: none !important;
    z-index: 5 !important;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin: 0 0 -7px 0 !important; /* отрицательный отступ снизу прижмет его к году */
}

/* Показываем оба элемента одновременно при наведении на плитку */
.country-archive-page .token-grid-card:hover .token-card-meta-container {
    opacity: 1 !important;
}

.country-archive-page .token-grid-card.token-tile.touch-pressed .token-card-meta-container {
    opacity: 1 !important;
}

.country-archive-page .token-grid-card.token-tile.touch-released .token-card-meta-container {
    opacity: 0 !important;
}

/* НАЗВАНИЕ ГОРОДА — над годом, без плашки, крупнее и жирнее года */
.country-archive-page .token-card-city-hover-name {
    position: static !important;       /* Жестко возвращаем во флекс-поток */
    display: block !important;
    font-family: 'Bahnschrift', sans-serif;
    font-size: clamp(3.5cqw, 12cqw, 12cqw);
    font-weight: 400;
    color: #b8b4a3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 0 -6px 0; /* отрицательный отступ снизу прижмет его к году */
    
    /* Сброс любых левых координат */
    left: auto !important;
    top: auto !important;
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
    overflow: hidden !important;
    text-overflow: clip !important;
}

/* ГОД — такой же стиль, как на страницах городов и стран */
.country-archive-page .token-card-year {
    position: static !important;       /* Принудительно лишаем абсолютного позиционирования */
    display: block !important;
    font-family: 'Bahnschrift', sans-serif;
    font-size: 7cqw !important;
    font-weight: 100;
    color: #b8b4a3;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    
    /* Выбиваем почву у старого left: 50%, который утягивал год на середину */
    left: auto !important;
    top: auto !important;
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
}

@media (max-width: 450px) {
    /* Для ВСЕХ городов на мелких экранах прижимаем строку сильнее к году */
    .country-archive-page .token-card-city-hover-name {
        margin: 0 0 -2px 0; 
    }
}
/* =========================================================================*/
/*   СТРАНИЦА РЕГИОНА: ТИПОГРАФИКА (ЗАГОЛОВОК И СТРАНЫ)*/
/*   ========================================================================= */

/* =========================================================================
   БАЗОВЫЕ СТИЛИ ЗАГОЛОВКОВ РЕГИОНОВ (Для всех без исключения)
   ========================================================================= */
.region-archive-page .token-title {
    font-family: 'AeroMaticsStencil-Regular', sans-serif;
    color: #dfe2e5;
    
    /* Рамка всегда строго 4px — монолитный и мощный дизайн */
    border: 4px solid #dfe2e5;
    
    text-align: center;
    box-sizing: border-box;
    font-weight: 400; 
    letter-spacing: 0.08em; 
    margin: 0 auto 30px auto;
    
    width: fit-content !important;
    max-width: 100% !important;
    white-space: nowrap;
}

/* КОРОТКИЕ ЗАГОЛОВКИ (Азия, Америка...) — масштабируются чисто через CSS */
.region-standard-style .token-title {
    /* Роскошный, огромный дефолтный шрифт */
    font-size: clamp(60px, 12vw, 100px);
    
    padding-top: 0;
    padding-bottom: 0; 
    
    /* Огромные, сочные боковые отступы */
    padding-left: clamp(6px, 2.7vw, 45px) !important;
    padding-right: clamp(6px, 2.7vw, 45px) !important;
}

/* СРЕДНИЕ И СВЕРХДЛИННЫЕ ЗАГОЛОВКИ (Ближний Восток, СССР...) — динамические отступы и рамка */
.region-special-style .token-title {
    /* Рамка: плавно уменьшается от 4px (на десктопе) до 2px (на экранах ~320px) */
    border-width: clamp(1px, 0.5vw + 1px, 4px) !important;
    border-style: solid !important;
    border-color: #dfe2e5 !important;

    padding-top: 4px;
    padding-bottom: 4px; 
    
    /* Паддинги: на десктопе 35px, на мобильных (320px) уменьшаются до 15px, освобождая место для текста */
    padding-left: clamp(3px, 2.2vw, 35px) !important;
    padding-right: clamp(3px, 2.2vw, 35px) !important;
}

.region-archive-page .region-country-title {
    font-family: 'Golos Text', 'GolosTextWebDemibold', sans-serif;
    font-size: clamp(32px, 9vw, 70px); 
    font-weight: 600;
    color: #b8b4a3;
    margin: clamp(2px, 2.1vw, 40px) auto clamp(1px, 0.5vw, 10px) auto; 
    text-align: center;
    width: fit-content;
    max-width: 100%;
}

.region-archive-page .region-country-title a {
    color: #b8b4a3;
    text-decoration: none;
    transition: color 0.3s ease;
}

.region-archive-page .region-country-title a:hover {
    color: #ede5c3;
}

/* =========================================================================
   2. АДАПТИВ (Мобильные устройства)
   ========================================================================= */
@media (max-width: 768px) {
    .region-archive-page.region-special-style .token-title,
    .region-archive-page .region-country-title {
        min-width: 65%;
        margin-left: auto;
        margin-right: auto;
        letter-spacing: 0.04em;
    }

    /* Добавляем изящный межбуквенный интервал для коротких заголовков на мобильных */
    .region-standard-style .token-title {
        letter-spacing: 0.04em !important;
    }

    .region-archive-page .region-country-title {
        letter-spacing: 0.01em;
    }
}

/* Отключаем системное синее выделение при тапе/зажатии на мобильных устройствах */
a.token-grid-card,
.token-grid-card * {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important; /* Фолбэк для некоторых браузеров */
    outline: none !important;
}


/* МОДАЛЬНЫЕ ОКНА!!! */
/* МОДАЛЬНЫЕ ОКНА!!! */
/* МОДАЛЬНЫЕ ОКНА!!! */
/* МОДАЛЬНЫЕ ОКНА!!! */


/* Переменные высоты шапки и подвала для учета отступов */
:root {
    --header-height: 80px; /* Укажи точную высоту своего хедера */
    --footer-height: 60px; /* Укажи точную высоту своего футера, если он фиксирован */
}

/* Оверлей: Не перекрывает фиксированные хедер и футер */
.modal-overlay {
    position: fixed;
    top: var(--header-height, 80px);
    bottom: var(--footer-height, 0);
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 950; /* Хедер и футер должны иметь z-index от 1000 и выше */
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Контейнер окна: Ширина в точности равна твоему контейнеру жетонов на одиночной странице */
.modal-window {
    width: 100%;
    max-width: 1200px; /* Задай ширину контейнера из одиночной страницы жетонов */
    height: 100%;
    max-height: 90vh;
    margin: 0 auto;
    position: relative;
    background: #fff; /* Подстроится под темную тему, если у тебя настроены CSS-переменные */
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

/* Адаптивы для ширины контейнера */
@media (max-width: 1240px) {
    .modal-window { max-width: 960px; }
}
@media (max-width: 992px) {
    .modal-window { max-width: 720px; }
}
@media (max-width: 768px) {
    .modal-window { 
        max-width: 100%; 
        height: 100%; 
        max-height: 100%; 
        border-radius: 0; 
    }
}

/* Вьюпорт для анимации сдвигов слайдов */
.modal-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Скрываем полоску прокрутки модалки во всех браузерах */
.modal-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}
.modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Минималистичные стрелки внутри окна */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9f978a;
    transition: color 0.2s, opacity 0.2s;
}
.modal-nav:hover {
    color: #333;
}
.modal-nav.prev { left: 20px; }
.modal-nav.next { right: 20px; }
.modal-nav svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Кнопка закрытия */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9f978a;
    cursor: pointer;
    z-index: 101;
    transition: color 0.2s;
}
.modal-close:hover { color: #333; }

/* КЛАССЫ ДЛЯ АНИМАЦИИ СЛАЙДОВ (ЭФФЕКТ УЕЗЖАНИЯ В СТОРОНУ) */
.modal-slide-active {
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease;
    transform: translateX(0);
    opacity: 1;
}

.modal-slide-temp {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease;
    opacity: 0;
}

.slide-from-right { transform: translateX(100%); }
.slide-from-left { transform: translateX(-100%); }
.slide-to-left { transform: translateX(-100%); opacity: 0; }
.slide-to-right { transform: translateX(100%); opacity: 0; }

/* Последовательная загрузка тяжёлых каталогов стран и регионов. */
.catalog-progressive-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 72px;
    color: #777168;
    font-family: sans-serif;
    font-size: 14px;
    text-align: center;
}

/* Стабильные плитки страны до загрузки фотографий жетонов. */
.city-archive-page .token-loading-placeholder {
    cursor: wait;
    pointer-events: none;
}

.city-archive-page .token-loading-placeholder .token-loading-image-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050505;
}

.token-loading-animation {
    display: block;
    width: 85px;
    height: 85px;
    max-width: 36%;
    max-height: 36%;
}

.catalog-progressive-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid rgba(119, 113, 104, 0.25);
    border-top-color: #777168;
    border-radius: 50%;
    animation: catalog-progressive-spin 0.8s linear infinite;
}

.catalog-progressive-section.has-loading-error .catalog-progressive-status {
    color: #9b4038;
}

.catalog-progressive-status.is-empty {
    color: #777168;
}

@keyframes catalog-progressive-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-progressive-spinner { animation: none; }
}
