/* ========================================= */
/* БАЗОВАЯ СЕТКА И МЕНЮ (ПК-ВЕРСИЯ) */
/* ========================================= */
.app-container {
    display: flex;
    max-width: 1400px;
    height: 94vh;
    margin: 3vh auto;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.sidebar {
    width: 280px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background-color: transparent !important;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links a {
    color: var(--c-content);
    opacity: 0.7;
    font-size: 15px;
    display: block;
    padding: 14px 20px;
    margin-bottom: 5px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-links a:hover, .nav-links a.active {
    opacity: 1;
    background: color-mix(in srgb, var(--accent-red) 15%, transparent);
    border-color: color-mix(in srgb, var(--accent-red) 30%, transparent);
    color: var(--accent-red);
}

.content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.content-wrapper {
    padding: 40px 40px 100px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c-content) 20%, transparent); border-radius: 10px; }

.top-bar {
    padding: 30px;
    border-radius: 24px;
    margin-bottom: 30px;
}

.top-bar h1 { font-size: 32px; margin-bottom: 10px; }
.top-bar p { opacity: 0.7; }

/* Мобильные панели по умолчанию скрыты на ПК */
.mobile-top-header, .mobile-bottom-bar {
    display: none;
}

/* ========================================= */
/* НОВАЯ ГЛАВНАЯ СТРАНИЦА (HERO, ПОИСК, КАТЕГОРИИ) */
/* ========================================= */
.hero-banner {
    background: linear-gradient(135deg, rgba(0,0,0,0.8), rgba(0,0,0,0.2)), url('../img/bed.jpg') center/cover;
    border-radius: 24px;
    padding: 60px 40px;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-end;
    min-height: 400px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.hero-content h1 {
    font-size: 56px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #fff;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    max-width: 400px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.hero-btn {
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

.hero-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.section-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.catalog-controls {
    margin-bottom: 40px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--c-dark) 15%, transparent);
    border-radius: 16px;
    padding: 0 20px;
    margin-bottom: 30px;
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--c-content);
    padding: 18px 15px;
    font-size: 16px;
    outline: none;
}

.categories-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}
.categories-slider::-webkit-scrollbar { height: 4px; }
.categories-slider::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c-content) 20%, transparent); border-radius: 4px; }

.category-card {
    background: color-mix(in srgb, var(--c-dark) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--c-light) 5%, transparent);
    border-radius: 20px;
    min-width: 140px;
    height: 140px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
}

.category-card:hover, .category-card.active {
    border-color: var(--accent-red);
    background: color-mix(in srgb, var(--accent-red) 10%, transparent);
}

.cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--c-content);
    opacity: 0.8;
}

.cat-name {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================= */
/* КАТАЛОГ И КАРТОЧКИ ТОВАРОВ */
/* ========================================= */
.catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.product-card {
    border-radius: 24px;
    padding: 15px;
    cursor: pointer;
    background: color-mix(in srgb, var(--c-glass) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--c-light) 5%, transparent);
    transition: transform 0.4s ease, box-shadow 0.3s, border-color 0.3s;
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--accent-red) 40%, transparent);
    box-shadow: 0 15px 30px color-mix(in srgb, var(--c-dark) 20%, transparent);
}

.card-image {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    margin-bottom: 15px;
}

