/*
Theme Name: SMM Digital Premium Ultimate
Theme URI: https://reklama-ua.shop/
Author: SMM-Digital Agency
Description: Высокотехнологичная премиум-тема в стиле High-End Digital Agency. Глубокие темные тона, неоновые градиенты, эффект Glassmorphic, полная адаптивность и мультиязычность (Polylang UA/RU).
Version: 3.0.0
Text Domain: smm-premium-ultimate
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #090d16;
    --bg-card: #131a26;
    --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c084fc 100%);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent-green: #10b981;
    --border-color: rgba(255, 255, 255, 0.08);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header Glassmorphism */
header {
    background: rgba(9, 13, 22, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav ul li a, nav > a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s ease;
}

nav ul li a:hover, nav ul li.current-menu-item a {
    color: #a78bfa;
}

/* Premium Language Switcher */
.lang-switcher {
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
}

.lang-switcher a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.3s;
}

.lang-switcher .current-lang a {
    color: #f8fafc;
}

/* Hero Section */
.hero {
    padding: 140px 20px 100px;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, rgba(9, 13, 22, 0) 70%);
    z-index: -1;
}

.hero h1 {
    font-size: clamp(38px, 5.5vw, 68px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.hero h1 span {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto 40px;
}

.btn-premium {
    background: var(--brand-gradient);
    color: var(--text-primary);
    padding: 16px 40px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35);
    transition: all 0.3s ease;
}

.btn-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.5);
}

/* Services Dynamic Cards */
.container {
    max-width: 1300px;
    margin: 60px auto;
    padding: 0 20px;
    flex: 1;
}

.section-hdr {
    text-align: center;
    margin-bottom: 50px;
}

.section-hdr h2 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
}

.grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 30px;
}

