/* static/style.css */
:root {
    --teal: #008080;
    --teal-light: #20B2AA;
    --teal-dark: #006666;
    --yellow: #FFD700;
    --yellow-dark: #FFC107;
    --white: #FFFFFF;
    --gray-light: #F5F7FA;
    --gray: #E0E0E0;
    --gray-border: #D0D5DD;
    --text-dark: #1a1a2e;
    --text-gray: #6B7280;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px rgba(0,128,128,0.15);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background: var(--gray-light);
    line-height: 1.5;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== ФИКСИРОВАННАЯ ШАПКА ========== */
.header {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}

.logo-link:hover {
    background: rgba(255,255,255,0.08);
}

.logo-link-active {
    background: none;
}

.logo-link-active .logo-title {
    color: #FFD700;
}

.logo-link-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 2px;
    background: #FFD700;
    border-radius: 2px;
}

.logo-divider {
    width: 1px;
    height: 35px;
    background: rgba(255,255,255,0.25);
    transform: skew(-15deg);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--teal);
    border: 2px solid var(--yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: var(--yellow);
    letter-spacing: 1px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 16px;
    font-weight: 800;
    color: #ccc;
    letter-spacing: 1px;
    white-space: nowrap;
}

.logo-link-second .logo-icon {
    background: #FFD700;
    color: #1a1a2e;
    border-color: #008080;
}

.logo-icon-print {
    font-size: 18px;
}

.header-contacts {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.contact-phone {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}

.cart-link {
    background: #008080;
    color: #FFD700;
    padding: 8px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: 0.3s;
    white-space: nowrap;
}

.cart-link:hover {
    background: #006666;
}

.user-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 11px;
}

.bonus-badge {
    background: #FFD700;
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 10px;
}

.logout-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 10px;
    transition: 0.3s;
}

.logout-link:hover {
    color: #ff4444;
    text-decoration: underline;
}

.nav-tabs, .section-switcher, .logo-tabs { display: none !important; }
.header .cart-link[href="/services"] { display: none !important; }
.header-badge { display: none !important; }
.header-info { display: none; }
.callback-btn { display: none; }

/* ========== ПОИСК ========== */
.search-bar {
    background: var(--white);
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-border);
}

.search-form {
    position: relative;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form input {
    flex: 1;
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #D0D5DD;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.search-form input:focus {
    border-color: #008080;
    box-shadow: 0 0 0 3px rgba(0,128,128,0.08);
}

.search-icon-btn {
    padding: 12px 18px;
    background: #008080;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.search-icon-btn:hover {
    background: #006666;
    transform: scale(1.05);
}

/* ========== ПОИСК С ПОДСКАЗКАМИ ========== */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #D0D5DD;
    border-radius: 10px;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.search-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    transition: 0.2s;
}

.search-item:hover {
    background: #f0fafafa;
}

.search-item small {
    color: #888;
    white-space: nowrap;
}

.search-item.all-results {
    justify-content: center;
    color: #008080;
    font-weight: 700;
    background: #f0fafafa;
}

/* ========== ОСНОВНОЙ ЛЭЙАУТ ========== */
.main-layout {
    padding: 25px 0 50px;
}

.layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 25px;
    align-items: start;
}

/* ========== САЙДБАР ========== */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #008080 #f0f0f0;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #008080;
    border-radius: 3px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--teal);
    color: var(--teal-dark);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 5px;
}

.cat-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #1a1a2e;
    transition: 0.2s;
}

.cat-main:hover {
    background: #e0f5f5;
}

.cat-main.active {
    background: #008080;
    color: white;
}

