/* Общие стили */
:root {
  --primary-color: #db2c2c;
  --secondary-color: #161b2e;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --border-color: #e0e0e0;
  --font-main: 'Arial', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  color: var(--text-color);
  line-height: 1.6;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Основной контент */
main {
  flex: 1;
}

/* Обертка для основного контента (для совместимости) */
.main-content {
  flex: 1;
}

/* Обертка для контента страницы */
.page-content {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Промо-бар */
.promo-bar {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 0;
}

.promo-bar .container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-text {
  font-weight: bold;
  margin-right: 10px;
}

.promo-description {
  margin-right: 20px;
}

.promo-button {
  background-color: transparent;
  border: 1px solid white;
  color: white;
  padding: 5px 15px;
  border-radius: 3px;
  transition: background-color 0.3s;
}

.promo-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Шапка сайта */
.header {
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.logo img {
  height: 60px;
}

.region-selector {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.region-selector i {
  margin-left: 5px;
  color: var(--primary-color);
}

.main-nav ul {
  display: flex;
}

.main-nav li {
  margin-left: 20px;
}

.main-nav a {
  font-size: 14px;
  position: relative;
}

.main-nav a:hover {
  color: var(--primary-color);
}

.main-nav a:after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.main-nav a:hover:after {
  width: 100%;
}

/* Выпадающее меню навигации */
.main-nav .dropdown {
  position: relative;
}

.main-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0 0 5px 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  margin-top: 5px;
}

.main-nav .dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.main-nav .dropdown .dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.main-nav .dropdown-menu li {
  margin: 0;
  display: block;
  width: 100%;
}

.main-nav .dropdown-menu a {
  display: block;
  padding: 12px 20px;
  border-bottom: 1px solid var(--light-gray);
  font-size: 14px;
  transition: background-color 0.3s, color 0.3s;
  width: 100%;
  box-sizing: border-box;
}

.main-nav .dropdown-menu li:last-child a {
  border-bottom: none;
}

.main-nav .dropdown-menu a:hover {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

.main-nav .dropdown-menu a:after {
  display: none;
}

.main-nav .dropdown > a i {
  margin-left: 5px;
  font-size: 10px;
  transition: transform 0.3s;
}

.main-nav .dropdown:hover > a i {
  transform: rotate(180deg);
}

.user-actions {
  display: flex;
  align-items: center;
}

.icon-link {
  margin-left: 15px;
  font-size: 18px;
  position: relative;
}

.cart-link {
  margin-left: 15px;
  font-size: 18px;
  position: relative;
}

.cart-count,
.favorites-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-bottom {
  display: flex;
  align-items: center;
  padding: 15px 0;
}

.catalog-button, .services-button {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  margin-right: 15px;
  font-weight: bold;
  border-radius: 3px;
}

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

.services-button {
  background-color: var(--light-gray);
  color: var(--secondary-color);
}

.catalog-button i, .services-button i {
  margin-right: 8px;
}

/* Выпадающий каталог */
.catalog-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0 0 5px 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 800px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.catalog-dropdown.active {
  display: block;
}

.catalog-content {
  display: flex;
}

.catalog-categories {
  width: 300px;
  border-right: 1px solid var(--border-color);
}

.catalog-subcategories {
  flex: 1;
  padding: 20px;
}

.catalog-category {
  display: block;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  transition: background-color 0.3s;
  cursor: pointer;
}

.catalog-category:hover,
.catalog-category.active {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

.catalog-category i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.subcategories-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.subcategories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.subcategory-item {
  display: block;
  padding: 10px;
  border-radius: 3px;
  color: var(--text-color);
  transition: background-color 0.3s;
}

.subcategory-item:hover {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

.catalog-wrapper {
  position: relative;
}

.search-form {
  flex: 1;
  display: flex;
  position: relative;
  margin: 0 20px;
}

.search-form input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 14px;
}

.search-form button {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background-color: transparent;
  color: #999;
}

.phone-block {
  text-align: right;
}

.phone-number {
  font-weight: bold;
  font-size: 18px;
  color: var(--secondary-color);
}

.callback-link {
  font-size: 12px;
  color: var(--primary-color);
  cursor: pointer;
}

/* Баннер доставки */
.delivery-banner {
  background-color: var(--light-gray);
  padding: 30px 0;
  margin: 20px 0;
}

.delivery-banner .container {
  display: flex;
  align-items: center;
}

.delivery-image {
  position: relative;
  margin-right: 30px;
}

.delivery-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
}

.delivery-content h2 {
  font-size: 24px;
  margin-bottom: 15px;
}

.details-button {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 3px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.details-button:hover {
  background-color: #c01e1e;
}

/* Информация о магазине */
.store-info {
  padding: 30px 0;
}

.store-info h1 {
  font-size: 28px;
  margin-bottom: 30px;
}

.product-tabs {
  margin-top: 30px;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.tabs-nav li {
  margin-right: 30px;
}

.tabs-nav a {
  display: block;
  padding: 10px 0;
  color: var(--text-color);
  font-weight: bold;
  position: relative;
}

.tabs-nav li.active a {
  color: var(--primary-color);
}

.tabs-nav li.active a:after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.product-card {
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 5px;
  position: relative;
  transition: box-shadow 0.3s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1.5rem 1rem;
}

.product-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  color: white;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 3px;
  font-weight: bold;
  z-index: 1;
}

.product-badge.featured {
  background-color: #4caf50;
}

.product-badge.new {
  background-color: #2196f3;
}

.product-badge.discount {
  background-color: #ff5722;
}

.product-image {
  margin-bottom: 15px;
  text-align: center;
}

.product-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.product-title {
  font-size: 1rem;
  min-height: 2.5em;
  height: auto;
  line-height: 1.2;
  overflow: hidden;
}

.product-price {
  margin-bottom: 15px;
}

.product-price .old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
  margin-right: 10px;
}

.product-price .current-price {
  font-weight: bold;
  font-size: 18px;
  color: var(--primary-color);
}

.product-category {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.add-to-cart, .product-details {
  background-color: var(--primary-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
}

.product-details {
  background-color: #666;
  width: auto;
  min-width: 80px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.add-to-cart:hover {
  background-color: #c01e1e;
}

.product-details:hover {
  background-color: #555;
}

/* Стили для счетчика товаров */
.products-count {
  text-align: center;
  margin: 20px 0;
  color: #666;
  font-size: 14px;
  padding: 10px;
  background-color: var(--light-gray);
  border-radius: 5px;
}

/* Стили для кнопки "Показать все" */
.btn-show-all:hover {
  background-color: #c01e1e !important;
}

.section-action {
  text-align: center;
}

.btn-all-products {
  display: inline-block;
  background-color: var(--light-gray);
  color: var(--text-color);
  padding: 10px 20px;
  border-radius: 3px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn-all-products:hover {
  background-color: #e0e0e0;
}

/* Категории */
.categories {
  padding: 40px 0;
}

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

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
  background-color: var(--light-gray);
  border-radius: 5px;
  transition: transform 0.3s, box-shadow 0.3s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.category-icon {
  font-size: 36px;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.category-card h3 {
  font-size: 14px;
  color: var(--secondary-color);
}

/* Консультация */
.consultation {
  background-color: var(--primary-color);
  color: white;
  padding: 50px 0;
  margin: 40px 0;
}

.consultation .container {
  display: flex;
  align-items: center;
}

.consultation-content {
  flex: 2;
  padding-right: 50px;
}

.consultation-content h2 {
  font-size: 24px;
  margin-bottom: 15px;
}

.consultation-content p {
  margin-bottom: 20px;
}

.consultation-button {
  background-color: white;
  color: var(--primary-color);
  padding: 12px 25px;
  border-radius: 3px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.consultation-button:hover {
  background-color: var(--light-gray);
}

.consultant-image {
  flex: 1;
  position: relative;
}

.consultant-image img {
  border-radius: 5px;
}

.consultant-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px;
  color: white;
}

.consultant-name {
  font-weight: bold;
}

.consultant-position {
  font-size: 12px;
}

/* Статьи */
.articles {
  padding: 40px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.section-header h2 {
  font-size: 24px;
}

.section-controls {
  display: flex;
}

.control-prev, .control-next {
  width: 40px;
  height: 40px;
  background-color: var(--light-gray);
  color: var(--text-color);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  transition: background-color 0.3s;
}

.control-prev:hover, .control-next:hover {
  background-color: #e0e0e0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.article-card {
  border: 1px solid var(--border-color);
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-image img {
  width: 100%;
}

.article-category {
  display: inline-block;
  padding: 5px 10px;
  margin: 15px;
  font-size: 12px;
  background-color: var(--light-gray);
  border-radius: 3px;
}

.article-title {
  padding: 0 15px 15px;
  font-size: 16px;
}

/* Бренды */
.brands {
  padding: 40px 0;
  background-color: var(--light-gray);
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.brand-card {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.brand-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Преимущества */
.advantages {
  padding: 60px 0;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.advantage-card {
  text-align: center;
  padding: 30px 20px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.advantage-icon {
  font-size: 42px;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.advantage-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.advantage-card p {
  font-size: 14px;
  color: #666;
}

/* Подвал */
.footer {
  background-color: var(--secondary-color);
  color: white;
  padding: 60px 0 20px;
  flex-shrink: 0;
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.footer-column h3 {
  margin-bottom: 20px;
  font-size: 18px;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: #ccc;
  font-size: 14px;
  transition: color 0.3s;
}

.footer-column ul li a:hover {
  color: white;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo img {
  height: 60px;
}

.social-links {
  display: flex;
}

.social-links a {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  transition: background-color 0.3s;
}

.social-links a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .products-grid,
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .brands-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .advantage-card {
    padding: 20px 15px;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
  }
  
  .logo {
    margin-bottom: 10px;
  }
  
  .main-nav {
    order: 3;
    margin-top: 10px;
    width: 100%;
  }
  
  .main-nav ul {
    justify-content: space-between;
  }
  
  .main-nav li {
    margin-left: 0;
  }
  
  .header-bottom {
    flex-wrap: wrap;
  }
  
  .search-form {
    order: 3;
    margin: 10px 0;
    width: 100%;
  }
  
  .consultation .container {
    flex-direction: column;
  }
  
  .consultation-content {
    padding-right: 0;
    margin-bottom: 30px;
  }
  
  .footer-top {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }
  
  .footer-column h3 {
    font-size: 16px;
    margin-bottom: 15px;
  }
  
  .footer-column ul li {
    margin-bottom: 8px;
  }
  
  .footer-column ul li a {
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .promo-bar .container {
    flex-direction: column;
  }
  
  .promo-text, .promo-description {
    margin-bottom: 10px;
    margin-right: 0;
  }
  
  .categories-grid,
  .products-grid,
  .articles-grid,
  .brands-grid,
  .advantages-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .footer-column h3 {
    font-size: 15px;
    margin-bottom: 12px;
  }
  
  .footer-column ul li a {
    font-size: 12px;
  }
  
  .footer-logo img {
    height: 50px;
  }
  
  .social-links a {
    width: 35px;
    height: 35px;
  }
}

/* Стили для модального окна консультации */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 2% auto;
  padding: 0;
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 95vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 15px 15px 0 0;
  flex-shrink: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

/* Исправленные стили для статей на главной странице */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.article-card {
  border: 1px solid var(--border-color);
  border-radius: 15px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: white;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.article-category {
  display: inline-block;
  padding: 8px 15px;
  margin: 0 0 10px 0;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

/* Стили для разных типов категорий */
.article-category.category-article {
  background-color: #e3f2fd;
  color: #1976d2;
}

.article-category.category-event {
  background-color: #fff3e0;
  color: #f57c00;
}

.article-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 15px;
}

.article-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  margin: 0 0 10px 0;
}

.article-preview {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
  flex: 1;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.article-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-rating {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rating-stars {
  color: #ffc107;
  font-size: 14px;
}

.rating-text {
  color: #666;
  font-size: 11px;
}

/* Стили для событий на карточках */
.article-event-info {
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #e9ecef;
}

.article-event-info .event-date,
.article-event-info .event-location {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  font-size: 13px;
  color: #555;
}

.article-event-info .event-date:last-child,
.article-event-info .event-location:last-child {
  margin-bottom: 0;
}

.article-event-info i {
  margin-right: 8px;
  color: #007bff;
  width: 16px;
}

.event-date, .event-location {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.event-date:last-child, .event-location:last-child {
  margin-bottom: 0;
}

.event-date i, .event-location i {
  margin-right: 8px;
  color: #007bff;
  width: 16px;
}

/* Адаптивность для модальных окон */
@media (min-width: 1400px) {
  #productModal .modal-content.product-modal-content {
    max-width: 1024px;
  }
  
  .product-details-container {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    padding: 40px 0;
  }
  
  .main-image {
    min-height: 500px;
  }
  
  #productModal .main-image img {
    height: 600px;
  }
}

/* Стили для увеличения изображения */
.image-zoom-modal {
  display: none;
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.image-zoom-modal img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 8px;
}

.image-zoom-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 20001;
}

.image-zoom-close:hover {
  opacity: 0.7;
}

/* Улучшенные стили для галереи */
.product-gallery::-webkit-scrollbar {
  height: 6px;
}

.product-gallery::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.product-gallery::-webkit-scrollbar-thumb {
  background: #007bff;
  border-radius: 3px;
}

.product-gallery::-webkit-scrollbar-thumb:hover {
  background: #0056b3;
}

/* Индикатор загрузки изображения */
.image-loading {
  position: relative;
}

.image-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

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

/* Дополнительные адаптивные стили для страниц меню */
@media (max-width: 768px) {
  /* Адаптивные стили для навигационной шапки страниц */
  .page-nav {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .page-breadcrumb {
    justify-content: center;
    order: 2;
  }
  
  .back-to-home {
    order: 3;
    justify-content: center;
  }
  
  .page-logo {
    order: 1;
    justify-content: center;
  }
  
  /* Стили для модального окна товара на мобильных */
  #productModal .modal-content.product-modal-content {
    max-width: 98%;
    max-height: 98vh;
  }
  
  .product-details-container {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 0;
  }
  
  .main-image {
    min-height: 350px;
  }
  
  #productModal .main-image img {
    height: 400px;
  }
  
  .product-gallery {
    max-height: 120px;
  }
  
  .product-gallery img {
    width: 100px;
    height: 100px;
  }
  
  .product-info h3 {
    font-size: 24px;
  }
  
  .product-price-block .current-price {
    font-size: 28px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }
  
  .quantity-controls {
    justify-content: center;
  }
  
  /* Увеличение изображения на мобильных */
  .image-zoom-modal img {
    max-width: 98%;
    max-height: 98%;
  }
  
  .image-zoom-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
  }
}

/* Дополнительные стили для модального окна товара */
.product-modal-content {
  max-width: 1024px;
  width: 95%;
  max-height: 95vh;
  overflow-y: auto;
}

.product-modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 20px 0;
}

.main-image-container {
  position: relative;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.main-image:hover {
  transform: scale(1.05);
}

.image-gallery {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  overflow-x: auto;
  padding: 5px 0;
}

.gallery-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: #007bff;
  transform: scale(1.05);
}

.category-badge {
  display: inline-block;
  background: #007bff;
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
}

.price-info {
  margin: 15px 0;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 16px;
  margin-right: 10px;
}

.current-price {
  font-size: 24px;
  font-weight: bold;
  color: #007bff;
}

.product-description,
.product-specifications {
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.product-description h4,
.product-specifications h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 18px;
}

.product-specifications ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-specifications li {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
}

.product-specifications li:last-child {
  border-bottom: none;
}

.product-actions {
  margin-top: 30px;
}

.quantity-selector {
  margin-bottom: 20px;
}

.quantity-selector label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

.quantity-btn {
  background: #f8f9fa;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 18px;
  font-weight: bold;
}

.quantity-btn:hover {
  background: #e9ecef;
}

.quantity-controls input {
  border: none;
  width: 60px;
  height: 40px;
  text-align: center;
  font-size: 16px;
  background: white;
}

.quantity-controls input:focus {
  outline: none;
}

.action-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: #545b62;
  transform: translateY(-1px);
}

.btn-large {
  padding: 15px 30px;
  font-size: 18px;
}

/* Адаптивность для модального окна товара */
@media (max-width: 768px) {
  .product-modal-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .current-price {
    font-size: 20px;
  }
  
  .gallery-thumb {
    width: 60px;
    height: 60px;
  }
}

/* Стили для отключенных кнопок */
.quick-order-btn:disabled,
.btn-checkout:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.quick-order-btn:disabled {
  background-color: #ccc;
  color: #666;
}

.btn-checkout:disabled {
  background-color: #ccc;
  color: #666;
}

/* Дополнительные стили для статей и событий */
.article-event-info {
  padding: 10px 15px;
  border-top: 1px solid var(--border-color);
  background-color: #f8f9fa;
  margin-top: 10px;
}

.event-date, .event-location {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.event-date:last-child, .event-location:last-child {
  margin-bottom: 0;
}

.event-date i, .event-location i {
  margin-right: 8px;
  color: var(--primary-color);
  width: 16px;
}

.article-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 49%, rgba(219, 44, 44, 0.1) 50%, transparent 51%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.article-card:hover::before {
  opacity: 1;
}

.article-card:hover .article-title {
  color: var(--primary-color);
}

/* Состояния загрузки и ошибок */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #666;
}

.loading-indicator i {
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

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

.empty-state, .error-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-state i, .error-state i {
  display: block;
  margin-bottom: 15px;
}

.error-state button:hover {
  background-color: #0056b3 !important;
}

/* Адаптивность для небольших экранов */
@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .article-event-info {
    padding: 8px 12px;
  }
  
  .event-date, .event-location {
    font-size: 13px;
  }
}

/* Стили для модального окна статьи */
.article-modal .modal-content {
  max-width: 1200px;
  width: 90%;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.article-modal .modal-body {
  overflow-y: auto;
  flex: 1;
}

.article-modal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.article-images {
  position: sticky;
  top: 20px;
}

.main-image-container {
  margin-bottom: 20px;
}

.main-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  background: #f8f9fa;
}

.image-gallery {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  border: 2px solid transparent;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  border-color: #007bff;
}

.article-info {
  padding: 20px 0;
}

.category-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.category-badge.category-article {
  background: #e3f2fd;
  color: #1976d2;
}

.category-badge.category-event {
  background: #f3e5f5;
  color: #7b1fa2;
}

.article-meta {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  font-size: 14px;
  color: #666;
}

.article-meta i {
  margin-right: 5px;
}

.article-event-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 10px;
  margin: 20px 0;
}

.article-event-info .event-date,
.article-event-info .event-location {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  color: #555;
}

.article-event-info .event-date:last-child,
.article-event-info .event-location:last-child {
  margin-bottom: 0;
}

.article-event-info i {
  margin-right: 8px;
  color: #007bff;
}

.article-content {
  line-height: 1.8;
  color: #333;
  font-size: 16px;
  white-space: pre-wrap;
}

.article-content p {
  margin-bottom: 15px;
  white-space: pre-wrap;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 20px 0;
  display: block;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 25px;
  margin-bottom: 15px;
  color: #333;
}

.article-content ul,
.article-content ol {
  margin-bottom: 15px;
  padding-left: 30px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  background: #f8f9fa;
  border-left: 4px solid #007bff;
  padding: 15px 20px;
  margin: 20px 0;
  font-style: italic;
}

/* Специальные стили для содержания статьи в модальном окне */
#articleContent {
  white-space: pre-wrap;
  line-height: 1.8;
  color: #333;
  font-size: 16px;
}

/* Рейтинг и комментарии в модальном окне */
.rating-section {
  border-top: 1px solid #eee;
  padding-top: 30px;
  margin: 30px 0;
  text-align: center;
}

.rating-section h3 {
  margin-bottom: 20px;
  color: #333;
}

.rating-stars {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 15px;
}

.rating-stars .star {
  font-size: 30px;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease;
}

.rating-stars .star:hover,
.rating-stars .star.active {
  color: #ffc107;
}

.rating-info {
  font-size: 14px;
  color: #666;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.comments-section {
  border-top: 1px solid #eee;
  padding-top: 30px;
}

.comments-section h3 {
  margin-bottom: 20px;
  color: #333;
}

.comments-list {
  margin-bottom: 30px;
}

.comment {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #007bff;
  margin-bottom: 20px;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.comment-author {
  font-weight: 600;
  color: #333;
}

.comment-date {
  font-size: 12px;
  color: #666;
}

.comment-text {
  color: #555;
  line-height: 1.6;
}

.comment-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 15px;
  min-height: 120px;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.comment-form .btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.comment-form .btn:hover {
  background: #0056b3;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
  .article-modal-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .article-images {
    position: static;
    order: -1;
  }
  
  .main-image {
    max-height: 400px;
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .article-modal .modal-content {
    width: 95%;
    margin: 2% auto;
  }
  
  .article-modal-layout {
    gap: 20px;
  }
  
  .main-image {
    max-height: 300px;
  }
  
  .article-meta {
    flex-direction: column;
    gap: 10px;
  }
  
  .rating-info {
    flex-direction: column;
    gap: 5px;
  }
  
  .rating-stars .star {
    font-size: 24px;
  }
  
  .article-content {
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .article-modal .modal-content {
    width: 98%;
    margin: 1% auto;
  }
  
  .main-image {
    max-height: 250px;
  }
  
  .article-content {
    font-size: 14px;
  }
  
  .comment-form textarea {
    min-height: 100px;
  }
}

/* Выпадающее меню сервисов */
.services-wrapper {
  position: relative;
}

.services-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 0 0 5px 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 280px;
  z-index: 1000;
  display: none;
}

.services-dropdown.active {
  display: block;
}

.services-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.services-menu li {
  border-bottom: 1px solid var(--border-color);
}

.services-menu li:last-child {
  border-bottom: none;
}

.services-menu a {
  display: block;
  padding: 12px 15px;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}

.services-menu a:hover {
  background-color: var(--light-gray);
  color: var(--primary-color);
}

.services-menu a i {
  margin-right: 10px;
  width: 16px;
  text-align: center;
}

/* Фиксация footer в конце страницы - дополнительные правила */
html {
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Принудительное позиционирование main элементов */
main,
.page-content,
.main-content {
  flex: 1 0 auto;
}

/* Footer всегда внизу */
.footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* Исправления для калькуляторов и других страниц */
.calculator-section,
.info-section,
.content-section {
  margin-bottom: 20px;
}

/* Обеспечиваем правильную работу на всех страницах */
body > .promo-bar ~ .header ~ main,
body > .promo-bar ~ .header ~ .page-content,
body > .promo-bar ~ .header ~ .main-content {
  flex: 1;
}

/* Дополнительная фиксация для страниц без main */
body > .promo-bar ~ .header ~ div:not(.footer):last-of-type {
  flex: 1;
} 

/* --- Адаптивные улучшения для всех масштабов --- */

/* 1. Глобально для изображений */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 2. Для .products-grid и .product-card */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.product-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 1.5rem 1rem;
}

.product-title {
  font-size: 1rem;
  min-height: 2.5em;
  height: auto;
  line-height: 1.2;
  overflow: hidden;
}

.product-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.product-actions {
  flex-wrap: wrap;
  gap: 8px;
}

/* 3. Для фильтров и форм */
.filters, .search-form, .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filters input, .filters select, .search-form input, .search-form select {
  min-width: 0;
  width: auto;
  max-width: 100%;
  flex: 1 1 120px;
}

/* 4. Для карточек категорий и других сеток */
.categories-grid, .articles-grid, .brands-grid, .advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.category-card, .article-card, .brand-card, .advantage-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* 5. Для модальных окон */
.modal-content {
  max-width: 95vw;
  width: 100%;
  min-width: 0;
}

/* 6. Для текста и кнопок */
body, button, input, select, textarea {
  font-size: 1rem;
}

/* 7. Убрать горизонтальный скролл */
html, body {
  overflow-x: hidden;
}

/* 8. Улучшить медиазапросы для промежуточных размеров */
@media (max-width: 1200px) {
  .container {
    max-width: 98vw;
    padding: 0 8px;
  }
}

@media (max-width: 900px) {
  .products-grid, .categories-grid, .articles-grid, .brands-grid, .advantages-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .product-card, .category-card, .article-card, .brand-card, .advantage-card {
    padding: 1rem 0.5rem;
  }
}

@media (max-width: 600px) {
  .products-grid, .categories-grid, .articles-grid, .brands-grid, .advantages-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .product-card, .category-card, .article-card, .brand-card, .advantage-card {
    padding: 0.5rem 0.25rem;
  }
  .filters, .search-form, .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --- Конец адаптивных улучшений --- */ 

/* Адаптивность для статей */
@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .article-image {
    height: 180px;
  }
  
  .article-category {
    margin: 12px 12px 8px 12px;
    padding: 6px 12px;
    font-size: 11px;
  }
  
  .article-title {
    padding: 0 12px 12px;
    font-size: 16px;
  }
  
  .article-event-info {
    padding: 8px 12px;
  }
  
  .event-date, .event-location {
    font-size: 13px;
  }
  
  /* Модальные окна на мобильных */
  .modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 98vh;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h2,
  .modal-header h3 {
    font-size: 18px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-close {
    font-size: 24px;
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .articles-grid {
    gap: 15px;
  }
  
  .article-image {
    height: 160px;
  }
  
  .article-category {
    margin: 10px 10px 6px 10px;
    padding: 4px 10px;
    font-size: 10px;
  }
  
  .article-title {
    padding: 0 10px 10px;
    font-size: 15px;
  }
  
  .article-event-info {
    padding: 6px 10px;
  }
  
  .event-date, .event-location {
    font-size: 12px;
  }
  
  /* Очень маленькие экраны */
  .modal-content {
    width: 98%;
    margin: 1% auto;
    border-radius: 10px;
  }
  
  .modal-header {
    padding: 12px 15px;
    border-radius: 10px 10px 0 0;
  }
  
  .modal-header h2,
  .modal-header h3 {
    font-size: 16px;
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .modal-close {
    font-size: 22px;
    width: 26px;
    height: 26px;
  }
} 