:root {
    --primary-color: #004f9e;
    --secondary-color: #868e96;
    --light-gray: #f5f5f5;
    --hover-color: #003874;
    --text-color: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    background-color: var(--primary-color);
}

nav ul li {
    position: relative;
}

nav ul li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    font-weight: bold;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: var(--hover-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
}

/* Breadcrumbs */
.breadcrumbs {
    background-color: white;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.breadcrumbs ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumbs ul li {
    margin-right: 10px;
}

.breadcrumbs ul li:after {
    content: '/';
    margin-left: 10px;
    color: #888;
}

.breadcrumbs ul li:last-child:after {
    content: '';
}

.breadcrumbs ul li a {
    text-decoration: none;
    color: var(--primary-color);
}

.breadcrumbs ul li.active {
    color: var(--text-color);
}

/* Catalog Layout */
.catalog {
    padding: 40px 0;
}

.catalog-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    position: relative;
}

/* Category Menu */
.category-menu {
    width: 260px;
    flex-shrink: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 15px;
}

.category-menu button.category-toggle {
    width: 100%;
    padding: 15px;
    background: var(--secondary-color);
    border: none;
    cursor: pointer;
    text-align: left;
    font-weight: bold;
    margin-bottom: 4px;
    color: #fff;
    font-size: 16px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-menu button.category-toggle:hover {
    background: var(--primary-color);
}

.category-menu button.category-toggle.active {
    background: var(--primary-color);
    color: #fff;
}

.category-toggle::after {
    content: '+';
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s;
}

.category-toggle.active::after {
    content: '−';
    transform: rotate(0deg);
}

.category-submenu {
    display: none;
    flex-direction: column;
    margin-left: 10px;
    margin-bottom: 10px;
    background: #eeeeee;
    padding: 5px;
    border-radius: 4px;
}

.category-submenu a {
    padding: 8px 10px;
    display: block;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 14px;
    transition: background-color 0.3s;
    border-radius: 4px;
}

.category-submenu a:hover {
    background: #dbe9ff;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 равные колонки */
    gap: 20px;
    flex: 1;
    min-height: 200px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 20px;
}

.product-card {
    width: 100%; /* Убираем calc(), используем 100% от грид-ячейки */
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 15px;
}

.product-card h4 {
    font-size: 16px;
    margin: 0 0 10px;
    font-weight: bold;
    color: var(--primary-color);
}

.product-card p {
    font-size: 14px;
    margin: 0 0 15px;
    color: #666;
}

.product-card .btn {
    display: inline-block;
    margin-top: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.3s;
}

.product-card .btn:hover {
    background: var(--hover-color);
}

/* Category Title */
.category-title {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.category-title h1 {
    font-size: 24px;
    color: var(--primary-color);
}

.category-description {
    margin-top: 10px;
    color: #666;
}

/* Product Detail Styles */
.product-detail-section {
    display: none !important;
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.product-detail-section.active {
    display: block !important;
}

.detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.detail-header h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin: 0;
}

/* НОВАЯ СТРУКТУРА ДЕТАЛЬНОГО ОКНА */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Верхняя часть: изображение слева + характеристики справа */
.detail-top-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Галерея изображений - слева */
.detail-gallery {
    flex: 1;
    max-width: 400px;
    flex-shrink: 0;
}

.detail-main-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    display: block;
}

.detail-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.detail-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #eee;
}

/* Информация о товаре - справа */
.detail-info {
    flex: 1;
    min-width: 300px;
}

/* Характеристики - только они в правой части */
.detail-specs {
    margin-bottom: 0;
}

.detail-specs h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.specs-grid {
    display: grid;
    gap: 8px;
}

.spec-item {
    display: flex;
    flex-wrap: wrap;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.spec-name {
    font-weight: bold;
    min-width: 120px;
    padding-right: 10px;
    color: #333;
}

.spec-value {
    color: #555;
    flex: 1;
}

/* Описание - отдельный блок снизу на всю ширину */
.detail-description {
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.detail-description h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.detail-description p {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 15px;
}

/* Кнопки действий - под описанием */
.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
    justify-content: flex-start;
}

.detail-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.back-to-catalog {
    margin-bottom: 15px;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}

.back-to-catalog svg {
    margin-right: 5px;
}

.back-to-catalog:hover {
    text-decoration: underline;
}

/* Inquiry Form Styles */
.inquiry-form-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    display: none;
}

.inquiry-form-section h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.inquiry-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

textarea.form-control {
    min-height: 100px;
}

.form-submit {
    text-align: center;
    margin-top: 20px;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    padding: 60px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    margin-bottom: 20px;
    color: #fff;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
}

/* ========== ФОРМАТИРОВАНИЕ ОПИСАНИЯ ТОВАРОВ ========== */
.product-description {
    white-space: pre-line;
    line-height: 1.6;
}

/* Мобильный поиск (скрыт на десктопе) */
.mobile-search {
    display: none;
}

/* Состояния загрузки */
.loading-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #6c757d;
    font-size: 14px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== ПЛАНШЕТЫ (769px - 900px) ========== */
@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 колонки на планшетах */
    }
    
    .catalog-container {
        gap: 20px;
    }
    
    .category-menu {
        width: 200px;
    }
}
     
