/**
 * Custom Styles for БЕЛИМПОРТСНАБ Website
 * Дополнительные стили для сайта
 */

/* ========================================
   Общие стили
   ======================================== */
   
 body {
    padding-top: 0;
    margin: 0;
}

body.modal-open #main-header {
    pointer-events: none;
    opacity: 0;
}

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #2563eb;
    --accent-color: #3b82f6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
	--full-header-height: auto; /* не обязателен */
    --compact-height: 56px;
    --transition-time: 220ms;
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
	overflow-x: hidden; /* Предотвращает горизонтальные скачки */
}

/* ========================================
  Header
   ======================================== */


/* ========================================
   Category Cards with Images
   ======================================== */

.category-card-image {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
}

.category-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    z-index: 1;
}

/* ========================================
   Плавная прокрутка
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* ========================================
   Ограничение количества строк текста
   ======================================== */

.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* ========================================
   Анимации
   ======================================== */

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ========================================
   Кастомный скроллбар
   ======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   Хлебные крошки
   ======================================== */

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* ========================================
   Карточки товаров
   ======================================== */

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    transition: transform 0.3s ease;
}

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

/* ========================================
   Галерея изображений
   ======================================== */

.image-gallery {
    position: relative;
}

.image-gallery-main {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.5rem;
}

.image-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.image-gallery-main img:hover {
    transform: scale(1.1);
}

.image-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.image-gallery-thumbnail {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.375rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-gallery-thumbnail:hover {
    border-color: var(--accent-color);
}

.image-gallery-thumbnail.active {
    border-color: var(--primary-color);
}

.image-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Модальное окно для изображений
   ======================================== */

/* --- Подправки для миниатюр/актива --- */
.image-gallery-thumbnail {
    border-radius: 0.5rem;
    border: 2px solid transparent;
    overflow: hidden;
    transition: border-color .15s ease, transform .12s ease;
}
.image-gallery-thumbnail img { object-fit: cover; width:100%; height:100%;}
.image-gallery-thumbnail:hover { transform: translateY(-2px); }
.image-gallery-thumbnail.active {
    border-color: #2563eb; /* синий */
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* --- Модальное окно --- */
.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}
.image-modal.active { display:flex; }

/* Контент (картинка) */
.image-modal-content {
    max-width: 92%;
    max-height: 86%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* Кнопка закрытия (видимая, большая) */
.image-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    transition: color .12s ease, transform .08s ease;
    z-index: 10010;
}
.image-modal-close:hover { color: #ddd; transform: scale(1.05); }

/* Навигационные кнопки (prev/next) */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    width: 48px;
    height: 64px;
    font-size: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10005;
    transition: background .12s ease;
}
.modal-prev { left: 18px; }
.modal-next { right: 18px; }
.modal-nav:hover { background: rgba(0,0,0,0.7); }

/* Мобильная оптимизация кнопок */
@media (max-width: 640px) {
    .modal-nav { width: 44px; height: 52px; font-size: 24px; }
    .image-modal-close { font-size: 30px; top: 12px; right: 12px; }
}

/* ========================================
   Формы
   ======================================== */

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: #ef4444;
}

.form-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ========================================
   Кнопки
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========================================
   Таблицы
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table th,
table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: var(--text-dark);
}

table tr:hover {
    background-color: #f9fafb;
}

/* Адаптивные таблицы */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ========================================
   Загрузчик
   ======================================== */

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   Уведомления
   ======================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

.notification-success {
    background-color: #10b981;
    color: white;
}

.notification-error {
    background-color: #ef4444;
    color: white;
}

.notification-info {
    background-color: #3b82f6;
    color: white;
}

/* ========================================
   Печать
   ======================================== */
   
/* Дополнительные категории */
.additional-categories {
    padding: 60px 0;
    background-color: #f8f9fa;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    color: #212529;
}

.additional-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.additional-category {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.additional-category:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.additional-category-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #212529;
}

.additional-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.additional-category-list li {
    margin-bottom: 8px;
}

.additional-category-list a {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
}

.additional-category-list a:hover {
    text-decoration: underline;
}

@media print {
    .no-print,
    header,
    footer,
    .breadcrumbs,
    button,
    .btn,
    nav {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: white;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* ========================================
   Утилиты
   ======================================== */

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.box-shadow-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-video {
    aspect-ratio: 16 / 9;
}

/* ========================================
   Адаптивность
   ======================================== */

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ========================================
   Дополнительные стили для навигации
   ======================================== */

nav a.active {
    color: #9ca3af;
    font-weight: 600;
}

/* ========================================
   Карта (для Yandex/Google Maps)
   ======================================== */

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .map-container {
        height: 300px;
    }
}

/* ========================================
   Видео контейнер (YouTube)
   ======================================== */

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   Тех.характеристики товара
   ======================================== */

/* Общий контейнер */
.prod_tech {
    font-size: 16px;
    line-height: 1.6;
    color: #1f2937; /* gray-800 */
}

/* Заголовки */
.prod_tech h1,
.prod_tech h2,
.prod_tech h3,
.prod_tech h4,
.prod_tech h5,
.prod_tech h6 {
    font-weight: 600;
    line-height: 1.3;
    margin: 1.5em 0 0.75em;
    color: #111827; /* gray-900 */
}

.prod_tech h1 { font-size: 1.75rem; }
.prod_tech h2 { font-size: 1.5rem; }
.prod_tech h3 { font-size: 1.25rem; }
.prod_tech h4 { font-size: 1.125rem; }

/* Абзацы */
.prod_tech p {
    margin: 0 0 1em;
}

/* Списки */
.prod_tech ul,
.prod_tech ol {
    margin: 0 0 1em 1.5em;
    padding: 0;
}

.prod_tech ul {
    list-style: disc;
}

.prod_tech ol {
    list-style: decimal;
}

.prod_tech li {
    margin-bottom: 0.5em;
}

/* Таблицы */
.prod_tech table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.prod_tech th,
.prod_tech td {
    border: 1px solid #e5e7eb; /* gray-200 */
    padding: 0.6em 0.75em;
    text-align: left;
    vertical-align: top;
}

.prod_tech th {
    background-color: #f9fafb; /* gray-50 */
    font-weight: 600;
}

/* Ссылки */
.prod_tech a {
    color: #2563eb; /* blue-600 */
    text-decoration: underline;
}

.prod_tech a:hover {
    text-decoration: none;
}

/* Выделение текста */
.prod_tech strong {
    font-weight: 600;
}

.prod_tech em {
    font-style: italic;
}

/* Цитаты */
.prod_tech blockquote {
    margin: 1.5em 0;
    padding: 0.75em 1em;
    border-left: 4px solid #d1d5db; /* gray-300 */
    background-color: #f9fafb;
    color: #374151; /* gray-700 */
}

/* Код */
.prod_tech code {
    font-family: monospace;
    background-color: #f3f4f6; /* gray-100 */
    padding: 0.15em 0.35em;
    border-radius: 4px;
    font-size: 0.95em;
}

/* Горизонтальная линия */
.prod_tech hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}

/* Изображения */
.prod_tech img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    display: block;
}



