/* ===== CSS ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ ===== */
:root {
  /* Светлая тема */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-color: #0039a6;
  --accent-secondary: #d52b1e;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --btn-radius: 50px;
  --transition-fast: 180ms;
  --transition: 300ms;
}

[data-theme="dark"] {
  /* Тёмная тема */
  --bg-primary: #0a0a0a;
  --bg-secondary: #121212;
  --bg-card: rgba(255, 255, 255, 0.03);
  --text-primary: #f5f5f5;
  --text-secondary: #cfcfcf;
  --border-color: rgba(255, 255, 255, 0.06);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Плавные переходы для конкретных элементов */
.btn, .brand-card, .theme-toggle, .product-card, .gallery-item, .video-container {
  transition: all var(--transition) ease;
}

body.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* ===== ОБЩИЕ КОМПОНЕНТЫ ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Контент блоки */
.content-block {
  background: var(--bg-card);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(6px);
  margin: 20px auto;
  max-width: 1200px;
  box-shadow: var(--shadow);
}

/* ===== ШАПКА САЙТА ===== */
.site-header {
  padding: 20px 0;
  background: transparent;
  position: relative;
}

.header-container {
  display: flex;
  gap: 35px;
  align-items: flex-start;
  padding: 40px;
  position: relative;
}

.logo-section {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-logo {
  width: 350px;
  height: auto;
  object-fit: contain;
}

.description-section {
  flex: 1;
}

.site-title {
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.site-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0;
  line-height: 1.4;
}

.mobile-brands {
  display: none;
}

/* Навигация в шапке */
.header-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 20px;
  padding: 6px 0;
  border-radius: 4px;
  transition: all var(--transition) ease;
  white-space: nowrap;
  text-align: right;
}

.nav-list a:hover {
  color: var(--accent-secondary);
  background: transparent;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

.theme-toggle:hover {
  transform: scale(1.05);
  background: var(--bg-secondary);
  border-color: var(--accent-color);
  box-shadow: var(--shadow);
}

.theme-icon { 
  font-size: 18px; 
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.main-content {
  padding: 0;
  flex: 1;
}

/* ===== СЕТКА БРЕНДОВ ===== */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-bottom: 30px;
  align-items: stretch;
}

/* Карточка бренда */
.brand-card {
  background: var(--bg-card);
  border-radius: 15px;
  padding: 40px 30px;
  border: 1px solid var(--border-color);
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow);
}

.brand-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-secondary);
  box-shadow: 0 18px 40px rgba(213, 43, 30, 0.12);
}

/* Логотип внутри карточки */
.brand-logo-container {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 25px;
  border-radius: 10px;
  position: relative;
}

