@font-face {
    font-family: 'Minecraft';
    src: url('/static/fonts/Minecraft.otf') format('opentype');
    font-display: swap;
}

/* === Сброс и переменные === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Тёмная тема «Край» (по умолчанию) */
    --bg-primary: #0b0a12;
    --bg-secondary: #0f0d1a;
    --bg-card: rgba(19, 17, 32, 0.6);
    --bg-card-hover: rgba(30, 25, 50, 0.8);
    --bg-input: rgba(15, 13, 26, 0.8);
    --bg-modal: rgba(13, 11, 22, 0.95);
    --bg-backdrop: rgba(11, 10, 18, 0.85);
    
    --text-primary: #f0e8f4;
    --text-secondary: #8a7f99;
    --text-muted: #5c5470;
    
    --accent: #7c3aed;
    --accent-hover: #8b5cf6;
    --accent-light: #b88de0;
    --accent-glow: rgba(184, 141, 224, 0.25);
    --accent-gradient: linear-gradient(135deg, #b88de0, #e0b8ff);
    --logo-gradient: linear-gradient(135deg, #b88de0, #e0b8ff);
    
    --btn-inactive: rgba(30, 25, 50, 0.5);
    --btn-inactive-text: #8a7f99;
    --btn-active: #7c3aed;
    --btn-active-text: #f0e8f4;
    
    --border: rgba(184, 141, 224, 0.3);
    --border-light: rgba(184, 141, 224, 0.25);
    --border-glow: rgba(184, 141, 224, 0.4);
    
    --danger: #ff6b9d;
    --success: #4ecdc4;
    --warning: #ffd93d;
    --gold: #ffd700;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 0 30px rgba(184, 141, 224, 0.06);
    --shadow-md: 0 0 60px rgba(184, 141, 224, 0.12);
    --shadow-lg: 0 0 100px rgba(184, 141, 224, 0.18);
    
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    --header-height: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    
    --transition-theme: background-color 0.4s ease, color 0.4s ease;
}

/* Светлая тема «Дневной Край» */
[data-theme="light"] {
    --bg-primary: #f0ecf5;
    --bg-secondary: #e8e2f0;
    --bg-card: rgba(255, 252, 255, 0.7);
    --bg-card-hover: rgba(245, 240, 250, 0.9);
    --bg-input: rgba(250, 248, 252, 0.9);
    --bg-modal: rgba(248, 245, 252, 0.97);
    --bg-backdrop: rgba(20, 15, 30, 0.5);
    
    --text-primary: #1a1428;
    --text-secondary: #5c5470;
    --text-muted: #8a7f99;
    
    --btn-inactive: rgba(220, 210, 235, 0.6);
    --btn-inactive-text: #6b6080;
    --border: rgba(140, 120, 170, 0.2);
    --border-light: rgba(140, 120, 170, 0.35);
    --border-glow: rgba(140, 120, 170, 0.5);
    
    --shadow-sm: 0 0 40px rgba(140, 120, 170, 0.08);
    --shadow-md: 0 0 70px rgba(140, 120, 170, 0.14);
    --shadow-lg: 0 0 120px rgba(140, 120, 170, 0.2);
    
    --logo-gradient: linear-gradient(135deg, #4a1d8a, #7c3aed);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
    transition: var(--transition-theme);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow-x: hidden;
}

/* === Фоновые слои «Глубина» (только тёмная тема) === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -3;
    background: radial-gradient(ellipse at 30% 50%, rgba(100, 60, 160, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(140, 100, 180, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(80, 50, 130, 0.07) 0%, transparent 55%);
    pointer-events: none;
}

[data-theme="light"] body::before {
    background: radial-gradient(ellipse at 30% 50%, rgba(180, 160, 200, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(200, 180, 220, 0.04) 0%, transparent 50%);
}

/* === Частицы за курсором === */
.cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-light);
    box-shadow: 0 0 8px var(--accent-glow);
    opacity: 0;
    animation: trailFade 0.6s ease-out forwards;
}

@keyframes trailFade {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0); }
}

@media (max-width: 768px) {
    .cursor-trail {
        display: none;
    }
}

/* === Шапка === */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 20px rgba(184, 141, 224, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: relative;
    justify-content: space-between;
}

