/* Цветовая палитра: современные оттенки желтого */
:root {
    --yellow-primary: #FFD700; /* Золотой желтый */
    --yellow-secondary: #FFC107; /* Янтарный */
    --yellow-light: #FFF176; /* Светло-желтый */
    --yellow-dark: #F57C00; /* Темно-оранжевый */
    --yellow-gradient: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
    --yellow-gradient-dark: linear-gradient(135deg, #FFC107 0%, #F57C00 100%);
    --yellow-hover: #FFEB3B; /* Ярко-желтый для hover */
    --yellow-shadow: rgba(255, 193, 7, 0.3); /* Тень желтого */
    --yellow-shadow-dark: rgba(245, 124, 0, 0.4); /* Темная тень */
}

/* Глобально: Arial, жирный через Arial Bold, без подчёркивания ссылок */
* {
    font-family: Arial, sans-serif;
}
a, a:hover, a:focus, a:visited {
    text-decoration: none !important;
}
b, strong, .font-weight-bold, [class*="bold"] {
    font-weight: bold;
    font-family: Arial, sans-serif;
}

/* Стили для уведомления об успехе */
.success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
}

.success-notification i {
    font-size: 20px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Стили для структуры */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Сайдбар с категориями слева - НАД контентом */
.categories-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 60px; /* Ширина в закрытом состоянии */
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000; /* Высокий z-index */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease;
    padding-top: 20px;
}

.categories-sidebar.open {
    width: 250px; /* Ширина в открытом состоянии */
}

/* Сайдбары справа (авторизация и корзина) */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1001; /* Выше чем левый сайдбар */
    overflow-x: hidden;
    transition: width 0.3s ease;
}

.right-sidebar.open {
    width: 350px; /* Ширина в открытом состоянии */
}

.right-sidebar-header {
    padding: 20px;
    background: var(--yellow-gradient);
    color: #333; /* Темный текст на желтом фоне */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.right-sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Стили для кнопок закрытия сайдбаров */
.right-sidebar .close-sidebar {
    background: none;
    border: none;
    color: #333;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
    line-height: 1;
    z-index: 2;
    position: relative;
}

.right-sidebar .close-sidebar:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* ОБНОВЛЕНО: Улучшенные отступы для контента сайдбаров */
.right-sidebar-content {
    padding: 25px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    box-sizing: border-box;
    /* Плавная анимация для контента */
    animation: slideInContent 0.3s ease-out;
}

@keyframes slideInContent {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Улучшенный скроллбар для сайдбаров */
.right-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.right-sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.right-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--yellow-secondary);
    border-radius: 10px;
}

.right-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #e6b400;
}

/* Главная иконка меню в сайдбаре */
.sidebar-menu-icon {
    width: 50px;
    height: 50px;
    background: var(--yellow-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 22px;
    cursor: pointer;
    margin: 0 auto 30px auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--yellow-shadow);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Когда сайдбар открыт - расширяем иконку меню */
.categories-sidebar.open .sidebar-menu-icon {
    width: calc(100% - 39px); /* 15px слева + 24px справа */
    height: 50px;
    border-radius: 8px;
    margin: 0 24px 30px 15px; /* отступ от правого края сайдбара в открытом состоянии */
    justify-content: flex-start;
    padding-left: 15px;
}

/* Текст "Категории" в иконке меню */
.sidebar-menu-text {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 600;
    color: #333;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.3s ease 0.1s;
    pointer-events: none;
}

/* Когда сайдбар открыт - показываем текст */
.categories-sidebar.open .sidebar-menu-text {
    opacity: 1;
    left: 50px;
}

.sidebar-menu-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--yellow-shadow-dark);
}

/* Контейнер для списка категорий */
.categories-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 5px;
}

.categories-sidebar.open .categories-list {
    align-items: flex-start;
    padding: 0 15px;
}

/* Заголовок категории (показывается при открытии) */
.categories-title {
    display: none;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-left: 10px;
    width: 100%;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.categories-sidebar.open .categories-title {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Мини-иконки категорий */
.category-mini-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--yellow-secondary);
    font-size: 18px;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 15px;
    position: relative;
}

/* В закрытом состоянии иконки центрированы */
.categories-sidebar:not(.open) .category-mini-icon {
    justify-content: center;
}

/* В открытом состоянии иконки выравниваются по левому краю */
.categories-sidebar.open .category-mini-icon {
    width: calc(100% - 20px);
    justify-content: flex-start;
    padding-left: 10px;
}

.category-mini-icon:hover {
    background: rgba(255, 193, 7, 0.1);
    transform: scale(1.05);
}

/* Иконка внутри */
.category-mini-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

