:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --sub: #86868b;
    --blue: #0071e3;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
}

body { 
    background: var(--bg); 
    color: var(--text); 
    padding-top: 80px; 
    overflow-x: hidden; /* Защита от горизонтального скролла */
}

/* --- ШАПКА --- */
.header {
    height: 64px; 
    background: rgba(255,255,255,0.85); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed; 
    top: 0; 
    width: 100%; 
    z-index: 9999;
    display: flex; 
    justify-content: center; 
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header-content {
    width: 100%;
    max-width: 1100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #1d1d1f;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.logo span {
    font-weight: 400;
    color: #86868b;
    margin-left: 5px;
}

.logo:hover {
    opacity: 0.7;
}

.main-nav { 
    display: flex; 
    gap: 40px; 
}

/* Адаптация меню для мобилок */
@media (max-width: 600px) {
    .main-nav {
        gap: 15px;
    }
    .main-nav a {
        font-size: 13px;
    }
    .logo {
        font-size: 18px;
    }
}

.main-nav a { 
    text-decoration: none; 
    color: var(--text); 
    font-size: 15px; 
    font-weight: 500;
    opacity: 0.7; 
    transition: 0.3s; 
}

.main-nav a:hover, .main-nav a.active { 
    opacity: 1; 
    color: var(--blue); 
}

/* --- КОНТЕНТ --- */
.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 40px 20px; 
}

h1 { 
    font-size: 48px; 
    text-align: center; 
    margin-bottom: 40px; 
    font-weight: 700; 
    letter-spacing: -1px; 
}

@media (max-width: 768px) {
    h1 { font-size: 32px; }
}

h1 span { color: var(--sub); }

/* --- СЕТКА ТОВАРОВ (ИСПРАВЛЕНО НА 4 В РЯД) --- */
.products {
    display: grid;
    /* Уменьшили минимальную ширину до 240px, чтобы 4 колонки влезали в контейнер 1100px */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Принудительные 4 колонки на больших экранах */
@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-title {
    grid-column: 1 / -1;
    font-size: 32px;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* --- КАРТОЧКА --- */
.product {
    background: var(--card); 
    border-radius: 24px; 
    padding: 25px; /* Немного уменьшили внутренний отступ для компактности */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center;
    transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    height: 100%; 
}

.product:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }

.img-container {
    width: 100%; 
    height: 180px; /* Немного уменьшили высоту фото для 4-х колоночной сетки */
    display: flex; 
    align-items: center; 
    justify-content: center;
    margin-bottom: 20px;
}

.product img {
    max-width: 100%; 
    max-height: 100%;
    object-fit: contain;
    transition: 0.3s;
}

.product-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex-grow: 1;
}

.product h3 { font-size: 20px; margin-bottom: 8px; font-weight: 600; }
.product p { color: var(--sub); font-size: 13px; margin-bottom: 15px; min-height: 40px; }

.specs-list {
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 6px;
    list-style: none; 
    margin-bottom: 20px;
}

.specs-list li { background: #f5f5f7; padding: 4px 10px; border-radius: 8px; font-size: 10px; color: var(--sub); }

/* --- ВЫБОР ЦВЕТА И ПАМЯТИ --- */
.color-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
}

.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-dot.active {
    box-shadow: 0 0 0 2px var(--blue);
    transform: scale(1.15);
}

.storage-selector {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.storage-item {
    padding: 5px 10px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.storage-item:hover { background: #f5f5f7; }

.storage-item.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

/* --- ЦЕНА И КНОПКА --- */
.price { 
    font-size: 22px; 
    font-weight: 700; 
    margin-top: auto; 
    margin-bottom: 15px; 
}

.buy-btn {
    background: var(--blue); 
    color: #fff; 
    border: none; 
    width: 100%;
    padding: 12px; 
    border-radius: 12px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: 0.2s;
}

.buy-btn:hover { background: #0077ed; transform: scale(1.02); }
.buy-btn:disabled { background: var(--sub); opacity: 0.6; cursor: not-allowed; }

/* --- АНИМАЦИЯ ПОЯВЛЕНИЯ (REVEAL) --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- ПОДВАЛ --- */
footer {
    padding: 60px 20px;
    background: #fff;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    margin-top: 50px;
}

footer p {
    color: var(--sub);
    font-size: 14px;
    margin-bottom: 12px;
}

.support-link {
    font-size: 15px;
    font-weight: 500;
}

.support-link a {
    color: var(--blue);
    text-decoration: none;
    margin-left: 5px;
}

.support-link a:hover {
    text-decoration: underline;
}

/* --- КАБИНЕТ --- */
.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 900px) {
    .cabinet-grid {
        grid-template-columns: 1fr;
    }
}

.cabinet-card {
    background: #fff;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.cabinet-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 10px;
}

.balance-id {
    color: var(--sub);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--sub);
    margin-bottom: 5px;
    margin-left: 5px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid #d2d2d7;
    border-radius: 14px;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
}

.input-group input:focus { border-color: var(--blue); }

.bot-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f5f5f7;
    padding: 15px;
    border-radius: 14px;
    margin-top: 20px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.bot-info img { width: 30px; height: 30px; }

.history-card { min-height: 200px; }

.empty-msg {
    text-align: center;
    color: var(--sub);
    margin-top: 40px;
}

/* Выбор SIM */
.sim-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.sim-item {
    padding: 6px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    background: transparent;
}

.sim-item:hover { background: #f5f5f7; }

.sim-item.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

/* Верхняя тонкая плашка */
.promo-bar {
    background: #1d1d1f;
    color: #fff;
    font-size: 12px;
    padding: 10px 0;
    text-align: center;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.promo-bar a {
    color: #2997ff;
    text-decoration: none;
    margin-left: 10px;
}

.promo-bar a:hover {
    text-decoration: underline;
}

/* Главный праздничный баннер */
.holiday-banner {
    background: #000; 
    border-radius: 30px;
    padding: 80px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    margin: 40px 0;
    background-image: radial-gradient(circle at bottom, #1d1d1f 0%, #000 70%);
}

.banner-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out forwards;
}

.banner-tag {
    color: #86868b;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.holiday-banner h2 {
    color: #fff;
    font-size: clamp(32px, 5vw, 56px); 
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.promo-text {
    color: #f5f5f7;
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1.4;
    margin-bottom: 40px;
    font-weight: 400;
}

.promo-text .highlight {
    display: block; 
    margin-top: 10px;
    color: #0071e3; 
    font-weight: 600;
}

.btn-primary-banner {
    background: #0071e3;
    color: #fff;
    padding: 16px 32px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary-banner:hover {
    background: #0077ed;
    transform: scale(1.05);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
