/* ================================================================ */
/*                LAST LEGEND - FINAL CUSTOM THEME (Cleaned)        */
/* ================================================================ */

/* === 1. ОБЩИЕ И БАЗОВЫЕ СТИЛИ === */
:root {
    --primary-color: #ffc107;
    --dark-color: #121212;
    --light-color: #f4f4f4;
    --grey-color: #333;
    --font-main: 'Teko', sans-serif;
    --font-text: 'Roboto Condensed', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    background-color: var(--dark-color);
    color: var(--light-color);
    overflow-x: hidden;
    padding-top: 85px; /* Отступ для фиксированного хедера */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}


/* === 2. ХЕДЕР И НАВИГАЦИЯ === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 15px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.header .navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 85px;
}

.header .logo {
    font-family: var(--font-main);
    font-size: 2.2rem;
    text-decoration: none;
    color: var(--light-color);
    flex-shrink: 0;
}

.logo strong {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    justify-content: center;
    flex-grow: 1;
    list-style: none;
    gap: 40px;
}

.nav-menu li a {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #e0e0e0;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 10px 0;
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu li.active a {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.user-actions .btn-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    border: 2px solid #444;
    border-radius: 5px;
    background: transparent;
    color: #e0e0e0;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-actions .btn-user:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-actions .btn-user .user-text {
    text-align: left;
    line-height: 1.1;
}

.user-actions .btn-user .user-text span {
    display: block;
    font-family: var(--font-text);
    font-size: 1rem;
    font-weight: bold;
    text-transform: none;
}

.user-actions .btn-user .user-text .logout-text {
    font-size: 0.85rem;
    font-weight: normal;
    color: #aaa;
}

.user-actions .btn-basket {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color);
    color: var(--dark-color);
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    width: 55px;
    height: 55px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-actions .btn-basket i {
    font-size: 1.5rem;
}

.user-actions .btn-basket:hover {
    background-color: #ffca2c;
    border-color: #ffca2c;
}


/* === 3. СТРУКТУРА МАГАЗИНА (САЙДБАР + КОНТЕНТ) === */
.store-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
}

.store-sidebar {
    width: 280px;
    flex-shrink: 0;
}

main.store-content {
    flex-grow: 1;
    width: 100%;
    background-color: #2a2a2a;
    padding: 30px;
    border-radius: 8px;
    min-height: 800px;
}

.site-content-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.site-content-widgets .store-text {
    width: 100%;
    grid-column: 1 / -1;
    background: none !important;
    padding: 0 !important;
}

.site-content-widgets .store-sidebar {
    display: none;
}