/* шапка логотип */
.header__logo {
    font-family: 'Minecraft', 'Inter', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #7c3aed 0%, #7c3aed 35%, #e0b8ff 50%, #7c3aed 65%, #7c3aed 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    cursor: pointer;
    animation: shimmer 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.6));
    transition: transform 0.3s ease, filter 0.3s ease;
    flex-shrink: 0;
    display: inline-block;
    width: fit-content;
    min-width: 220px;
}

@keyframes shimmer {
    0% { background-position: 300% 0; }
    100% { background-position: 0% 0; }
}

.header__logo:hover {
    animation: shimmer 3s linear infinite;
    filter: drop-shadow(0 0 22px rgba(124, 58, 237, 0.9));
    transform: scale(1.08);
    text-shadow: 0 0 30px rgba(184, 141, 224, 0.7), 0 0 60px rgba(124, 58, 237, 0.4);
}

.header__nav {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}


.header__right {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: -30px;
}

/* Кнопка корзины в шапке */
.header__cart {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
    background-color: var(--btn-inactive);
    position: relative;
    text-decoration: none;
    color: var(--text-primary);
    white-space: nowrap;
}

.header__cart-label {
    font-weight: 500;
    letter-spacing: 0.3px;
    font-size: 0.9rem;
}

.header__cart-count {
    position: static;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.header__cart-count:empty {
    display: none;
}

.header__cart--has-items {
    border-color: var(--accent);
    animation: cartPulse 2s infinite;
}

.header__cart--active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    animation: none;
}

@keyframes cartPulse {
    0%, 100% { box-shadow: 0 0 0 rgba(124, 58, 237, 0); }
    50% { box-shadow: 0 0 15px rgba(124, 58, 237, 0.5); }
}

.header__cart-count--pop {
    animation: countPop 0.3s ease;
}

@keyframes countPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* IP сервера */
.header__ip {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.header__ip-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header__ip-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    width: 90px;
    text-align: right;
}

.header__ip-item {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--btn-inactive);
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 200px;
    justify-content: space-between;
    flex: 1;
}

.header__ip-item span {
    color: var(--accent-light);
    font-weight: 600;
}

.header__ip-item:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 12px var(--accent-glow);
    color: var(--text-primary);
}

.header__ip-copy-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: opacity 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}

.header__ip-item:hover .header__ip-copy-icon {
    opacity: 1;
}

/* Всплывашка «Скопировано» */
.copy-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@keyframes toastIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    0% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Показать IP на ПК */
@media (min-width: 769px) {
    .header__ip {
        display: inline-block;
    }
}

/* Переключатель темы */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s;
    background-color: var(--btn-inactive);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.theme-toggle:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle__icon--light,
[data-theme="dark"] .theme-toggle__icon--dark,
:root .theme-toggle__icon--light {
    display: inline;
}

[data-theme="light"] .theme-toggle__icon--dark,
:root .theme-toggle__icon--dark {
    display: none;
}

.theme-toggle__icon--light {
    display: none;
}

/* Кнопка-бургер */
.burger {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    background-color: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.burger:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 12px var(--accent-glow);
}

.burger__line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* === Десктопная навигация === */
.header__nav {
    display: none;
    align-items: center;
    gap: 8px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header__nav-link {
    pointer-events: auto;
}

.header__nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.3s;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}

.header__nav-link:hover {
    color: var(--accent-light);
    text-shadow: 0 0 10px var(--accent-glow);
    border-color: var(--border);
    background-color: var(--bg-card);
}

/* Выпадающее меню «Поддержка» */
.header__dropdown {
    position: relative;
}

.header__dropdown-toggle {
    user-select: none;
}

.header__dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: var(--bg-modal);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 200;
}

.header__dropdown:hover .header__dropdown-menu,
.header__dropdown-toggle:hover + .header__dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.header__dropdown-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.header__dropdown-link:hover {
    background-color: var(--bg-card);
    color: var(--accent-light);
}

.header__dropdown-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    flex-shrink: 0;
}

.header__dropdown-link:hover .header__dropdown-icon {
    opacity: 1;
}

.header__dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 3px;
    transition: transform 0.3s;
    display: inline-block;
}

.header__dropdown:hover .header__dropdown-arrow {
    transform: rotate(180deg);
}

/* Показать навигацию на ПК, скрыть бургер */
@media (min-width: 1101px) {
    .header__nav {
        display: flex;
    }
    
    .burger {
        display: none;
    }
    
    .menu {
        display: none;
    }
}