.liquid-btn {
    background: transparent;
    color: #fff;
    border: none;
    position: relative;
    cursor: pointer;
    filter: url('#goo');
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.liquid-btn::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    background: var(--accent-red);
    border-radius: 14px;
    z-index: -1;
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.liquid-btn:hover::before {
    top: -3px; left: -3px; right: -3px; bottom: -3px;
    background: color-mix(in srgb, var(--accent-red) 80%, #fff);
}

/* ========================================= */
/* ПРОФИЛЬ И ФОРМЫ */
/* ========================================= */
.profile-card {
    padding: 35px;
    border-radius: 24px;
    max-width: 500px;
}

.profile-header { display: flex; align-items: center; gap: 20px; }
.profile-avatar {
    width: 70px; height: 70px;
    background: color-mix(in srgb, var(--accent-red) 20%, transparent);
    border: 1px solid var(--accent-red);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

.bonus-stats { display: flex; gap: 20px; margin-top: 30px; }
.stat-box {
    background: color-mix(in srgb, var(--c-dark) 10%, transparent);
    padding: 20px;
    border-radius: 16px;
    flex: 1;
    text-align: center;
    border: 1px solid color-mix(in srgb, var(--c-light) 5%, transparent);
}
.stat-box span { display: block; font-size: 13px; opacity: 0.7; margin-bottom: 5px; }
.stat-box strong { font-size: 26px; }

.custom-form .input-group { margin-bottom: 15px; }
.custom-form input, .custom-form select, .custom-form textarea {
    width: 100%;
    padding: 16px 20px;
    background: color-mix(in srgb, var(--c-dark) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--c-light) 10%, transparent);
    color: var(--c-content);
    border-radius: 16px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s ease;
}
.custom-form input:focus, .custom-form select:focus, .custom-form textarea:focus {
    border-color: var(--accent-red);
    background: color-mix(in srgb, var(--c-light) 10%, transparent);
}
.custom-form textarea { resize: vertical; min-height: 100px; }

/* ========================================= */
/* АДМИН ПАНЕЛЬ (КАК НА ФОТО) */
/* ========================================= */
.admin-nav li { margin-bottom: 5px; }
.admin-nav a { padding: 12px 20px; font-size: 14px; border-radius: 8px; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.05); border: none; color: #fff; }

.admin-tabs { display: flex; gap: 15px; margin-bottom: 25px; flex-wrap: wrap; }
.admin-tab {
    padding: 12px 25px;
    background: color-mix(in srgb, var(--c-dark) 10%, transparent);
    border: 1px solid transparent;
    color: var(--c-content);
    border-radius: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.3s;
}
.admin-tab:hover { background: color-mix(in srgb, var(--c-light) 10%, transparent); }
.admin-tab.active { background: color-mix(in srgb, var(--accent-red) 20%, transparent); border-color: var(--accent-red); color: var(--accent-red); }

/* Статусные пилюли */
.status-pill {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid;
    display: inline-block;
}
.status-new { color: #ff4d4d; border-color: #ff4d4d; background: rgba(255, 77, 77, 0.1); }
.status-processing { color: #ffc107; border-color: #ffc107; background: rgba(255, 193, 7, 0.1); }
.status-done { color: #00e676; border-color: #00e676; background: rgba(0, 230, 118, 0.1); }

/* ========================================= */
/* КОРЗИНА И МОДАЛЬНЫЕ ОКНА */
/* ========================================= */
.cart-sidebar {
    position: fixed;
    top: 0; right: -450px;
    width: 400px; height: 100vh;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    padding: 30px;
    border-radius: 0;
}
.cart-sidebar.open { right: 0; }
.cart-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--c-content) 15%, transparent); padding-bottom: 20px; }
.cart-header button { background: none; border: none; color: var(--c-content); cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; padding: 5px; }
.cart-header button:hover { color: var(--accent-red); }
.cart-items { flex: 1; overflow-y: auto; padding: 20px 0; }
.cart-footer { border-top: 1px solid color-mix(in srgb, var(--c-content) 15%, transparent); padding-top: 25px; }
.cart-total { font-size: 22px; margin-bottom: 20px; display: flex; justify-content: space-between; }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.3s ease; }

.modal-content {
    width: 100%; max-width: 420px;
    padding: 40px;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.close-modal {
    position: absolute;
    top: 20px; right: 20px;
    background: color-mix(in srgb, var(--c-content) 10%, transparent); border: none; color: var(--c-content);
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: 0.3s;
}
.close-modal:hover { background: var(--accent-red); color: #fff; }

.auth-tabs { display: flex; margin-bottom: 30px; background: color-mix(in srgb, var(--c-dark) 10%, transparent); border-radius: 16px; padding: 5px; }
.auth-tab { flex: 1; padding: 12px; background: transparent; border: none; color: var(--c-content); opacity: 0.6; border-radius: 12px; cursor: pointer; font-weight: 500; transition: 0.3s; }
.auth-tab.active { background: color-mix(in srgb, var(--c-light) 20%, transparent); opacity: 1; }

/* ========================================= */
/* ШЕДЕВРАЛЬНАЯ КАРТОЧКА ТОВАРА (MODAL) */
/* ========================================= */
.product-modal-content {
    max-width: 950px;
    padding: 35px;
    border-radius: 30px;
}

.product-modal-layout {
    display: flex;
    gap: 40px;
}

.product-gallery {
    flex: 1.2;
    display: flex;
    flex-direction: column;
}

.modal-main-image {
    width: 100%;
    height: 400px;
    border-radius: 24px;
    background-size: cover;
    background-position: center;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.modal-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.modal-thumbnails::-webkit-scrollbar { height: 4px; }
.modal-thumbnails::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c-content) 20%, transparent); border-radius: 4px; }

.thumbnail-img {
    width: 75px;
    height: 75px;
    border-radius: 16px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
    flex-shrink: 0;
}
.thumbnail-img.active { border-color: var(--accent-red); transform: scale(1.05); }

.product-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-category { color: var(--accent-red); font-size: 13px; text-transform: uppercase; font-weight: 800; letter-spacing: 1.5px; }
.modal-title { font-size: 32px; margin: 10px 0; line-height: 1.1; font-weight: 800; }
.modal-price { font-size: 28px; margin-bottom: 20px; display: block; font-weight: bold; }
.modal-desc { font-size: 15px; opacity: 0.8; margin-bottom: 20px; line-height: 1.6; }

.modal-specs { margin-bottom: 15px; font-size: 15px; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 16px; }
.modal-specs strong { opacity: 0.7; font-weight: normal; margin-right: 10px; }

.modal-colors-wrapper { margin-bottom: 25px; }
.modal-colors-wrapper strong { font-size: 14px; opacity: 0.7; font-weight: normal; }
.modal-colors { display: flex; gap: 12px; margin-top: 10px; }
.color-option {
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: 0.3s;
}
.color-option.active { border-color: var(--accent-red); transform: scale(1.15); box-shadow: 0 0 15px color-mix(in srgb, var(--accent-red) 50%, transparent); }

.modal-reviews-section {
    margin-top: auto;
    padding-top: 25px;
    border-top: 1px solid color-mix(in srgb, var(--c-light) 10%, transparent);
}
.modal-reviews-section h3 { font-size: 18px; margin-bottom: 15px; }
.modal-reviews-list { max-height: 200px; overflow-y: auto; margin-bottom: 15px; padding-right: 10px; }
.modal-reviews-list::-webkit-scrollbar { width: 6px; }
.modal-reviews-list::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c-content) 20%, transparent); border-radius: 4px; }