/* ========== МОБИЛЬНЫЕ УСТРОЙСТВА (до 768px) ========== */
@media (max-width: 768px) {
    /* Контейнер */
    .container {
        padding: 0 15px;
    }
    
    /* Хедер */
    .mobile-menu-btn {
        display: block;
        font-size: 24px;
        padding: 10px;
    }
    
    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--primary-color);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .header-top {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .contact-info {
        margin-top: 10px;
        width: 100%;
        text-align: left;
        font-size: 14px;
    }
    
    /* Каталог */
    .catalog {
        padding: 20px 0;
    }
    
    .catalog-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

   * Мобильный поиск - СКРЫТ */
.mobile-search {
    display: none !important;
}

.mobile-search input {
    display: none !important;
}

/* СКРЫВАЕМ ХЛЕБНЫЕ КРОШКИ НА МОБИЛЬНОМ */
.breadcrumbs {
    display: none !important;
}

/* МОБИЛЬНОЕ МЕНЮ КАТЕГОРИЙ - максимально близко к хедеру */
.category-menu {
    background: transparent;
    padding: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    order: 1;
    margin-bottom: 2px; /* минимальный отступ от карточек - как между категориями */
    margin-top: 2px; /* минимальный отступ от хедера - как между категориями */
    
    /* Плотная сетка текста */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 6px; /* 2px между строками как отступы сверху и снизу */
}

.category-menu button.category-toggle {
    background: transparent !important;
    border: none !important;
    padding: 4px 2px !important;
    width: 100%;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #666 !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    display: block !important;
    justify-content: center !important;
    align-items: center;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    min-height: 28px;
    line-height: 1.1;
    text-decoration: none;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
}

.category-menu button.category-toggle:hover {
    background: transparent !important;
    color: #333 !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: underline;
}

.category-menu button.category-toggle.active {
    background: transparent !important;
    color: var(--primary-color) !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    text-decoration: underline;
}

.category-menu button.category-toggle.active::after {
    display: none;
}

.category-menu button.category-toggle::after {
    display: none;
}

/* Скрываем подменю на мобильном */
.category-submenu {
    display: none !important;
}

	/* МОБИЛЬНАЯ СЕТКА ПРОДУКТОВ - 2 в ряд */
.product-grid {
    flex-wrap: nowrap;
    order: 2;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 20px;
    width: 100%;
    gap: 10px;
    /* Используем CSS Grid для мобильных */
    display: grid;
    grid-template-columns: 1fr 1fr;
}

    .product-grid.active {
        display: grid !important;
    }

    /* КОМПАКТНЫЕ КАРТОЧКИ ТОВАРОВ */
    .product-card {
        width: 100% !important;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 10px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
        border: 1px solid #f0f0f0;
        opacity: 0;
        transform: translateY(20px);
        animation: fadeInUp 0.3s ease forwards;
    }

    .product-card:nth-child(1) { animation-delay: 0.1s; }
    .product-card:nth-child(2) { animation-delay: 0.2s; }
    .product-card:nth-child(3) { animation-delay: 0.3s; }
    .product-card:nth-child(4) { animation-delay: 0.4s; }

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .product-card img {
        width: 100%;
        height: 120px;
        object-fit: cover;
        border-radius: 6px;
        margin-bottom: 8px;
    }

    .product-card h4 {
        font-size: 13px;
        font-weight: 500;
        color: #333;
        margin: 0;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card p {
        display: none; /* Скрываем описание на мобильных */
    }

    .product-card .btn {
        display: none; /* Скрываем кнопку, клик по всей карточке */
    }

    /* МОБИЛЬНАЯ ДЕТАЛЬНАЯ СТРАНИЦА ТОВАРА */
    .product-detail-section {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        padding: 20px 15px;
        box-sizing: border-box;
        max-height: none;
        border-radius: 0;
        display: block !important;
    }

    .product-detail-section.active {
        transform: translateX(0) !important;
    }

    .back-to-catalog {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #0066cc;
        font-size: 14px;
        cursor: pointer;
        margin-bottom: 20px;
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .detail-top-section {
        flex-direction: column;
        gap: 20px;
    }

    .detail-gallery {
        max-width: 100%;
    }

    .detail-main-image {
        width: 100%;
        height: 250px;
        object-fit: contain;
        border-radius: 8px;
        max-height: 250px;
    }

    .detail-thumbnails {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .detail-thumb {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
        border-radius: 4px;
    }

    .detail-info {
        width: 100%;
        min-width: auto;
    }

    .detail-specs h3 {
        font-size: 16px;
        margin-bottom: 15px;
        color: var(--primary-color);
    }

    .specs-grid {
        display: grid;
        gap: 8px;
    }

    .spec-item {
        display: grid;
        grid-template-columns: 1fr 1.5fr;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
        flex-wrap: nowrap;
    }

    .spec-name {
        color: #666;
        font-weight: 500;
        min-width: auto;
        padding-right: 0;
    }

    .spec-value {
        color: #333;
    }

    .detail-description {
        margin-top: 20px;
    }

    .detail-description h3 {
        font-size: 18px;
        margin-bottom: 10px;
        color: #333;
    }

    .product-description {
        font-size: 14px;
        line-height: 1.5;
        color: #666;
    }

    .detail-actions {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid #eee;
        justify-content: center;
    }

    .detail-actions .btn {
        width: 100%;
        padding: 12px;
        background: #0066cc;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        cursor: pointer;
    }

    /* ФОРМА ЗАПРОСА НА МОБИЛЬНОМ */
    .inquiry-form-section {
        margin-top: 20px;
        padding: 15px;
        background: #f8f9fa;
        border-radius: 8px;
        display: none;
    }

    .inquiry-form-section.active {
        display: block;
    }

    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-control {
        width: 100%;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 80px;
        resize: vertical;
    }

  /* ЗАГОЛОВОК КАТАЛОГА - СКРЫТ НА МОБИЛЬНОМ */
.category-title {
    display: none !important; /* Полностью скрываем заголовок и описание */
}

.category-title h1 {
    display: none !important;
}

.category-description {
    display: none !important;
}