/* Меню */
.menu {
    max-width: 1200px;
    margin: 0 auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.2, 0, 0, 1), padding 0.4s ease;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.menu--open {
    max-height: 300px;
    border-bottom-color: var(--border);
}

.menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu__item {
    border-bottom: 1px solid var(--border);
}

.menu__item:last-child {
    border-bottom: none;
}

.menu__link {
    display: block;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    text-align: center;
}

.menu__link:hover {
    background-color: var(--bg-card);
    color: var(--accent-light);
    text-shadow: 0 0 12px var(--accent-glow);
}

.menu__link--disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
}

.menu__link--disabled:hover {
    background-color: transparent;
    color: var(--text-muted);
    text-shadow: none;
}

/* === Основной контент === */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* === Приветственный блок === */
.welcome {
    text-align: center;
    padding: 16px 16px 20px;
}

.welcome__title {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin: 0 0 8px 0;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 14px rgba(184, 141, 224, 0.3));
}

.welcome__subtitle {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

/* === Кнопки режимов === */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 12px 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--btn-inactive);
    color: var(--btn-inactive-text);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.5px;
}

.mode-btn:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--accent-glow);
}

.mode-btn--active {
    background-color: var(--btn-active);
    color: #fff !important;
    border-color: var(--btn-active);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
    transform: translateY(-2px);
}

/* === Кнопки категорий === */
.category-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--btn-inactive);
    color: var(--btn-inactive-text);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.3px;
}

.category-btn:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 0 16px var(--accent-glow);
}

.category-btn--active {
    background-color: var(--btn-active);
    color: #fff !important;
    border-color: var(--btn-active);
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.45);
}

/* === Сетка товаров === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.products-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* === Карточка товара «Сгусток тумана» === */
.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

/* Лёгкое свечение при покое */
.product-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    box-shadow: inset 0 0 60px rgba(184, 141, 224, 0.08);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.product-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    background-color: var(--bg-card-hover);
}

.product-card:hover::after {
    opacity: 1;
}

.product-card__icon {
    width: 140px;
    height: 140px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: box-shadow 0.4s ease;
}

.product-card:hover .product-card__icon {
    box-shadow: 0 0 30px rgba(184, 141, 224, 0.2);
}

.product-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    image-rendering: pixelated;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card__icon img {
    transform: scale(1.05);
}

.product-card__info {
    text-align: center;
}

.product-card__name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.product-card__price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-light);
}