.brand-logo-container img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Заголовки карточки */
.brand-subtitle {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 18px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.brand-description {
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Метки */
.brand-features {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.feature-tag {
  background: rgba(213, 43, 30, 0.12);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: .85rem;
  border: 1px solid var(--border-color);
}

/* ===== КНОПКИ ===== */
.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Главная кнопка (красная по умолчанию) */
.btn,
.btn-primary {
  background: var(--accent-secondary);
  color: #ffffff;
}

/* Вторичная кнопка (прозрачная рамка) */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Hover / focus эффекты */
.btn:hover,
.btn-primary:hover {
  background: var(--accent-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 57, 166, 0.3);
}

.btn-secondary:hover {
  background: rgba(0, 57, 166, 0.08);
  border-color: #0039a6;
  color: #0039a6;
  transform: translateY(-2px);
}

.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 57, 166, 0.3);
}

/* Центрирование кнопок */
.action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.brand-card .btn {
  margin-left: auto;
  margin-right: auto;
}

/* ===== БЛОК ОПИСАНИЯ БРЕНДА ===== */
.brand-hero {
  padding: 60px 40px;
  text-align: center;
}

.brand-logo-header {
  text-align: center;
  margin-bottom: 0px;
  margin-top: -50px;
}

.brand-header-image {
  max-width: 990px;
  width: 71%;
  height: 254px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Специфичные стили для логотипа Vector Optics */
.vector-optics-logo {
  max-width: 990px;
  width: 71%;
  height: 254px;
  margin: -50px auto 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 10px;
}

/* Логотип для светлой темы */
[data-theme="light"] .vector-optics-logo {
  background-image: url('/images/vectoroptics/vectoroptics_log_1.webp');
}

/* Логотип для темной темы */
[data-theme="dark"] .vector-optics-logo {
  background-image: url('/images/vectoroptics_logo.png');
}

/* ===== ПРОДУКТЫ ===== */
.products-section {
  padding: 40px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  text-align: center;
  color: var(--text-primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.product-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}

.product-title {
  font-size: 1rem;
  margin: 8px 0;
  font-weight: 700;
}

.product-description {
  font-size: .95rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex-grow: 1;
}

/* Action buttons area in product cards */
.product-card .action-buttons {
  margin-top: auto;
  width: 100%;
}

.product-card .action-buttons .btn {
  width: 100%;
  max-width: none;
}

/* ===== БЛОК "О КОМПАНИИ" ===== */
.about {
  padding: 40px;
  text-align: center;
}

.about-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.about-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

/* ===== ФУТЕР ===== */
.footer {
  background: transparent;
  padding: 0;
  margin-top: 32px;
}

.footer .content-block {
  margin: 20px auto;
  padding: 28px 40px;
}

.footer-content {
  text-align: center;
}

.copyright {
  font-size: .9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.email-contact {
  font-size: .95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.email-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.email-link:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  color: var(--accent-secondary);
  text-decoration: none;
  font-weight: 500;
  margin: 2px 0;
}

.back-link:hover {
  text-decoration: underline;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(213, 43, 30, 0.3);
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--accent-secondary);
}

.modal-caption {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  color: #fff;
  font-size: 18px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
}

/* ===== КНОПКА "НАВЕРХ" ===== */
.scroll-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent-secondary);
  color: white;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 999;
  transition: all 0.3s ease;
}

.scroll-to-top:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 57, 166, 0.3);
}

.scroll-to-top.show {
  display: flex;
}

/* ===== БУРГЕР-МЕНЮ ===== */
.menu-toggle {
  display: none;
  background: none;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 5px;
  z-index: 1001;
}