/* Название категории (показывается при открытии) */
.category-name {
    display: none;
    margin-left: 10px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.categories-sidebar.open .category-name {
    display: inline-block;
    opacity: 1;
    transform: translateX(0);
}

/* Основной контент - БЕЗ отступа для сайдбара */
.main-content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: relative;
    z-index: 2;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--yellow-secondary);
    font-size: 32px;
}

.search-bar {
    flex: 1;
    max-width: 500px;
}

.search-bar form {
    display: flex;
    position: relative;
}

.search-bar input {
    flex: 1;
    padding: 12px 20px;
    padding-left: 45px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--yellow-secondary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.search-bar button {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--yellow-secondary);
    cursor: pointer;
    font-size: 18px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.action-btn i {
    font-size: 20px;
    margin-bottom: 4px;
}

.action-btn:hover {
    color: var(--yellow-secondary);
}

.cart-btn, .auth-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Мобильная кнопка меню */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    margin-right: 10px;
    align-items: center;
    justify-content: center;
}

/* Мобильные иконки справа */
.mobile-header-actions {
    display: none;
    align-items: center;
    gap: 15px;
}

.mobile-action-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.mobile-action-btn:hover {
    color: var(--yellow-secondary);
}

.mobile-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Navigation */
.nav-container {
    background: white;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    z-index: 2;
}

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

.nav-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-categories {
    position: relative;
}