.premium-card {
    background: var(--bg-card);
    padding: 45px 35px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.premium-card:hover {
    transform: translateY(-8px);
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.premium-card .card-icon {
    width: 60px;
    height: 60px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.premium-card .card-icon i {
    font-size: 24px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.premium-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
}

.premium-card p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Dynamic Blog Lists */
.blog-section {
    margin-top: 100px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
}

.article-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
}

.article-card:hover {
    border-color: rgba(255,255,255,0.15);
}

.article-thumb img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.article-body {
    padding: 25px;
}

.article-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.article-body h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.article-body h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

/* WP Core Inner Templates */
.inner-page-wrap {
    max-width: 850px;
    margin: 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 50px 40px;
    border-radius: 28px;
}

.inner-page-wrap h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.inner-meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.content-area {
    font-size: 16px;
    color: #e2e8f0;
}

.content-area p { margin-bottom: 20px; }

/* Footer */
footer {
    background: #05070b;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}


/* ==========================================================================
   УЛЬТИМАТИВНЫЙ МОБИЛЬНЫЙ ФИКС (БЛОКИРОВАНИЕ ГОРИЗОНТАЛЬНОГО СКРОЛЛА)
   ========================================================================== */

/* Жестко запираем страницу по ширине, предотвращая "шатание" влево-вправо */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Адаптивные брейкпоинты для смартфонов и планшетов */
@media (max-width: 768px) {
    
    /* Сжимаем огромные заголовки, чтобы они не разрывали мобильную сетку */
    h1, .hero h1 {
        font-size: 28px !important;
        line-height: 1.3 !important;
        letter-spacing: normal !important;
    }
    h2, .section-hdr h2 {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    
    /* Все Grid-сетки (блоки услуг, контакты, архивы) перестраиваем в одну вертикальную колонку */
    .grid-premium, .archive-grid, .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    /* Заставляем широкую таблицу с донорами плавно скроллиться ТОЛЬКО внутри своего контейнера */
    div[style*="overflow-x: auto"], 
    .container div {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch; /* Плавный инерционный скролл на iOS */
    }

    table {
        min-width: 750px !important; /* Гарантируем читаемость колонок внутри прокрутки */
    }

    th, td {
        padding: 10px 8px !important; /* Оптимизируем боковые отступы ячеек */
        font-size: 13px !important;
    }

    /* Корректируем боковые паддинги контейнеров, чтобы текст не сжимался у краев экрана */
    section, .container, .nav-container, .inner-page-wrap {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Навигация в шапке (перенос ссылок в ряд при отсутствии кастомного меню) */
    nav {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
        margin-top: 10px;
    }
    .nav-container {
        flex-direction: column;
        padding: 15px 10px;
    }

    /* Все кнопки (ТГ, Позвонить, Обсудить проект) делаем на весь экран для удобного тапа */
    .btn-premium, 
    .premium-card a.btn-premium {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
        padding: 14px 20px !important;
    }
}


/* ==========================================================================
   КОРНЕВОЙ БЛОКИРАТОР РАЗЪЕЗЖАНИЯ СЕТКИ (АБСОЛЮТНЫЙ ЗАМОК)
   ========================================================================== */

/* 1. Намертво запираем окна браузера от раскачивания в стороны */
html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. Жестко принуждаем все элементы темы не вылезать за рамки дисплея */
@media (max-width: 768px) {
    
    html, body, header, footer, section, div, main, p, table {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Фикс шапки: главная причина разъезжания, если ссылки не помещаются */
    header, .nav-container {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 10px !important;
        margin: 0 auto !important;
    }

    nav, nav ul, .main-menu-list {
        display: flex !important;
        flex-direction: column !important; /* Выстраиваем ссылки строго в один ряд сверху вниз */
        align-items: center !important;
        width: 100% !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 10px 0 0 0 !important;
    }

    nav a, nav ul li a {
        display: block !important;
        width: 100% !important;
        max-width: 290px !important; /* Аккуратные кнопки на мобилке */
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Фикс контента: ужимаем паддинги, которые раздували контейнеры изнутри */
    .container, section, .hero, .inner-page-wrap, .blog-section {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 35px !important;
        padding-bottom: 35px !important;
        margin: 0 auto !important;
    }

    /* Предотвращаем разрыв экрана длинными заголовками */
    h1, .hero h1, h1 span {
        font-size: 24px !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
        white-space: normal !important;
    }
    
    h2, .section-hdr h2 {
        font-size: 20px !important;
    }

    /* Все премиум-карточки услуг и блогов — строго в одну вертикальную ленту */
    .grid-premium, .archive-grid, .footer-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 15px !important;
    }

    .premium-card, .article-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 25px 15px !important;
    }

    /* Фикс таблицы: изолируем её, чтобы она скроллилась только внутри пальцем */
    div[style*="overflow-x: auto"], 
    .container div {
        overflow-x: auto !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 15px 0 !important;
        padding: 8px !important;
        -webkit-overflow-scrolling: touch !important; /* Инерционный скролл для плавности на iPhone */
    }

    table {
        width: 100% !important;
        min-width: 600px !important; /* Даем таблице растянуться внутри скрытого контейнера */
    }

    th, td {
        padding: 8px 5px !important;
        font-size: 12px !important;
        white-space: normal !important; /* Разрешаем перенос текста в ячейках, чтобы экономить ширину */
    }
}

/* Контейнер контактов */
.header-contacts {
    display: flex;
    flex-direction: column; /* Телефон над Телеграмом */
    gap: 5px;
    margin-left: 15px; /* Немного отодвинуть от меню */
    font-family: sans-serif;
    font-size: 14px;
}

/* Ссылки */
.header-contacts a {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.header-contacts a:hover {
    color: #007bff; /* Цвет при наведении */
}

/* Иконки */
.header-contacts .icon {
    margin-right: 8px;
    font-size: 16px;
}


/* Основной контейнер шапки */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Логотип */
.logo {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    text-decoration: none;
    letter-spacing: -0.5px;
}

/* Меню навигации */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-navigation a,
.main-menu-list a {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s ease;
}

.main-navigation a:hover {
    color: #2563eb;
}

.main-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

/* Переключатель языков */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.lang-switcher a {
    color: #9ca3af;
}

.lang-switcher .current-lang a {
    color: #111827;
    text-decoration: underline;
}

.lang-divider {
    color: #d1d5db;
}

/* Блок акцентных контактов */
.header-contacts {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-phone-btn,
.header-tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

/* Кнопка телефона (Контрастная тёмно-синяя плашка) */
.header-phone-btn {
    background-color: #0f172a;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
}

.header-phone-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Кнопка Telegram */
.header-tg-btn {
    background-color: #0088cc;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 136, 204, 0.15);
}

.header-tg-btn:hover {
    background-color: #0077b5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

/* Мобильная адаптация */
@media (max-width: 992px) {
    .nav-container {
        flex-wrap: wrap;
    }
    .main-navigation {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .header-tg-btn span {
        display: none; /* Оставляем только иконку на маленьких экранах */
    }
    .header-tg-btn {
        padding: 9px;
        border-radius: 50%;
    }
    .header-phone-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}


/* Блок акцентных контактов */
.header-contacts {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-phone-btn,
.header-tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800; /* Очень жирный шрифт */
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

/* === ЯРКО-КРАСНАЯ КНОПКА ТЕЛЕФОНА === */
.header-phone-btn {
    background-color: #e11d48; /* Яркий насыщенный красный */
    color: #ffffff !important;
    border: 2px solid #e11d48;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35); /* Красная светящаяся тень */
}

.header-phone-btn:hover {
    background-color: #be123c; /* Тёмно-красный при наведении */
    border-color: #be123c;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.5);
}

.header-phone-btn svg {
    stroke: #ffffff;
}

/* === КНОПКА TELEGRAM === */
.header-tg-btn {
    background-color: #0088cc;
    color: #ffffff !important;
    border: 2px solid #0088cc;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.25);
}

.header-tg-btn:hover {
    background-color: #0077b5;
    border-color: #0077b5;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.4);
}

/* Адаптивность для мобильных */
@media (max-width: 576px) {
    .header-phone-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .header-tg-btn span {
        display: none;
    }
    
    .header-tg-btn {
        padding: 9px;
        border-radius: 50%;
    }
}