.menu-toggle:hover {
  border-color: var(--accent-secondary);
  background: rgba(213, 43, 30, 0.1);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
  .header-container {
    padding: 30px;
    gap: 25px;
  }
  
  .main-logo {
    width: 200px;
  }
  
  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 42px;
    height: 42px;
  }
  
  .brand-header-image,
  .vector-optics-logo {
    max-width: 800px;
    height: 200px;
  }
  
  .brand-logo-container {
    height: 150px;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    padding: 60px 25px 25px 25px;
    gap: 20px;
    position: relative;
  }
  
  .logo-section {
    width: 100%;
    align-items: center;
  }
  
  .description-section {
    width: 100%;
    text-align: center;
  }
  
  .site-title {
    text-align: center;
  }
  
  .site-subtitle {
    display: none;
  }
  
  .mobile-brands {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 10px 0;
    line-height: 1.4;
  }
  
  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }
  
  .brands-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .brand-card {
    padding: 30px 20px;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .content-block {
    margin: 15px auto;
  }
  
  .brand-header-image,
  .vector-optics-logo {
    height: 180px;
    margin-top: -20px;
  }
  
  .brand-hero {
    padding: 40px 25px;
  }
  
  .products-section {
    padding: 30px 25px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .brand-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  /* Бургер-меню */
  .menu-toggle {
    display: block;
  }
  
  .header-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(15px);
    padding: 80px 20px 20px;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .header-nav.active {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .nav-list a {
    display: block;
    padding: 15px 20px;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
  }
  
  .nav-list a:hover {
    background: rgba(213, 43, 30, 0.2);
    border-color: var(--accent-secondary);
  }
  
  .footer .content-block {
    padding: 25px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 55px 20px 20px 20px;
  }
  
  .main-logo {
    width: 160px;
  }
  
  .site-title {
    font-size: 20px;
  }
  
  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
  
  .brand-card {
    padding: 25px 15px;
  }
  
  .about {
    padding: 30px 20px;
  }
  
  .footer .content-block {
    padding: 20px;
  }
  
  .brand-header-image,
  .vector-optics-logo {
    height: 150px;
    margin-top: -15px;
  }
  
  .brand-hero, .products-section {
    padding: 25px 20px;
  }
  
  .brand-title {
    font-size: 1.8rem;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .email-contact {
    font-size: 0.9rem;
    text-align: center;
  }
}

/* Исправление позиционирования для десктопной версии */
@media (min-width: 769px) {
  .header-container {
    position: relative;
    padding-right: 80px;
  }
  
  .theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
  }
  
  .header-nav {
    margin-right: 60px;
  }
}




/* ===== ВИДЕО КОНТЕЙНЕР ===== */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    background: var(--bg-secondary);
}

.video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(213, 43, 30, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 2;
}

.play-button:hover {
    background: rgba(213, 43, 30, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.product-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

/* Состояние когда видео играет */
.video-container.playing .video-poster {
    opacity: 0;
    pointer-events: none;
}

.video-container.playing .play-button {
    display: none;
}

.video-container.playing .product-video {
    display: block;
}

/* Гарантируем, что контент не выходит за пределы карточек */
.product-card {
    overflow: hidden;
}

.product-card * {
    max-width: 100%;
}

/* Адаптивность для видео */
@media (max-width: 1024px) {
    .video-container {
        aspect-ratio: 1/1;
    }
    .play-button {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .video-container {
        aspect-ratio: 1/1;
    }
    .play-button {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}
@media (max-width: 480px) {
    .video-container {
        aspect-ratio: 1/1;
    }
    .play-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}


/* ===== СТИЛИ ДЛЯ ВНЕШНИХ КАРТИНОК ===== */
.external-image {
    margin: 2.5rem 0;
    text-align: center;
}

.external-image.center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.external-image.with-border {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    background: var(--bg-card);
}

.external-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.external-image img:hover {
    transform: scale(1.02);
}

.external-image.with-border img {
    border-radius: 6px;
}

/* Подписи к картинкам */
.image-caption {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Галерея картинок */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 2.5rem 0;
}

.gallery-item {
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: translateY(-5px);
}

.gallery-item .image-caption {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Адаптивность для картинок */
@media (max-width: 768px) {
    .external-image {
        margin: 2rem 0;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .image-caption {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .external-image.with-border {
        padding: 10px;
    }
    
    .gallery-item img {
        height: 150px;
    }
}


/* ===== СТИЛИ ДЛЯ АВТОФОРМАТИРОВАНИЯ ===== */
.paste-area-container {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin: 2rem 0;
    text-align: center;
}

.paste-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 15px;
}

.paste-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 57, 166, 0.1);
}

.format-btn {
    background: var(--accent-color);
    margin: 10px auto;
}

.format-btn:hover {
    background: var(--accent-secondary);
}

.formatted-content {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.copy-btn {
    background: var(--accent-secondary);
    margin: 15px auto;
    display: block;
}

/* Индикатор процесса */
.format-status {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    margin: 10px 0;
}


/* Светлая тема (по умолчанию) */
:root {
    --attention-bg: #fff3cd;
    --attention-border: #ffc107;
    --attention-text: #000;
}

/* Темная тема */
[data-theme="dark"] {
    --attention-bg: #5c4a00;
    --attention-border: #ffd54f;
    --attention-text: #fff;
}

/* Или если используется класс */
.dark-theme {
    --attention-bg: #5c4a00;
    --attention-border: #ffd54f;
    --attention-text: #fff;
}