.review-item {
    background: color-mix(in srgb, var(--c-dark) 15%, transparent);
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 10px;
    font-size: 14px;
    border: 1px solid color-mix(in srgb, var(--c-light) 5%, transparent);
}
.review-header { display: flex; justify-content: space-between; margin-bottom: 5px; opacity: 0.7; font-size: 12px; }
.review-form { display: flex; gap: 10px; }
.review-form input { margin-bottom: 0; padding: 14px 15px; border-radius: 14px; }
.review-form button { padding: 0 20px; font-size: 14px; border-radius: 14px; }

/* ========================================= */
/* ЧАТ ПОДДЕРЖКИ (ИСПРАВЛЕННЫЙ) */
/* ========================================= */
.support-widget {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9999;
}

.chat-toggle-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    /* Убираем эффект жидкого стекла, из-за которого ломался клик и позиция */
    filter: none !important;
}

.chat-toggle-btn::before { display: none !important; }

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(230, 57, 70, 0.6);
}

.chat-window {
    position: absolute;
    bottom: 85px; right: 0;
    width: 340px; height: 450px;
    border-radius: 24px;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    transform-origin: bottom right;
    animation: chatFadeIn 0.3s ease;
    background: var(--c-bg); /* Задаем четкий фон */
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.chat-header { background: var(--accent-red); color: #fff; padding: 20px; text-align: center; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 12px 18px; border-radius: 18px; max-width: 85%; font-size: 14px; line-height: 1.4; }
.msg.support { background: color-mix(in srgb, var(--c-content) 10%, transparent); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--c-content); }
.msg.user { background: var(--accent-red); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { display: flex; padding: 15px; border-top: 1px solid color-mix(in srgb, var(--c-content) 10%, transparent); gap: 10px; margin: 0; background: color-mix(in srgb, var(--c-dark) 20%, transparent); }
.chat-input input { flex: 1; padding: 12px 15px; background: color-mix(in srgb, var(--c-dark) 30%, transparent); border: 1px solid color-mix(in srgb, var(--c-light) 10%, transparent); color: var(--c-content); border-radius: 14px; outline: none; margin-bottom: 0; }
.chat-input button { background: none; border: none; color: var(--accent-red); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; }
.chat-input button:hover { transform: scale(1.1); }
.whatsapp-link { display: block; text-align: center; padding: 15px; font-size: 13px; color: #25D366; text-decoration: none; border-top: 1px solid color-mix(in srgb, var(--c-content) 10%, transparent); background: color-mix(in srgb, var(--c-dark) 20%, transparent); transition: 0.3s; }
.whatsapp-link:hover { background: color-mix(in srgb, #25D366 10%, transparent); }

/* ========================================= */
/* МОБИЛЬНАЯ АДАПТАЦИЯ (ТЕЛЕФОНЫ) */
/* ========================================= */
@media (max-width: 768px) {
    .app-container {
        margin: 0; height: 100vh; border-radius: 0; box-shadow: none; flex-direction: column;
    }
    
    #desktop-sidebar { display: none; }
    
    /* Мобильная шапка */
    .mobile-top-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 15px 20px;
        background: transparent;
        border: none;
        z-index: 100;
        backdrop-filter: none;
        box-shadow: none;
    }
    .icon-btn { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); }

    .content { padding-bottom: 110px; height: auto; }
    .content-wrapper { padding: 0 15px 15px 15px; }
    
    .hero-banner { border-radius: 30px; min-height: 450px; padding: 40px 20px; margin-bottom: 30px; text-align: left; }
    .hero-content h1 { font-size: 42px; margin-bottom: 15px; }

    .catalog { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 15px; }
    .product-card { padding: 12px; border-radius: 20px; }
    .card-image { height: 160px; border-radius: 14px; }

    /* Мобильный таб-бар с активной кнопкой как на фото */
    .mobile-bottom-bar {
        display: flex; position: fixed; bottom: 15px; left: 15px; right: 15px;
        height: 70px; border-radius: 35px;
        justify-content: space-around; align-items: center;
        z-index: 1000; padding: 0 10px;
        background: rgba(15, 15, 18, 0.95);
        border: 1px solid rgba(255,255,255,0.05);
    }

    .tab-item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        color: var(--c-content); opacity: 0.6; text-decoration: none; gap: 4px; width: 60px; transition: 0.3s;
    }
    .tab-item.active { opacity: 1; color: #fff; }
    
    /* Красная активная кнопка меню */
    .tab-item.active-pill {
        background: var(--accent-red);
        color: #fff;
        flex-direction: row;
        width: auto;
        padding: 0 20px;
        height: 44px;
        border-radius: 22px;
        opacity: 1;
        gap: 8px;
    }
    .tab-item.active-pill .tab-icon { font-size: 18px; }
    .tab-item.active-pill .tab-text { font-size: 14px; font-weight: 600; }

    .tab-icon { font-size: 22px; position: relative; display: flex; align-items: center; justify-content: center; }
    .tab-text { font-size: 10px; font-weight: 500; }
    
    .cart-badge {
        position: absolute; top: -6px; right: -8px;
        background: var(--accent-red); color: white;
        border-radius: 50%; width: 18px; height: 18px;
        font-size: 11px; font-weight: bold;
        display: flex; align-items: center; justify-content: center;
        border: 2px solid var(--c-bg);
    }

    .cart-sidebar { width: 100%; right: -100%; border-radius: 0; }
    
    .modal-content { max-width: 90%; padding: 30px 20px; }
    
    /* Адаптация карточки товара на мобилках */
    .product-modal-layout { flex-direction: column; gap: 20px; }
    .product-modal-content { max-height: 90vh; overflow-y: auto; padding: 25px 15px; }
    .product-modal-content::-webkit-scrollbar { width: 0; }
    .modal-main-image { height: 300px; }

    /* Исправление позиции чата на телефоне */
    .support-widget { bottom: 100px; right: 20px; }
}