/* Плашка скидки на карточке */
.product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 8px 14px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 4px 16px rgba(255, 71, 87, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
    letter-spacing: 1px;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Зачёркнутая старая цена */
.product-card__old-price {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-top: -4px;
}

/* === Каскадное появление карточек === */
.product-card {
    animation: cardAppear 0.6s cubic-bezier(0.2, 0, 0, 1) both;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(n+9) { animation-delay: 0.45s; }

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Количество */
.product-card__quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    user-select: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.quantity-btn:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    box-shadow: 0 0 12px var(--accent-glow);
}

.quantity-input {
    width: 70px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    -moz-appearance: textfield;
    transition: border-color 0.3s;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 10px var(--accent-glow);
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.quantity-total {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quantity-total-price {
    font-weight: 600;
    color: var(--accent-light);
}

/* Поле количества в модалке */
.buy-form__quantity {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.buy-form__quantity .product-card__quantity {
    justify-content: flex-start;
}

/* Кнопки действий */
.product-card__actions {
    display: flex;
    gap: 8px;
}

.product-card__btn--buy {
    flex: 1;
}

.product-card__btn--cart {
    width: 44px;
    flex-shrink: 0;
    padding: 10px 0;
}

.product-card__btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
    text-align: center;
    user-select: none;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.product-card__btn--buy {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.product-card__btn--buy:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.product-card__btn--cart {
    width: 44px;
    flex-shrink: 0;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1.2rem;
}

.product-card__btn--cart:hover {
    border-color: var(--accent-light);
    background-color: var(--bg-card-hover);
    box-shadow: 0 0 14px var(--accent-glow);
}

.product-card__btn--info {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px dashed var(--border);
    width: 100%;
}

.product-card__btn--info:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    background-color: rgba(124, 58, 237, 0.06);
}

/* === Модальные окна «Портал» === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal--open {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: var(--bg-backdrop);
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal__content {
    position: relative;
    background-color: var(--bg-modal);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(184, 141, 224, 0.1);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    max-height: 85dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: portalIn 0.4s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes portalIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(12px);
    }
    60% {
        opacity: 1;
        transform: scale(1.02);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal__title {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal__close:hover {
    background-color: var(--bg-card);
    color: var(--danger);
    box-shadow: 0 0 14px rgba(255, 107, 157, 0.3);
}

.modal__body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal__btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
    letter-spacing: 0.3px;
}

.modal__btn--primary {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.modal__btn--primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.5);
}

.modal__btn--secondary {
    background-color: transparent;
    color: var(--text-primary);
}

.modal__btn--secondary:hover {
    background-color: var(--bg-card);
    border-color: var(--accent-light);
}

.modal__btn--close {
    background-color: transparent;
    color: var(--text-secondary);
}

.modal__btn--close:hover {
    background-color: var(--bg-card);
    border-color: var(--accent-light);
}

/* Описание товара в модалке */
.info-description h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.info-description p,
.info-description li {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 6px;
}

.info-description ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 8px;
}

.info-description ul li::before {
    content: "▸ ";
    color: var(--accent-light);
}

.info-description .text-bold {
    font-weight: 600;
}

.info-description .text-italic {
    font-style: italic;
}

/* Форма покупки */
.buy-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.buy-form__product-name {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.buy-form__price {
    font-size: 1.1rem;
    color: var(--accent-light);
    font-weight: 600;
}

.buy-form__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.buy-form__input {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font);
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.buy-form__input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 14px var(--accent-glow);
}

.buy-form__input::placeholder {
    color: var(--text-muted);
}

.buy-form__input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.buy-form__promo-row {
    display: flex;
    gap: 8px;
}

.buy-form__promo-row .buy-form__input {
    flex: 1;
}

.buy-form__promo-btn {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.buy-form__promo-btn:hover:not(:disabled) {
    border-color: var(--accent-light);
    color: var(--accent-light);
    box-shadow: 0 0 10px var(--accent-glow);
}

.buy-form__promo-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.buy-form__hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -8px;
}

.buy-form__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-weight: 600;
    font-size: 1.1rem;
}

.buy-form__total-price {
    color: var(--accent-light);
    font-size: 1.4rem;
}

.buy-form__other-currency {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
}

.buy-form__other-currency:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
    background-color: rgba(124, 58, 237, 0.06);
}

.buy-form__agreement {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
    margin: 8px 0 0 0;
}

.buy-form__agreement-link {
    color: var(--accent-light);
    text-decoration: underline;
    transition: color 0.2s;
}

.buy-form__agreement-link:hover {
    color: var(--accent-hover);
}

/* === Лента последних покупок === */
.recent-purchases {
    max-width: 100%;
    margin: 0;
    padding: 20px 0;
    box-sizing: border-box;
}

.recent-purchases__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.recent-purchases__title {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: 0.5px;
}

.recent-purchases__track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    padding-top: 4px;
    padding-bottom: 12px;
    justify-content: center;
}

.recent-purchases__track::-webkit-scrollbar {
    display: none;
}