.cat-count {
    font-size: 11px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.cat-main.active .cat-count {
    background: rgba(255,255,255,0.3);
    color: white;
}

.subcat-list {
    margin-left: 16px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cat-sub {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    color: #555;
    transition: 0.2s;
}

.cat-sub:hover {
    background: #f5f5f5;
}

.cat-sub.active {
    background: #e0f5f5;
    color: #008080;
    font-weight: 600;
}

.reset-filter {
    display: block;
    margin-top: 12px;
    padding: 8px;
    text-align: center;
    background: #FFF3CD;
    color: #856404;
    border-radius: 8px;
    font-size: 13px;
    transition: 0.3s;
}

.reset-filter:hover {
    background: #FFE69C;
}

/* ========== КОНТЕНТ ========== */
.content {
    min-height: 400px;
}

.breadcrumbs {
    font-size: 13px;
    margin-bottom: 15px;
    color: #888;
}

.breadcrumbs a {
    color: #008080;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 5px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-select {
    padding: 8px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    outline: none;
    transition: 0.3s;
    font-family: inherit;
}

.sort-select:focus {
    border-color: #008080;
    box-shadow: 0 0 0 3px rgba(0,128,128,0.08);
}

.results-count {
    font-size: 14px;
    color: var(--text-gray);
    background: var(--white);
    padding: 5px 14px;
    border-radius: 20px;
}

/* ========== СЕТКА ТОВАРОВ ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--teal-light);
}

.product-image {
    position: relative;
    height: 200px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.no-image {
    font-size: 48px;
    color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.price-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--teal);
    color: var(--yellow);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-body {
    padding: 10px 12px 12px;
}

.product-category {
    font-size: 10px;
    color: #008080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.product-article {
    font-size: 10px;
    color: #888;
    margin-bottom: 4px;
}

.product-name {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #1a1a2e;
    min-height: 30px;
}

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 800;
    color: #006666;
    white-space: nowrap;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #D0D5DD;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border: none;
    font-size: 16px;
    cursor: pointer;
    font-weight: 700;
    color: #1a1a2e;
    transition: 0.2s;
}

.qty-btn:hover {
    background: #008080;
    color: white;
}

.qty-input {
    width: 35px;
    height: 28px;
    text-align: center;
    border: none;
    border-left: 1px solid #D0D5DD;
    border-right: 1px solid #D0D5DD;
    font-size: 13px;
    font-weight: 600;
    background: white;
}

.add-to-cart-btn {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, #008080, #006666);
    color: #FFD700;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.add-to-cart-btn:hover {
    background: #006666;
    transform: scale(1.02);
}

/* ========== ПУСТОЕ СОСТОЯНИЕ ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--radius);
}

.empty-state p {
    font-size: 24px;
    margin-bottom: 15px;
}

.empty-state a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: underline;
}

.hint {
    font-size: 14px;
    color: var(--text-gray);
}

/* ========== УВЕДОМЛЕНИЯ ========== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.notification.success {
    background: #10B981;
}

.notification.error {
    background: #EF4444;
}

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== ПАГИНАЦИЯ ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.page-btn:hover { 
    background: #f0f0f0; 
}

.page-btn.active {
    background: #008080;
    color: white;
    border-color: #008080;
}

.page-dots { 
    padding: 8px 4px; 
    color: #888; 
}

/* ========== ФУТЕР ========== */
.footer {
    background: linear-gradient(135deg, #0f0f1a, #16213e);
    color: #ccc;
    padding: 40px 0 0;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.footer-logo span {
    font-size: 18px;
    font-weight: 700;
    color: var(--yellow);
}

.footer-col h4 {
    color: var(--yellow);
    margin-bottom: 12px;
    font-size: 14px;
}

.footer-col p {
    margin: 6px 0;
    font-size: 13px;
}

.footer-bottom {
    text-align: center;
    padding: 18px 0;
    font-size: 12px;
    color: #666;
}

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */

@media (max-width: 768px) {
    /* Шапка */
    .header { padding: 6px 0; }
    .header-content { gap: 6px; flex-wrap: nowrap; }
    
    .logo-group { gap: 0; }
    .logo-link { padding: 4px 6px; }
    .logo-icon { width: 28px; height: 28px; font-size: 11px; border-width: 1px; }
    .logo-icon-print { font-size: 12px; }
    .logo-title { font-size: 11px; letter-spacing: 0; }
    .logo-subtitle { display: none; }
    .logo-divider { height: 20px; margin: 0 2px; }
    
    .contact-phone { display: none; }
    .cart-link { padding: 6px 8px; font-size: 10px; }
    .user-badge { font-size: 9px; }
    .bonus-badge { font-size: 8px; padding: 1px 5px; }
    .logout-link { font-size: 8px; }
    
    /* Поиск */
    .search-bar { padding: 8px 0; }
    .search-form input { padding: 10px 14px; font-size: 14px; }
    .search-icon-btn { padding: 10px 14px; font-size: 16px; }
    
    /* Каталог */
    .main-layout { padding: 10px 0; }
    .layout-grid { grid-template-columns: 1fr; gap: 10px; }
    
    .sidebar { position: static; max-height: none; padding: 10px; }
    .sidebar-title { font-size: 13px; }
    .category-menu { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; -webkit-overflow-scrolling: touch; padding-bottom: 5px; }
    .category-menu li { flex-shrink: 0; background: #f0f0f0; border-radius: 15px; }
    .category-menu li a { padding: 5px 10px; font-size: 11px; white-space: nowrap; }
    .cat-count { display: none; }
    .cat-main { padding: 6px 10px; font-size: 11px; white-space: nowrap; }
    .subcat-list { display: none; }
    .reset-filter { font-size: 10px; padding: 5px; }
    
    /* Сетка товаров */
    .products-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .product-card { border-radius: 8px; }
    .product-image { height: 130px; }
    .product-image img { max-width: 90%; max-height: 90%; }
    .product-body { padding: 6px 8px 8px; }
    .product-article { font-size: 8px; }
    .product-name { font-size: 10px; min-height: 26px; margin-bottom: 4px; }
    .product-price-row { margin-bottom: 4px; gap: 4px; }
    .product-price { font-size: 13px; }
    .price-tag { font-size: 10px; padding: 2px 6px; top: 5px; right: 5px; }
    
    .qty-control { border-radius: 4px; }
    .qty-btn { width: 24px; height: 24px; font-size: 13px; }
    .qty-input { width: 28px; height: 24px; font-size: 11px; }
    
    .add-to-cart-btn { padding: 7px 4px; font-size: 10px; border-radius: 5px; }
    
    /* Пагинация */
    .pagination { gap: 3px; }
    .page-btn { padding: 5px 8px; font-size: 11px; }
    .page-dots { padding: 5px 2px; font-size: 10px; }
    
    /* Сортировка */
    .section-header { flex-wrap: wrap; gap: 5px; }
    .section-header h2 { font-size: 14px; }
    .results-count { font-size: 10px; }
    .sort-select { padding: 5px 8px; font-size: 11px; }
    
    /* Хлебные крошки */
    .breadcrumbs { font-size: 10px; margin-bottom: 8px; }
    
    /* Модальные окна */
    .modal-content { padding: 15px; border-radius: 12px; }
    .modal-close { font-size: 24px; top: 5px; right: 10px; }
    
    /* Корзина */
    .cart-page { padding: 10px; }
    .cart-item { padding: 8px 0; gap: 5px; }
    .cart-item-name { font-size: 11px; }
    .cart-item-qty { font-size: 11px; }
    .cart-item-price { font-size: 11px; }
    .cart-item-subtotal { font-size: 12px; }
    .cart-total { font-size: 16px; padding: 12px; }
    .checkout-form { padding: 15px; }
    
    /* Услуги */
    .services-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .service-cat { padding: 15px 8px; }
    .service-cat-icon { font-size: 30px; }
    .service-cat-name { font-size: 11px; }
    .page-header h1 { font-size: 22px; }
    .page-header p { font-size: 12px; }
    .service-item { padding: 12px; }
    .service-item-name { font-size: 12px; }
    .service-item-price { font-size: 14px; }
    
    /* Футер */
    .footer { padding: 20px 0 10px; }
    .footer-content { grid-template-columns: 1fr; gap: 15px; }
    .footer-col h4 { font-size: 12px; }
    .footer-col p { font-size: 11px; }
}

@media (max-width: 400px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
    .product-image { height: 110px; }
    .product-name { font-size: 9px; }
    .product-price { font-size: 11px; }
    .add-to-cart-btn { font-size: 9px; padding: 6px 3px; }
    .logo-title { font-size: 10px; }
    .logo-icon { width: 24px; height: 24px; font-size: 9px; }
    .cart-link { font-size: 9px; padding: 5px 6px; }
    .services-grid { grid-template-columns: 1fr; }
}