/* ================================================= */
/* 1. ГЛОБАЛЬНЫЕ ТОКЕНЫ (APPLE DESIGN SYSTEM 2026)   */
/* ================================================= */
:root {
    /* Скругления элементов */
    --radius-tile: 32px; 
    --radius-button: 16px;
    --radius-badge: 6px; /* Для флагов на карточках */
    
    /* Плавная анимация отклика */
    --transition-soft: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Динамические размеры шрифтов */
    --font-title: clamp(14px, 2.5vw, 17px);
    --font-subtitle: clamp(11px, 2vw, 13px);

    /* Цвета для специальных элементов */
    --price-green: #26de81; /* Тот самый "сочный неоновый" зеленый */
    --header-gradient: linear-gradient(180deg, #e5e5ea 0%, #d1d1d6 100%);
}

/* ================================================= */
/* 2. ЦВЕТОВЫЕ СХЕМЫ (ТЕМНАЯ И СВЕТЛАЯ)              */
/* ================================================= */

:root[data-theme="dark"] {
    --bg-site: radial-gradient(circle at 50% -20%, #0a1128 0%, #050505 100%);
    --surface: rgba(255, 255, 255, 0.05);
    --text-main: #f5f5f7;
    --text-secondary: #8e8e93;
    --accent: #0071e3;
    --accent-theme: #ffcc00;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
    --bg-site: linear-gradient(180deg, #d4e4d4 0%, #bbcbbb 100%);
    --surface: #ffffff;
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0071e3;
    --accent-theme: #4a6b4a;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Базовые стили */
html, body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-site) fixed;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition-soft);
}

/* ================================================= */
/* 3. ХЕДЕР (ШАПКА САЙТА)                            */
/* ================================================= */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 64px;
    background: var(--header-gradient) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
}

.logo {
    font-weight: 800; 
    font-size: 1.3rem;
    text-decoration: none;
    color: #0071e3 !important;
    letter-spacing: -0.5px;
}

/* ================================================= */
/* 4. КАРТОЧКИ ТОВАРОВ И СЕТКА                       */
/* ================================================= */

/* Универсальная сетка для всех страниц (сетка 4 колонки) */
.grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: clamp(16px, 3vw, 24px);
    padding: 0 clamp(16px, 4vw, 40px);
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1024px) {
    .grid-main { grid-template-columns: repeat(4, 1fr); }
}

.tile-card {
    background: var(--surface);
    border-radius: var(--radius-tile);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Равномерное распределение элементов */
    align-items: center;
    aspect-ratio: 1/1;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-soft);
    position: relative;
    padding: 24px 16px;
    overflow: hidden; /* Чтобы флаг не вылезал за границы */
}

/* Флаг региона (Твое ТЗ: Правый верхний угол, прямоугольник со скруглением) */
.flag-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 26px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Номинал: Крупно, в одну строку */
.nominal-text {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 10px;
}

/* Цена: Сочный неоновый зеленый */
.price-main {
    color: var(--price-green);
    font-weight: 900;
    font-size: 1.3rem;
    text-shadow: 0 0 15px rgba(38, 222, 129, 0.3);
}

/* Ховер эффект */
.tile-card:hover:not(.disabled) {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-premium);
}

/* ================================================= */
/* 5. ОФОРМЛЕНИЕ ЗАКАЗА (ФИКСЫ)                      */
/* ================================================= */

/* Контейнер инпута с иконкой */
.input-wrapper {
    position: relative;
    width: 100%;
}

/* Фикс наложения: увеличиваем отступ слева, чтобы текст не лез на иконку */
.input-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 52px !important; /* 52px обеспечивает место для иконки */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text-main);
    transition: var(--transition-soft);
}

.input-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none; /* Чтобы иконка не мешала клику */
}

/* Кнопки методов оплаты */
.pay-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
}

/* Неактивные методы (СБП, Карты) */
.method-disabled {
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: none;
    cursor: not-allowed;
}

/* ================================================= */
/* 6. АДАПТИВНОСТЬ И ФУТЕР                          */
/* ================================================= */
@media (max-width: 640px) {
    .grid-main { grid-template-columns: repeat(2, 1fr); }
    .tile-card { padding: 15px 10px; }
}

.footer-main {
    padding: 60px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