.recent-purchases__loading {
    color: var(--text-muted);
    padding: 12px;
    font-size: 0.9rem;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.purchase-item__actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.purchase-item__actions {
    display: flex;
    gap: 6px;
    width: 100%;
}

.purchase-item__btn {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.35s cubic-bezier(0.2, 0, 0, 1);
    text-align: center;
    user-select: none;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.purchase-item__btn--buy {
    flex: 1;
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.purchase-item__btn--buy:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.purchase-item__btn--cart {
    width: 32px;
    flex-shrink: 0;
    background-color: var(--bg-input);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.purchase-item__btn--cart:hover {
    border-color: var(--accent-light);
    background-color: var(--bg-card-hover);
    box-shadow: 0 0 14px var(--accent-glow);
}

.purchase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    flex-shrink: 0;
    width: 180px;
    min-width: 180px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.3s, box-shadow 0.3s;
    /* Квадратная форма */
    aspect-ratio: 1 / 1;
    justify-content: center;
}

.purchase-item:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md);
}

.purchase-item__icon {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: var(--bg-input);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.purchase-item__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.purchase-item__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.purchase-item__name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.purchase-item__name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.purchase-item__qty {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.purchase-item__nick {
    color: var(--accent-light);
    font-weight: 500;
    font-size: 0.8rem;
}

/* На мобильных — компактнее */
@media (max-width: 480px) {
    .recent-purchases {
        padding: 12px 8px;
    }
    
    .purchase-item {
        width: 120px;
        min-width: 120px;
        padding: 10px 8px;
        gap: 6px;
        aspect-ratio: auto;
    }
    
    .purchase-item__icon {
        width: 56px;
        height: 56px;
        padding: 6px;
    }
    
    .purchase-item__info {
        font-size: 0.75rem;
    }
    
    .purchase-item__name {
        font-size: 0.75rem;
    }
    
    .purchase-item__nick {
        font-size: 0.72rem;
    }
}

/* === Футер === */
.footer {
    text-align: center;
    padding: 20px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background-color: var(--bg-secondary);
    padding-bottom: calc(20px + var(--safe-bottom));
    margin-top: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__copy {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.footer__warning {
    margin: 0;
    font-size: 0.8rem;
    color: var(--warning);
    font-style: italic;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer__link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s, text-shadow 0.3s;
    font-size: 0.8rem;
}

.footer__link:hover {
    color: var(--accent-light);
    text-shadow: 0 0 8px var(--accent-glow);
}

.footer__legal {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* === Страница правил === */
.rules-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.rules-text {
    line-height: 1.7;
}

.rules-h3 {
    font-size: 1.3rem;
    margin: 0 0 16px 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.rules-h4 {
    font-size: 1.05rem;
    margin: 20px 0 8px 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.rules-p {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.rules-bold {
    margin: 12px 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.rules-list {
    margin: 8px 0 12px 20px;
    padding: 0;
}

.rules-list li {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.rules-list li::marker {
    color: var(--accent-light);
}

/* === Кастомный скроллбар «Край» === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #7c3aed, #b88de0);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(184, 141, 224, 0.4);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #8b5cf6, #e0b8ff);
    box-shadow: 0 0 16px rgba(184, 141, 224, 0.6);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #7c3aed transparent;
}

/* === Дыхание фона при бездействии === */
body.idle-breathing::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%, rgba(184, 141, 224, 0.06) 0%, transparent 70%);
    animation: idleBreath 4s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1.5s ease;
}

body.idle-breathing::after {
    opacity: 1;
}

@keyframes idleBreath {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

/* === Социальные сети в футере === */
.footer__socials {
    margin-top: 6px;
}

.footer__socials-title {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.footer__socials-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    transition: all 0.3s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.footer__social-link:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 16px var(--accent-glow);
    transform: translateY(-2px);
}

.footer__social-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.3s;
    filter: grayscale(0.3);
}

.footer__social-link:hover .footer__social-icon {
    opacity: 1;
    filter: grayscale(0);
}

/* === Вкладки в модалке информации === */
.info-tabs__nav {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.info-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--btn-inactive);
    color: var(--btn-inactive-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.info-tab-btn:hover {
    border-color: var(--accent-light);
    color: var(--accent-light);
}

.info-tab-btn--active {
    background-color: var(--btn-active);
    color: #fff !important;
    border-color: var(--btn-active);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.info-tab-panel {
    display: none;
}

.info-tab-panel--active {
    display: block;
}

/* === Выбор валюты === */
.currency-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.currency-selector__label {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.currency-selector__dropdown {
    position: relative;
}

.currency-selector__current {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--btn-inactive);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    min-width: 180px;
    justify-content: space-between;
}

.currency-selector__current:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 10px var(--accent-glow);
}

.currency-selector__arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.currency-selector__dropdown--open .currency-selector__arrow {
    transform: rotate(180deg);
}

.currency-selector__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background-color: var(--bg-modal);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 50;
    display: none;
    overflow: hidden;
}

.currency-selector__dropdown--open .currency-selector__list {
    display: block;
}

.currency-selector__option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.currency-selector__option:hover {
    background-color: var(--bg-card);
    color: var(--accent-light);
}

.currency-selector__option--active {
    background-color: var(--bg-card);
    color: var(--accent-light);
}

.currency-flag {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.header__rgb-link {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--btn-inactive);
    transition: all 0.3s;
    white-space: nowrap;
}

.header__rgb-link:hover {
    border-color: var(--accent-light);
    box-shadow: 0 0 12px var(--accent-glow);
    color: var(--accent-light);
}

.overlay-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.overlay-modal__content {
    position: relative;
    background-color: var(--bg-modal);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px;
    z-index: 10001;
}

.overlay-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.overlay-modal__header h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.overlay-modal__close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
}

.overlay-modal__body {
    margin-bottom: 16px;
}

.overlay-modal__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* === Адаптивность === */

@media (max-width: 1100px) {
    .header__cart {
    	background-color: var(--btn-inactive);
        border-radius: 50%;
        padding: 0;
        width: 38px;
        height: 38px;
        justify-content: center;
        gap: 0;
    }
    .header__cart-label {
        display: none;
    }
    .header__cart-count {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        font-size: 0.6rem;
        padding: 0 4px;
    }
    
    .header__nav-link {
        padding: 6px 8px;
        font-size: 0.8rem;
        letter-spacing: 0;
    }
    
    .header__nav {
        gap: 0px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .header__logo {
        font-size: 1.6rem;
        display: inline-block;
        width: fit-content;
    }
    
    .header__right {
        gap: 6px;
    }
    
    .header__ip {
        display: none;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }

    .header__right {
        gap: 4px;
        margin-right: 0;
    }

    .welcome {
        padding: 12px 12px 14px;
    }
    
    .welcome__title {
        font-size: 1.3rem;
    }
    
    .welcome__subtitle {
        font-size: 0.85rem;
    }
    
    .mode-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .category-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .modal__content {
        animation: portalInMobile 0.35s cubic-bezier(0.2, 0, 0, 1);
    }

    .header__ip,
    .header__rgb-link {
        display: none;
    }
}

@keyframes portalInMobile {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@media (max-width: 480px) {
    .header__logo {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    .header__inner {
        padding: 0 12px;
    }

    .header__right {
        gap: 4px;
        overflow: hidden;
        margin-right: 0;
        flex-shrink: 0;
    }

    .burger {
        flex-shrink: 0;
    }

    .welcome {
        padding: 12px 12px 14px;
    }
    
    .welcome__title {
        font-size: 1.3rem;
    }
    
    .welcome__subtitle {
        font-size: 0.85rem;
    }

    .header__cart {
        border-radius: 50%;
        padding: 0;
        width: 38px;
        height: 38px;
        justify-content: center;
        gap: 0;
    }
    .header__cart-label {
        display: none;
    }
    .header__cart-count {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        font-size: 0.6rem;
    }
    
    .main {
        padding: 12px 8px 32px;
    }
    
    .mode-selector {
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 8px;
        justify-content: flex-start;
    }
    .mode-selector::-webkit-scrollbar {
        display: none;
    }
    
    .mode-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .category-selector {
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px 8px;
        margin-bottom: 20px;
        justify-content: flex-start;
    }
    .category-selector::-webkit-scrollbar {
        display: none;
    }
    
    .category-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        border-radius: var(--radius-sm);
        flex: 1 1 auto;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .product-card__icon {
        width: 100px;
        height: 100px;
        padding: 0px;
    }
    
    .product-card__name {
        font-size: 0.9rem;
    }

    .product-card {
        position: relative;
    }

    .product-card__badge {
        top: 4px;
        left: 4px;
        font-size: 0.65rem;
        padding: 2px 6px;
        border-radius: 4px;
    }
    
    .product-card__price {
        font-size: 1rem;
    }
    
    .product-card__btn {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
    
    .product-card__btn--cart {
        width: 36px;
        padding: 8px 0;
        font-size: 1rem;
    }
    
    .modal__content {
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        margin-top: auto;
    }
    
    .modal__header {
        padding: 12px 16px;
    }
    
    .modal__body {
        padding: 16px;
    }
    
    .modal__footer {
        padding: 12px 16px;
        flex-direction: column;
    }
    
    .modal__btn {
        width: 100%;
        text-align: center;
    }
    
    .rules-content {
        padding: 16px;
        border-radius: var(--radius-md);
    }
    
    .rules-h3 {
        font-size: 1.1rem;
    }
    
    .rules-h4 {
        font-size: 0.95rem;
    }
    
    .rules-p, .rules-bold {
        font-size: 0.85rem;
    }
    
    .rules-list li {
        font-size: 0.82rem;
    }

    .header__rgb-link {
    display: none;
    }
}

@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-selector,
    .category-selector {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    
    .mode-selector::-webkit-scrollbar,
    .category-selector::-webkit-scrollbar {
        display: none;
    }
    
    .mode-btn,
    .category-btn {
        flex-shrink: 0;
    }

    .recent-purchases__track {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .purchase-item {
        width: 140px;
        min-width: 140px;
        flex-shrink: 0;
    }
}