.nav-categories-btn {
    background: var(--yellow-gradient);
    color: #333;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.nav-categories-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--yellow-shadow-dark);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 15px 0;
    position: relative;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover {
    color: var(--yellow-secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--yellow-gradient);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Main Content */
.main-container {
    flex: 1;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-radius: 16px;
    padding: 60px;
    margin-bottom: 40px;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-content p {
    font-size: 20px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn {
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--yellow-gradient);
    color: #333;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px var(--yellow-shadow);
}

/* ОБНОВЛЕНО: Улучшенные стили для форм в сайдбаре авторизации */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    padding-left: 5px;
}

.form-group input {
    padding: 14px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--yellow-secondary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
    padding: 0 5px;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

.btn-login {
    background: var(--yellow-gradient);
    color: #333;
    border: none;
}

.btn-register {
    background: white;
    color: var(--yellow-secondary);
    border: 2px solid var(--yellow-secondary);
}

.btn-login:hover, .btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    padding: 20px 5px 0;
}

.auth-links a {
    color: var(--yellow-secondary);
    text-decoration: none;
    font-size: 14px;
}

.auth-links a:hover {
    text-decoration: none;
}

/* ОБНОВЛЕНО: Улучшенные стили для контента сайдбара корзины */
.cart-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 12px;
    border-bottom: 1px solid #eee;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Блок «Войти / Регистрация» для гостей в сайдбаре и на странице корзины */
.cart-guest-auth {
    border-top: 1px solid #dee2e6;
    margin-top: 16px;
    padding-top: 16px;
}
.cart-guest-auth p {
    margin-bottom: 10px;
    font-size: 14px;
    color: #495057;
}
.cart-guest-auth .btn {
    margin-right: 8px;
    margin-bottom: 4px;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    flex-shrink: 0;
    border: 1px solid #eee;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-image i {
    font-size: 20px;
    color: #888;
}

.cart-item-info {
    flex: 1;
    padding: 0 5px;
    min-width: 0; /* Для правильного обрезания текста */
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-item-price {
    color: var(--yellow-secondary);
    font-weight: 600;
    font-size: 16px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.quantity-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 36px;
    height: 26px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
}

.remove-item {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #ffcccc;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ff6b6b;
    transition: all 0.2s;
    margin-left: 4px;
}

.remove-item:hover {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}
/* Вторая строка: информация о товаре */
.cart-item-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-type {
    display: inline-block;
    font-size: 10px;
    color: #e67e22;
    background: #fef9f3;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    border: 1px solid #ffd8b2;
    vertical-align: middle;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .cart-item-header {
        gap: 8px;
    }

    .cart-item-image {
        width: 45px;
        height: 45px;
    }

    .quantity-btn, .remove-item {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }

    .quantity-input {
        width: 34px;
        height: 24px;
    }

    .cart-item-name {
        font-size: 12px;
    }

    .cart-item-price {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cart-item {
        padding: 10px;
    }

    .cart-item-image {
        width: 40px;
        height: 40px;
    }

    .quantity-btn, .remove-item {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .quantity-input {
        width: 32px;
        height: 22px;
    }
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px;
    font-size: 14px;
}

.remove-item {
    color: #ef4444;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
    font-size: 16px;
    transition: all 0.2s;
    border-radius: 4px;
}

.remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
}

.cart-total {
    margin-top: 25px;
    padding: 20px 15px;
    border-top: 2px solid #e5e7eb;
    background: #f9f9f9;
    border-radius: 10px;
    box-sizing: border-box;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.total-amount {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding: 0 5px;
}

.btn-cart {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
}

.btn-checkout {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-view-cart {
    background: white;
    color: var(--yellow-secondary);
    border: 2px solid var(--yellow-secondary);
}

.btn-view-cart:hover {
    background: rgba(255, 193, 7, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.2);
}

.empty-cart {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

.empty-cart h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #555;
}

.empty-cart p {
    font-size: 16px;
    color: #888;
    margin-bottom: 30px;
}

/* Products Section */
.products-section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 28px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.section-header h2 i {
    color: var(--yellow-secondary);
}

.view-all {
    color: var(--yellow-secondary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all:hover {
    text-decoration: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 30px;;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #ef4444;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.product-image {
    height: 180px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

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

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image .fa-box-open {
    font-size: 48px;
    color: #ccc;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.current-price {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.old-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-add-to-cart {
    flex: 1;
    background: var(--yellow-gradient);
    color: #333;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-add-to-cart:hover {
    background: var(--yellow-gradient-dark);
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
    margin-bottom: 0;
}

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

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 20px;
    margin-bottom: 25px;
    color: white;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--yellow-gradient);
}

.footer-column p {
    color: #9ca3af;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-column ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: var(--yellow-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #374151;
    color: #9ca3af;
    font-size: 14px;
}

/* Убираем лишний отступ после футера на всех страницах */
html {
    padding-bottom: 0 !important;
}
body {
    padding-bottom: 0 !important;
}
.main-content-wrapper {
    padding-bottom: 0 !important;
}

/* Кнопка меню для мобильных с надписью */
.mobile-menu-button {
    display: none;
}

/* Оверлей для сайдбара на мобильных */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* ОБНОВЛЕНО: КРИТИЧЕСКИ ВАЖНЫЕ ИСПРАВЛЕНИЯ ДЛЯ МОБИЛЬНЫХ */
@media (max-width: 1024px) {
    .categories-sidebar.mobile-open .sidebar-menu-icon {
        width: calc(100% - 30px);
        height: 50px;
        border-radius: 8px;
        margin: 0 15px 30px 15px;
        justify-content: flex-start;
        padding-left: 15px;
    }

    .categories-sidebar.mobile-open .sidebar-menu-text {
        opacity: 1;
        left: 50px;
    }

    /* ИСПРАВЛЕНО: Мобильные сайдбары теперь с отступами */
    .right-sidebar.open {
        width: calc(100% - 40px) !important; /* Оставляем отступы по бокам */
        left: 20px !important; /* Центрируем */
        right: 20px !important; /* Центрируем */
        border-radius: 12px !important; /* Скругляем углы */
        overflow: hidden !important;
        box-shadow: 0 5px 30px rgba(0,0,0,0.3) !important; /* Тень */
        max-height: 85vh !important;
        top: 7.5vh !important;
    }

    /* ФИКС для контента сайдбаров */
    .right-sidebar-content {
        width: 100% !important;
        padding: 25px 20px !important;
        box-sizing: border-box !important;
        max-height: calc(85vh - 70px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    /* ФИКС для полей ввода и кнопок */
    #authSidebar .form-group input,
    #authSidebar .btn-auth,
    #cartSidebar .btn-cart {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 14px 15px !important;
    }

    /* ФИКС для элементов корзины */
    #cartSidebar .cart-item {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 15px !important;
        margin: 0 0 10px 0 !important;
    }

    /* ФИКС для кнопки закрытия */
    .right-sidebar .close-sidebar {
        position: absolute !important;
        right: 15px !important;
        top: 15px !important;
        z-index: 1002 !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        width: 35px !important;
        height: 35px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ФИКС для заголовка */
    .right-sidebar-header {
        padding: 20px 50px 20px 20px !important;
        position: relative !important;
        z-index: 1 !important;
        min-height: 70px !important;
        display: flex !important;
        align-items: center !important;
    }

    .right-sidebar-header h3 {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 18px !important;
        line-height: 1.3 !important;
    }

    /* ФИКС для формы авторизации */
    #authSidebar .auth-form {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* ФИКС для контейнера кнопок в корзине */
    #cartSidebar .cart-actions {
        width: 100% !important;
        padding: 0 !important;
        margin: 15px 0 0 0 !important;
        box-sizing: border-box !important;
    }

    #cartSidebar .cart-actions .btn-cart {
        margin-bottom: 10px !important;
    }

    #cartSidebar .cart-actions .btn-cart:last-child {
        margin-bottom: 0 !important;
    }

    /* Мобильная шапка */
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-header-actions {
        display: flex;
    }

    /* Скрываем элементы на мобильных */
    .search-bar {
        display: none;
    }

    /* Скрываем кнопки "Сравнение" и "Избранное" на мобильных */
    .compare-btn,
    .wishlist-btn {
        display: none !important;
    }

    /* ФИКС: Показываем названия категорий в мобильном сайдбаре */
    .categories-sidebar.mobile-open {
        width: 65% !important;
        max-width: none !important;
        display: flex !important;
        transform: translateX(0) !important;
    }

    .categories-sidebar.mobile-open .categories-list {
        width: 100% !important;
        align-items: flex-start !important;
        padding: 0 15px !important;
        overflow-x: hidden !important;
    }

    .categories-sidebar.mobile-open .category-mini-icon {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 10px 10px !important;
        margin: 0 0 10px 0 !important;
        border-radius: 6px !important;
        background: transparent !important;
        transition: all 0.3s ease !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .categories-sidebar.mobile-open .category-mini-icon:hover {
        background: rgba(255, 193, 7, 0.1) !important;
    }

    .categories-sidebar.mobile-open .category-name {
        display: inline-block !important;
        margin-left: 12px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #333 !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 170px !important;
    }

    .categories-sidebar.mobile-open .category-mini-icon i {
        font-size: 18px !important;
        min-width: 24px !important;
        text-align: center !important;
    }

    .categories-sidebar.mobile-open .sidebar-menu-icon {
        width: calc(100% - 30px) !important;
        margin: 0 15px 20px 15px !important;
        justify-content: flex-start !important;
        padding-left: 15px !important;
    }

    .categories-sidebar.mobile-open .sidebar-menu-text {
        opacity: 1 !important;
        left: 50px !important;
        position: static !important;
        transform: none !important;
        margin-left: 10px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
    }

    /* Скрываем десктопные кнопки авторизации и корзины на мобильных */
    .desktop-auth-btn,
    .desktop-cart-btn {
        display: none !important;
    }

    /* Центрируем логотип */
    .logo {
        flex: 1;
        text-align: center;
        margin: 0 10px;
    }

    .logo a {
        justify-content: center;
    }

    /* Корректируем отступы */
    .header-content {
        justify-content: space-between;
        gap: 10px;
    }

    .categories-sidebar {
        display: none;
    }

    .categories-sidebar.mobile-open {
        display: flex;
        transform: translateX(0);
        width: 65% !important;
        max-width: none !important;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    }

    .categories-sidebar:not(.mobile-open) {
        transform: translateX(-100%);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 18px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
    }

    .nav-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    .nav-links {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        gap: 15px;
    }

    .right-sidebar.open {
        width: calc(100% - 30px) !important;
        left: 15px !important;
        right: 15px !important;
    }

    .hero-banner {
        padding: 40px 20px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 16px;
    }

    /* Улучшаем отступы для очень маленьких экранов */
    .right-sidebar-content {
        padding: 20px 15px !important;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .cart-item-info {
        text-align: center;
    }

    .cart-item-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 20px;
    }

    .logo i {
        font-size: 24px;
    }

    .mobile-action-btn {
        padding: 6px;
        font-size: 16px;
    }

    .mobile-menu-toggle {
        padding: 8px;
        margin-right: 5px;
    }

    /* ДОПОЛНИТЕЛЬНЫЕ ФИКСЫ ДЛЯ ТЕЛЕФОНОВ */
    .right-sidebar.open {
        width: calc(100% - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        max-height: 90vh !important;
        top: 5vh !important;
    }

    .right-sidebar-content {
        padding: 15px 12px !important;
        max-height: calc(90vh - 70px) !important;
    }

    /* Уменьшаем размеры для телефонов */
    #authSidebar .form-group input,
    #authSidebar .btn-auth,
    #cartSidebar .btn-cart {
        padding: 12px 15px !important;
        font-size: 15px !important;
    }

    .cart-item {
        padding: 12px !important;
        flex-wrap: wrap !important;
    }

    .cart-item-image {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0 !important;
    }

    .cart-item-info {
        min-width: 0 !important;
        flex: 1 !important;
        padding: 0 10px !important;
    }

    .cart-item-name {
        font-size: 13px !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 1 !important;
    }

    .cart-item-actions {
        width: 100% !important;
        margin-top: 10px !important;
        justify-content: center !important;
    }

    .right-sidebar-header {
        padding: 15px 45px 15px 15px !important;
        min-height: 60px !important;
    }

    .right-sidebar-header h3 {
        font-size: 16px !important;
    }

    .right-sidebar .close-sidebar {
        right: 10px !important;
        top: 10px !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 24px !important;
    }
}

/* Стили для блока "Наши сборки" */
.assemblies-section {
    margin: 60px 0;
}

.assemblies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.assembly-card {
    background: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.assembly-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.assembly-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.assembly-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.assembly-card:hover .assembly-image img {
    transform: scale(1.05);
}

.assembly-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.assembly-image .no-image i {
    font-size: 60px;
    color: #667eea;
    opacity: 0.7;
}

.assembly-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.assembly-info {
    padding: 25px;
}

.assembly-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
}

.assembly-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.assembly-components {
    margin-bottom: 25px;
}

.assembly-components h4 {
    font-size: 15px;
    font-weight: 600;
    color: #444;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.assembly-components h4 i {
    color: #FFC107;
}

.component-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #555;
}

.component-item i {
    color: #4CAF50;
    font-size: 12px;
}

.component-more {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
    color: #777;
    font-style: italic;
}

.component-more i {
    color: #999;
}

.assembly-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-add-assembly, .btn-view-assembly {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-add-assembly {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: white;
}

.btn-add-assembly:hover {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.btn-view-assembly {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-view-assembly:hover {
    background: #e9e9e9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Стили для пустого состояния */
.no-assemblies {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.no-assemblies-icon {
    font-size: 60px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-assemblies h3 {
    font-size: 22px;
    color: #666;
    margin-bottom: 10px;
}

.no-assemblies p {
    font-size: 16px;
    color: #888;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .assemblies-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .assemblies-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .assembly-image {
        height: 180px;
    }

    .assembly-info {
        padding: 20px;
    }
}

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

    .assembly-actions {
        flex-direction: column;
    }

    .btn-add-assembly,
    .btn-view-assembly {
        width: 100%;
    }
}

/* Убираем старую кнопку мобильного меню */
.mobile-menu-button {
    display: none;
}

/* Мобильная навигация снизу */
.mobile-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
    text-decoration: none;
    font-size: 12px;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-nav-item i {
    font-size: 18px;
}

.mobile-nav-item.active {
    color: var(--yellow-secondary);
}

.mobile-nav-item:hover {
    color: var(--yellow-secondary);
}

/* Показываем мобильную навигацию только на мобильных */
@media (min-width: 1025px) {
    .mobile-navigation {
        display: none;
    }
}

/* Отступы контента на мобильных — симметричные слева/справа */
@media (max-width: 1024px) {
    .container.main-container,
    .section .container,
    .main-slider-offer .container,
    .assemblies-section .container,
    .assemblies-section {
        padding-left: 20px !important;
        padding-right: 20px !important;
        padding-inline: 20px !important;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .container.main-container,
    .section .container,
    .main-slider-offer .container,
    .assemblies-section .container,
    .assemblies-section {
        padding-left: 15px !important;
        padding-right: 15px !important;
        padding-inline: 15px !important;
    }
}

@media (max-width: 480px) {
    .container.main-container,
    .section .container,
    .main-slider-offer .container,
    .assemblies-section .container,
    .assemblies-section {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-inline: 12px !important;
    }
}

/* Принудительно ограничиваем ширину карточек сборок */
@media (max-width: 1024px) {
    .assembly-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
    }

    /* Если карточки в гриде не вмещаются */
    .assemblies-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        grid-auto-flow: row !important;
        justify-content: center !important;
    }
}

/* Для более узких экранов */
@media (max-width: 768px) {
    .assemblies-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .assemblies-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    /* На маленьких экранах чуть компактнее пункты нижнего меню */
    .mobile-nav-item {
        padding: 5px 3px !important;
    }

    .mobile-nav-item i {
        font-size: 16px !important;
    }

    .mobile-nav-item span {
        font-size: 10px !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    /* Равномерное распределение пунктов меню */
    .mobile-nav-item {
        flex: 1 !important;
        min-width: 0 !important;
    }
}

/* Если меню выходит за экран, уменьшаем отступы между пунктами */
@media (max-width: 320px) {
    .mobile-navigation {
        padding-left: 20px !important;
        padding-right: 20px !important;
        gap: 5px !important;
    }

    .mobile-nav-item {
        padding: 4px 2px !important;
    }

    .mobile-nav-item i {
        font-size: 14px !important;
    }

    .mobile-nav-item span {
        font-size: 9px !important;
    }
}

/* ФИКС: Скрываем все лишние кнопки в сайдбарах */
.right-sidebar .modal-close,
.right-sidebar .btn-modal,
.right-sidebar .modal-footer,
.right-sidebar .modal-header:not(.right-sidebar-header) {
    display: none !important;
}

/* Убеждаемся, что кнопки закрытия ВСЕГДА видны */
.right-sidebar .close-sidebar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Стили для модального окна сборок (отдельно) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #333;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
    z-index: 10;
}

/* В шапке модалки кнопка в потоке, чтобы не перекрывать название на мобильных */
.modal-header .modal-close {
    position: static;
    top: auto;
    right: auto;
}

.modal-content .modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    background: var(--yellow-gradient);
    color: #333;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-modal {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #ddd;
}

.btn-modal-primary {
    background: var(--yellow-gradient);
    color: #333;
    border: none;
}

.btn-modal-primary:hover {
    background: var(--yellow-gradient-dark);
}

.btn-modal-secondary {
    background: white;
    color: #666;
}

.btn-modal-secondary:hover {
    background: #f5f5f5;
}

/* КРИТИЧЕСКИ ВАЖНО: Удаляем все дублирующиеся стили для кнопок закрытия */
.right-sidebar .close-sidebar::before,
.modal-content .modal-close::before {
    display: block;
}

/* Защита от дублирования: скрываем все элементы с классом close-sidebar,
   кроме тех, что непосредственно в .right-sidebar-header */
.right-sidebar .close-sidebar:not(.right-sidebar-header .close-sidebar) {
    display: none !important;
}

/* Явно показываем кнопки закрытия только в заголовках сайдбаров */
.right-sidebar-header .close-sidebar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ДОБАВЬТЕ В КОНЕЦ ФАЙЛА style.css */

/* ФИКС: Добавляем margin-right на кнопку закрытия */
@media (max-width: 768px) {
    .right-sidebar .close-sidebar {
        margin-right: 45px !important; /* Добавляем отступ справа */
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .right-sidebar .close-sidebar {
        margin-right: 40px !important; /* Меньше отступ на маленьких экранах */
    }
}

.right-sidebar .close-sidebar::before {
    /* content: '×'; */ /* ← ЗАКОММЕНТИРОВАНО */
    display: block;
}

/* Стили для табов в мобильном сайдбаре */
.sidebar-tabs {
    display: none;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.categories-sidebar.mobile-open .sidebar-tabs {
    display: flex !important;
    width: 100% !important;
    border-bottom: 1px solid #e5e7eb !important;
    margin-bottom: 20px !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
}

.sidebar-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.sidebar-tab:hover {
    color: var(--yellow-secondary);
}

.sidebar-tab.active {
    color: var(--yellow-secondary);
}

.sidebar-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--yellow-gradient);
}

/* Контейнеры содержимого табов */
.sidebar-tab-content {
    display: none !important;
    width: 100% !important;
    padding: 0 !important;
    flex-direction: column !important;
}

.sidebar-tab-content.active {
    display: flex !important;
}

/* Исправляем стили для таба "Категории" */
#tabContentCategories {
    display: none !important;
}

#tabContentCategories.active {
    display: flex !important;
}

/* Исправляем стили для списка категорий в табе */
#tabContentCategories .categories-list {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin-top: 10px !important;
}

/* Стили для категорий как для пунктов навигации в мобильном сайдбаре */
#tabContentCategories .category-mini-icon {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 15px !important;
    color: #333 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    transition: all 0.3s !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    width: 100% !important;
    justify-content: flex-start !important;
    background: transparent !important;
    border: none !important;
    text-align: left !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    position: relative !important;
}

#tabContentCategories .category-mini-icon:hover {
    background: rgba(255, 193, 7, 0.1) !important;
    transform: translateX(5px) !important;
}

#tabContentCategories .category-mini-icon i {
    font-size: 18px !important;
    color: var(--yellow-secondary) !important;
    width: 24px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

#tabContentCategories .category-name {
    display: inline-block !important;
    margin-left: 0 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #333 !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
}

/* Удаляем старое отображение категорий вне табов */
.categories-sidebar.mobile-open .categories-list {
    display: none !important;
}

/* Показываем категории только когда активен соответствующий таб */
.categories-sidebar.mobile-open #tabContentCategories.active .categories-list {
    display: flex !important;
}