/* === 4. САЙДБАР МАГАЗИНА (КАТЕГОРИИ И МОДУЛИ) === */
.sidebar-title {
    display: block;
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.store-sidebar .navigation-list {
    list-style: none;
    padding: 20px;
    margin: 0;
    background-color: #2a2a2a;
    border-radius: 8px;
}

.store-sidebar .navigation-list li a {
    display: block;
    padding: 12px 15px;
    color: #e0e0e0;
    text-decoration: none;
    font-family: var(--font-text);
    font-size: 1.1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.store-sidebar .navigation-list li a:hover {
    background-color: #383838;
    color: #fff;
}

.store-sidebar .navigation-list li.active > a {
    background-color: var(--primary-color);
    color: #1a1a1a;
    font-weight: 700;
}

.widget {
    background-color: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.widget-title {
    font-family: var(--font-main);
    font-size: 1.6rem; 
    line-height: 1.2;
    margin-bottom: 20px;
    text-transform: uppercase;
    color: #fff;
}

.widget-title::first-line {
    color: var(--primary-color);
}

.widget-recent .purchase {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    color: #e0e0e0;
}

.widget-recent .avatar {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background-color: #553c7b;
    padding: 5px;
    border-radius: 5px;
}

.widget-recent .username {
    font-family: var(--font-text);
    font-size: 1.1rem;
    font-weight: 700;
}

.widget .empty {
    color: #aaa;
    font-family: var(--font-text);
}


/* === 5. ВЫРАЗИТЕЛЬНЫЕ КАРТОЧКИ ТОВАРОВ === */
.category-title {
    font-family: var(--font-main);
    font-size: 2.8rem;
    color: var(--light-color);
    text-align: left;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid #444;
}
.category-description {
    font-family: var(--font-text);
    font-size: 1.1rem;
    color: #ccc;
    text-align: left;
    margin-bottom: 40px;
    line-height: 1.6;
}

main.store-content div[class^="store-products-"] {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.store-product {
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    background: linear-gradient(145deg, #333, #222);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid #444;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.store-product:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 193, 7, 0.3);
}

.store-product .image-link {
    margin-bottom: 20px;
    border-radius: 5px;
    overflow: hidden;
}
.store-product .image {
    max-width: 100%;
    height: 180px;
    object-fit: contain;
    transition: transform 0.4s ease;
}
.store-product:hover .image {
    transform: scale(1.1);
}

.store-product .product-title {
    font-family: var(--font-main);
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 15px;
    flex-grow: 1; 
}
.store-product .product-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}
.store-product:hover .product-title a {
    color: var(--primary-color) !important;
}

.product-actions {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.product-actions .price {
    width: 100%;
    color: var(--primary-color);
    font-family: var(--font-text);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-actions .add,
.product-actions .subscribe,
.product-actions .open-basket-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-main);
    font-size: 0.9rem; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 10px 5px;
    height: 50px;
    border-radius: 8px;
    flex: 1 1 120px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-actions .subscribe {
    background-color: var(--primary-color);
    color: #1a1a1a;
    border: 2px solid var(--primary-color);
}
.product-actions .add {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid #555;
}
.product-actions .add:hover,
.product-actions .subscribe:hover {
    background-color: var(--primary-color);
    color: #1a1a1a;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

main.store-content .store-product-full {
    max-width: 340px;
    margin: 0 auto;
}
.store-product-full .descr {
    display: none;
}
.store-product-full .actions {
    position: static !important;
    padding: 0 !important;
    background: none !important;
}


/* === 6. МОДАЛЬНЫЕ ОКНА (POPUP) И КОРЗИНА === */
.popup-content {
    background-color: #2a2a2a;
    border-radius: 8px;
    border: 1px solid #444;
}

.popup .btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #1a1a1a !important;
    font-family: var(--font-main);
    font-size: 1.2rem;
    padding: 12px 10px;
    height: 55px;
    border-radius: 8px;
    text-transform: uppercase;
}

.popup .btn-primary:hover {
    background-color: #ffca2c !important;
    border-color: #ffca2c !important;
}

.basket .basket-item .price,
.basket .basket-second-header .total,
.basket .basket-checkout .total {
    color: var(--primary-color) !important;
}

.basket .basket-item .price strong,
.basket .basket-second-header .total strong,
.basket .basket-checkout .total strong {
    font-family: var(--font-text);
    font-weight: 700;
}


/* === 7. СЧЕТЧИК ТОВАРОВ НА КОРЗИНЕ === */
.user-actions .btn-basket {
    position: relative;
    overflow: visible;
}
.basket-item-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff4d4d;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-text);
    font-size: 0.8rem;
    font-weight: 700;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.btn-basket.has-items .basket-item-count {
    transform: scale(1);
}


/* === 8. ФУТЕР === */
.site-footer {
    background-color: #1a1a1a;
    padding: 40px 0;
    border-top: 1px solid #333;
}
.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}
.footer-column {
    flex: 1;
    min-width: 200px;
}
.footer-column h4 {
    font-family: var(--font-main);
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 15px;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 10px;
}
.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-family: var(--font-text);
}
.footer-links a:hover {
    color: var(--primary-color);
}
.footer-column.payments {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.payment-methods {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
}
.payment-icon {
    width: 50px;
    height: 30px;
    background-color: #252525;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #ccc;
}
.site-footer-credit {
    display: none;
}


/* === 9. СТИЛИЗАЦИЯ ОКНА ОПЛАТЫ TEBEX CHECKOUT === */
#tebex-checkout-iframe .v-theme--dark {
    --v-theme-primary: var(--primary-color) !important;
    --v-theme-on-primary: #1a1a1a !important;
}
#tebex-checkout-iframe .v-btn__content {
    font-family: var(--font-main) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}


/* === 10. АДАПТИВНОСТЬ === */
@media (max-width: 992px) {
    .store-wrapper {
        flex-direction: column;
    }

    .store-sidebar {
        width: 100%;
        margin-bottom: 30px;
    }
}
/* ================================================================ */
/*             === 11. СЧЕТЧИК ТОВАРОВ В ФУТЕРЕ ===                 */
/* ================================================================ */

/* Стилизуем ссылку на корзину в футере */
.footer-basket-link a.open-basket {
    display: flex;
    justify-content: space-between; /* Текст слева, счетчик справа */
    align-items: center;
    position: relative;
}

/* Стили для счетчика в футере */
.footer-basket-link .basket-item-count {
    /* Мы не позиционируем его абсолютно, а просто стилизуем как есть */
    background-color: #ff4d4d;
    color: #fff;
    border-radius: 12px; /* Овальная форма */
    padding: 2px 8px;
    font-family: var(--font-text);
    font-size: 0.9rem;
    font-weight: 700;
    
    /* Анимация появления */
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* 
  Теперь нам нужен класс на родительском элементе <li>,
  чтобы показать/скрыть счетчик
*/
.footer-basket-link.has-items .basket-item-count {
    transform: scale(1);
}

/* ================================================================ */
/*     === 12. ФИНАЛЬНАЯ СТИЛИЗАЦИЯ МОДАЛЬНОГО ОКНА ТОВАРА ===    */
/* ================================================================ */

/* --- Фон-затемнение для всех модальных окон --- */
.popup {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px); /* Эффект размытия фона */
}

/* --- Контейнер для модального окна товара --- */
/* Мы используем более точный селектор, чтобы не затрагивать другие окна */
.store-product-popup .popup-content {
    /* ЗАДАЕМ КОМПАКТНУЮ ШИРИНУ */
    max-width: 550px !important;
    width: 90% !important;
    
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 35px;
    text-align: center;
}

/* --- Заголовок товара в окне --- */
.store-product-popup .product-title {
    font-size: 2.2rem;
    margin-bottom: 25px;
}

/* --- Изображение товара --- */
.store-product-popup .image {
    max-width: 250px; /* Ограничиваем размер изображения */
    height: auto;
    margin: 0 auto 25px auto;
}
.store-product-popup:hover .image {
    transform: none;
}

/* --- Описание товара --- */
.store-product-popup .descr {
    display: block !important;
    font-family: var(--font-text);
    font-size: 1rem;
    color: #ccc;
    line-height: 1.6;
    margin: 25px 0;
    padding-top: 25px;
    border-top: 1px solid #444; /* Линия-разделитель */
    text-align: left; /* Делаем описание читабельным */
}

/* --- Блок с кнопками и ценой --- */
.store-product-popup .actions {
    position: static !important;
    padding: 25px 0 0 0 !important;
    background: none !important;
    margin: 0; 
    width: 100%;
    border-top: 1px solid #444;
}

/* --- ИСПРАВЛЕНИЕ КНОПОК: СТАВИМ В ОДНУ СТРОКУ --- */
.store-product-popup .product-actions {
    display: flex;
    flex-direction: row; /* <- ГЛАВНОЕ ПРАВИЛО */
    justify-content: center; /* Центрируем кнопки */
    gap: 15px; /* Расстояние между кнопками */
}

/* --- Уменьшаем кнопки, чтобы они помещались --- */
.store-product-popup .product-actions .add,
.store-product-popup .product-actions .subscribe {
    flex-grow: 0 !important; /* Отключаем растягивание */
    flex-basis: auto !important; /* Автоматическая ширина */
    width: auto;
    padding: 10px 25px !important; /* Устанавливаем комфортные отступы */
    height: 50px !important;
    font-size: 1rem !important; /* Уменьшаем текст */
}

/* --- СБРОС ТЕБЕКСА И НАСТРОЙКА ШАПКИ --- */
.custom-tebex-header {
    background-color: #111111; /* Темный фон шапки */
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
    border-bottom: 2px solid #222; /* Легкая линия снизу (опционально) */
}

.custom-tebex-header * {
    box-sizing: border-box;
}

.custom-tebex-header .header-container {
    max-width: 1200px; /* Ширина как на основном сайте */
    margin: 0 auto;
    padding: 0 15px;
}

.custom-tebex-header .navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- ЛОГОТИП --- */
.custom-tebex-header .logo {
    font-family: 'Teko', sans-serif;
    font-size: 32px;
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
    letter-spacing: 1px;
}

.custom-tebex-header .logo strong {
    color: #ffc107; /* Ваш желтый акцент */
}

/* --- ВЫРАВНИВАНИЕ МЕНЮ И КОРЗИНЫ --- */
.custom-tebex-header .nav-right-side {
    display: flex;
    align-items: center;
    gap: 30px; /* Расстояние между меню и кнопками юзера */
}

/* --- НАВИГАЦИЯ --- */
.custom-tebex-header .nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.custom-tebex-header .nav-menu li {
    margin: 0;
    padding: 0;
}

.custom-tebex-header .nav-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.custom-tebex-header .nav-menu a:hover,
.custom-tebex-header .nav-menu a.active {
    color: #ffc107;
}

/* --- КНОПКИ ПОЛЬЗОВАТЕЛЯ И КОРЗИНЫ --- */
.custom-tebex-header .user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-tebex-header .header-btn {
    background: transparent;
    border: 1px solid #ffc107;
    color: #ffc107;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.custom-tebex-header .header-btn:hover {
    background: #ffc107;
    color: #111;
    text-decoration: none;
}

.custom-tebex-header .header-user .user-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.custom-tebex-header .header-user .logout-text {
    font-size: 10px;
    opacity: 0.8;
}

/* Счетчик на корзине */
.custom-tebex-header .header-basket {
    position: relative;
}

.custom-tebex-header .basket-count {
    background: #ffc107;
    color: #111;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    position: absolute;
    top: -10px;
    right: -10px;
    transition: all 0.3s ease;
}

.custom-tebex-header .header-basket:hover .basket-count {
    background: #111;
    color: #ffc107;
}

/* Мобильная адаптация (скрываем текст меню, оставляем лого и корзину) */
@media (max-width: 992px) {
    .custom-tebex-header .nav-menu {
        display: none; 
    }
}



/* --- СБРОС ТЕБЕКСА И НАСТРОЙКА ШАПКИ --- */
.custom-tebex-header {
    background-color: #111111 !important; 
    padding: 15px 0 !important; /* Жестко задаем отступ только 15px */
    margin: 0 !important; /* Убираем любые внешние отступы */
    min-height: unset !important; /* Убиваем огромную высоту Tebex */
    height: auto !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
    border-bottom: 2px solid #222;
    display: block !important;
}

.custom-tebex-header .nav-menu {
    display: flex;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    gap: 20px;
    align-items: center; /* Центрируем текст по вертикали */
}