/* Стили для мобильного меню навигации в сайдбаре */
.mobile-sidebar-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 15px !important;
}

.mobile-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: 500;
}

.mobile-sidebar-nav-item:hover {
    background: rgba(255, 193, 7, 0.1);
    transform: translateX(5px);
}

.mobile-sidebar-nav-item i {
    font-size: 18px;
    color: var(--yellow-secondary);
    width: 24px;
    text-align: center;
}

.mobile-sidebar-nav-item.active {
    background: var(--yellow-gradient);
    color: #333;
    font-weight: 600;
}

.mobile-sidebar-nav-item.active i {
    color: #333;
}

/* Разделитель в навигации */
.sidebar-nav-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 15px 0;
    width: 100%;
}

/* Обновленные стили для контента сайдбара */
.categories-sidebar.mobile-open .categories-list {
    padding: 0;
}

.categories-sidebar.mobile-open .sidebar-menu-icon {
    display: none;
}

/* ФИКС для отображения названий категорий в мобильном сайдбаре */
@media (max-width: 1024px) {
    .categories-sidebar.mobile-open {
        width: 65% !important;
        max-width: none !important;
        display: flex !important;
        transform: translateX(0) !important;
    }

    .categories-sidebar.mobile-open .categories-list {
        width: 100% !important;
        align-items: flex-start !important;
        padding: 0 15px !important;
        overflow-x: hidden !important;
    }

    .categories-sidebar.mobile-open .category-mini-icon {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 10px 10px !important;
        margin: 0 0 10px 0 !important;
        border-radius: 6px !important;
        background: transparent !important;
        transition: all 0.3s ease !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    .categories-sidebar.mobile-open .category-mini-icon:hover {
        background: rgba(255, 193, 7, 0.1) !important;
    }

    .categories-sidebar.mobile-open .category-name {
        display: inline-block !important;
        margin-left: 12px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #333 !important;
        opacity: 1 !important;
        transform: translateX(0) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 170px !important;
    }

    .categories-sidebar.mobile-open .category-mini-icon i {
        font-size: 18px !important;
        min-width: 24px !important;
        text-align: center !important;
    }

    .categories-sidebar.mobile-open .sidebar-menu-icon {
        display: none !important;
    }
}

/* Адаптация для узких экранов */
@media (max-width: 768px) {
    .sidebar-tab {
        padding: 10px 8px;
        font-size: 13px;
    }

    .mobile-sidebar-nav-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    .categories-sidebar.mobile-open {
        width: 65% !important;
        max-width: none !important;
    }

    .category-name {
        max-width: 140px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .sidebar-tab {
        padding: 10px 5px;
        font-size: 12px;
    }

    .mobile-sidebar-nav-item {
        padding: 8px 10px;
        font-size: 13px;
    }

    .categories-sidebar.mobile-open {
        width: 65% !important;
        max-width: none !important;
    }

    .category-name {
        max-width: 120px !important;
        font-size: 12px !important;
    }
}

/* Улучшение отображения на очень узких экранах */
@media (max-width: 360px) {
    .sidebar-tab {
        padding: 8px 3px;
        font-size: 11px;
    }

    .categories-sidebar.mobile-open {
        width: 65% !important;
        max-width: none !important;
    }
}

/* ДОБАВЛЕНО: Стили для скрытия десктопной навигации на мобильных */
@media (max-width: 1024px) {
    .desktop-nav-container {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .mobile-navigation {
        display: none !important;
    }
}

/* ДОБАВЛЕНО: Дополнительные фиксы для мобильных сайдбаров */

/* 1. ФИКС для горизонтального скролла */
.right-sidebar,
.right-sidebar-content,
.right-sidebar * {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* 2. ФИКС для переноса длинного текста в кнопках */
.btn-auth,
.btn-cart {
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
    line-height: 1.4 !important;
}

/* 3. ФИКС для инпутов - предотвращаем увеличение в iOS */
input[type="email"],
input[type="password"],
input[type="text"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: 8px !important;
    font-size: 16px !important; /* Предотвращает zoom в iOS */
}

/* 4. ФИКС для viewport на мобильных */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden !important;
        position: relative !important;
        width: 100% !important;
    }

    /* Глобальный анти-overflow для мобильных: контейнеры не должны выходить за viewport */
    .container,
    .header .container,
    .footer .container,
    .main-content-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Медиа/картинки не должны распирать ширину */
    img, svg, video, canvas {
        max-width: 100%;
        height: auto;
    }
}

/* Фикс для узких экранов: чаще всего распирают header/footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr !important;
    }

    .header-content {
        flex-wrap: wrap !important;
    }

    .search-bar {
        min-width: 0;
        max-width: 100%;
    }

    .search-bar input {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* 5. ОБЯЗАТЕЛЬНОЕ ДОБАВЛЕНИЕ В JS - ПРЕДОТВРАЩАЕМ СКРОЛЛ ТЕЛА */
body.sidebar-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* 6. ФИКС для оверлея */
.sidebar-overlay.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    z-index: 999 !important;
    display: block !important;
}

/* 7. ЭКСТРЕННЫЙ ФИКС ДЛЯ МОБИЛЬНЫХ САЙДБАРОВ - ЖЕСТКО ОГРАНИЧИВАЕМ */
@media (max-width: 1024px) {
    /* Жестко ограничиваем все элементы */
    .right-sidebar * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Принудительно обрезаем выходящий контент */
    .right-sidebar {
        overflow: hidden !important;
    }

    /* Абсолютный фикс для инпутов и кнопок */
    .right-sidebar input,
    .right-sidebar button,
    .right-sidebar .btn-auth,
    .right-sidebar .btn-cart {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Увеличиваем зону клика для маленьких экранов */
    .right-sidebar .btn-auth,
    .right-sidebar .btn-cart {
        min-height: 44px !important; /* Минимальная высота для touch */
    }

    /* Улучшаем отображение иконок в кнопках */
    .right-sidebar .btn-auth i,
    .right-sidebar .btn-cart i {
        font-size: 18px !important;
        min-width: 24px !important;
    }
}

/* 8. ФИКС для очень маленьких экранов (меньше 320px) */
@media (max-width: 320px) {
    .right-sidebar.open {
        width: calc(100% - 10px) !important;
        left: 5px !important;
        right: 5px !important;
    }

    .right-sidebar-content {
        padding: 12px 10px !important;
    }

    /* Еще более компактные кнопки */
    .btn-auth,
    .btn-cart {
        padding: 8px 10px !important;
        font-size: 13px !important;
        min-height: 40px !important;
    }

    /* Компактные поля ввода */
    .form-group input {
        padding: 8px 10px !important;
        font-size: 14px !important;
    }

    /* Компактные элементы корзины */
    .cart-item {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    .cart-item-image {
        width: 40px !important;
        height: 40px !important;
    }

    .cart-item-name {
        font-size: 12px !important;
    }

    .cart-item-price {
        font-size: 14px !important;
    }

    .quantity-btn {
        width: 22px !important;
        height: 22px !important;
        font-size: 14px !important;
    }

    .quantity-input {
        width: 30px !important;
        font-size: 12px !important;
    }
}

/* 9. ФИКС для landscape ориентации */
@media (max-width: 1024px) and (orientation: landscape) {
    .right-sidebar.open {
        max-height: 80vh !important;
        top: 10vh !important;
    }

    .right-sidebar-content {
        max-height: calc(80vh - 70px) !important;
    }

    /* Делаем элементы более компактными в landscape */
    .cart-item {
        padding: 10px !important;
    }

    .cart-item-image {
        width: 45px !important;
        height: 45px !important;
    }

    .btn-auth,
    .btn-cart {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
}

/* 10. ФИКС для предотвращения выхода текста за пределы */
.right-sidebar * {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* 11. ФИКС для flex-контейнеров внутри сайдбаров */
@media (max-width: 1024px) {
    .right-sidebar-content {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Все элементы растягиваются на всю ширину */
    .right-sidebar-content > * {
        width: 100% !important;
        flex-shrink: 0 !important;
    }

    /* Особенно для формы */
    #authSidebar .auth-form {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
    }
}

/* 12. ФИНАЛЬНЫЙ ФИКС - ОБЯЗАТЕЛЬНО ДЛЯ ВСЕХ МОБИЛЬНЫХ */
@media (max-width: 1024px) {
    /* Принудительно ограничиваем максимальную ширину */
    .right-sidebar,
    .right-sidebar * {
        max-width: 100vw !important;
    }

    /* Предотвращаем любой горизонтальный скролл */
    .right-sidebar {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    /* Гарантируем, что контент не выйдет за границы */
    .right-sidebar-content * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Последняя линия защиты - скрываем переполнение */
    .right-sidebar {
        contain: content !important;
    }
}

/* ВАЖНО: Добавляем отступ сверху для контента */
.sidebar-tab-content {
    padding-top: 10px !important;
}

/* Стили для корзины */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-item-image i {
    font-size: 24px;
    color: #999;
}

.cart-item-info {
    flex-grow: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-word;
}

.cart-item-type {
    display: inline-block;
    font-size: 11px;
    background: #4CAF50;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.cart-item-price {
    color: var(--yellow-primary);
    font-weight: 600;
    font-size: 16px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 40px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.remove-item {
    width: 30px;
    height: 30px;
    border: 1px solid #ff6b6b;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b6b;
    transition: all 0.2s;
    margin-left: 10px;
}

.remove-item:hover {
    background: #ff6b6b;
    color: white;
}

.cart-total {
    padding: 20px;
    background: #f9f9f9;
    border-top: 2px solid #eee;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.total-amount {
    color: var(--yellow-primary);
    font-size: 22px;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.btn-cart {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-checkout {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #43A047 0%, #1B5E20 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-view-cart {
    background: var(--yellow-primary);
    color: #333;
}

.btn-view-cart:hover {
    background: var(--yellow-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-cart i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-cart h3 {
    margin-bottom: 10px;
    color: #333;
}

.empty-cart p {
    color: #888;
}

/* Плавающая кнопка связи (телефон, WhatsApp, Инста, Авито, Беркат) */
.contact-fab-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
.contact-fab-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}
.contact-fab-wrap.contact-fab-open .contact-fab-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.contact-fab-main {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--yellow-gradient);
    color: #333;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--yellow-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.contact-fab-main:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--yellow-shadow-dark);
    background: var(--yellow-gradient-dark);
}
.contact-fab-main:active {
    transform: scale(0.98);
}
.contact-fab-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.contact-fab-item:hover {
    transform: scale(1.1);
    color: #1a1a1a;
    background: #f8f8f8;
}
.contact-fab-item.contact-fab-whatsapp:hover {
    background: #25D366;
    color: #fff;
}
.contact-fab-item.contact-fab-avito:hover {
    background: #00aaff;
    color: #fff;
}
.contact-fab-item.contact-fab-instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
}
@media (max-width: 480px) {
    .contact-fab-wrap {
        bottom: 16px;
        right: 16px;
    }
    .contact-fab-main {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
    .contact-fab-item {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}
