/* ============================================
   MODERN REDESIGN — mirholodaspb.ru
   Холодильное оборудование, Санкт-Петербург
   ============================================ */

/* ---------- CSS-переменные (легко менять палитру) ---------- */
:root {
  --primary:        #0077c8;   /* основной синий */
  --primary-dark:   #005a9e;   /* тёмно-синий (hover) */
  --primary-light:  #e6f2fb;   /* очень светлый фон */
  --accent:         #00b8d9;   /* бирюзовый акцент (холод) */
  --accent-warm:    #ff6b35;   /* тёплый акцент для кнопок «Купить» */

  --text:           #1a2332;   /* основной текст */
  --text-muted:     #6b7a8f;   /* второстепенный */
  --text-light:     #9aa7b8;

  --bg:             #f5f7fa;   /* фон страницы */
  --bg-card:        #ffffff;   /* фон карточек */
  --border:         #e4e9f0;

  --shadow-sm:  0 1px 3px rgba(0, 30, 80, 0.06);
  --shadow-md:  0 4px 16px rgba(0, 30, 80, 0.08);
  --shadow-lg:  0 12px 32px rgba(0, 30, 80, 0.12);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --font-main: 'Inter', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Базовые стили ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

/* ---------- Шапка сайта ---------- */
header, .header, .site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

/* Логотип / название */
.logo, .site-name, .brand {
  font-weight: 800;
  font-size: 22px;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.logo span, .site-name span {
  color: var(--accent);
}

/* ---------- Навигация / меню категорий ---------- */
nav ul, .menu, .nav-list, .categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav a, .menu a, .nav-list a, .categories a {
  display: inline-block;
  padding: 10px 16px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}

nav a:hover, .menu a:hover, .categories a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

nav a.active, .menu a.active {
  background: var(--primary);
  color: #fff;
}

/* ---------- Главный баннер / hero ---------- */
.hero, .banner, .main-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero h1, .hero h2 {
  color: #fff;
  font-size: 36px;
  margin-bottom: 12px;
  position: relative;
}
.hero p {
  font-size: 17px;
  opacity: 0.95;
  max-width: 560px;
  position: relative;
}

/* ---------- Карточки товаров ---------- */
.product-card, .product, .catalog-item, .item, .goods-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.product-card:hover, .product:hover, .catalog-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

/* Изображение товара */
.product-card img, .product img, .catalog-item img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #fafbfd;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: transform var(--transition);
}
.product-card:hover img {
  transform: scale(1.05);
}

/* Название товара */
.product-card h3, .product-card h4,
.product h3, .product h4,
.catalog-item h3, .catalog-item h4 {
  font-size: 15px;
  font-weight: 600;
  padding: 14px 16px 6px;
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  min-height: 54px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Цена */
.price, .product-price, .cost {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  padding: 4px 16px 12px;
  letter-spacing: -0.01em;
  margin-top: auto;
}
.price::after, .product-price::after {
  content: ' ₽';
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Старая цена (если есть) */
.old-price {
  font-size: 14px;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: 500;
  margin-right: 8px;
}

/* ---------- Кнопки ---------- */
.btn, button,
.button, .buy-btn, .add-to-cart {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

/* Основная кнопка — «Купить» */
.btn-primary,
.buy-btn,
.add-to-cart,
button[type="submit"] {
  background: linear-gradient(135deg, var(--accent-warm) 0%, #ff8c42 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}
.btn-primary:hover,
.buy-btn:hover,
.add-to-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.4);
  filter: brightness(1.05);
}
.btn-primary:active { transform: translateY(0); }

/* Вторичная кнопка */
.btn-secondary, .btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-secondary:hover, .btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* Кнопки внутри карточки товара */
.product-card .btn,
.product-card button {
  margin: 0 16px 16px;
  width: calc(100% - 32px);
}

/* ---------- Сетка каталога ---------- */
.catalog-grid, .products-grid, .goods-list, .items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px;
}

/* ---------- Бейджи (хит, новинка, скидка) ---------- */
.badge, .label, .tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.badge-sale { background: #e53935; }
.badge-new  { background: #43a047; }

/* ---------- Футер ---------- */
footer, .footer, .site-footer {
  background: #0f1b2d;
  color: #c9d3e0;
  padding: 48px 24px 24px;
  margin-top: 48px;
}
footer a { color: #c9d3e0; }
footer a:hover { color: #fff; }

footer h3, footer h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

footer .footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}

/* ---------- Формы и инпуты ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="number"],
textarea, select {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: all var(--transition);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.12);
}

/* Поиск */
input[type="search"] {
  background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat 12px center;
  padding-left: 38px;
  border-radius: 24px;
}

/* ---------- Утилиты ---------- */
.container, .wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title, h2.title {
  font-size: 28px;
  margin: 32px 0 20px;
  padding-left: 20px;
  position: relative;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 4px; height: 24px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1024px) {
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 28px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; }
  .product-card img { height: 140px; padding: 10px; }
  .product-card h3, .product-card h4 { font-size: 13px; padding: 10px 10px 4px; min-height: 42px; }
  .price { font-size: 17px; padding: 2px 10px 8px; }
  .product-card .btn { margin: 0 10px 10px; padding: 9px 12px; font-size: 13px; }
  .hero { padding: 24px 18px; margin: 10px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .section-title { font-size: 20px; }
  nav ul, .menu { gap: 2px; }
  nav a, .menu a { padding: 8px 12px; font-size: 13px; }
}

/* ---------- Плавное появление блоков ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.product-card, .catalog-item {
  animation: fadeInUp 0.4s ease both;
}

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #c4cdd8;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: #9aa7b8; }

/* ---------- Cookie-баннер (если есть) ---------- */
.cookie-banner, .cookies {
  background: #0f1b2d !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  padding: 16px 20px !important;
  box-shadow: var(--shadow-lg) !important;
}
.cookie-banner button, .cookies button {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
}

/* ============================================
   КАТЕГОРИИ — .category-row / .category-block
   ============================================ */

/* ---------- Контейнер-сетка ---------- */
.category-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  gap: 24px;
  justify-content: center;
  padding: 28px 20px;
  margin: 0 auto;
  max-width: 1400px;
}

/* ---------- Обёртка категории ---------- */
.category-layout.category-list {
  display: flex;
}
.category-layout .category-block{
min-height: 330px;
}
/* ---------- Сама карточка ---------- */
.category-block {
  width: 330px;
  background: #ffffff;
  border: 1px solid var(--border, #e4e9f0);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 22px;
  text-align: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 30, 80, 0.05);
  cursor: pointer;
}

.category-block:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 119, 200, 0.15);
  border-color: #b8d9f0;
}

/* Декоративная полоска снизу при hover */
.category-block::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #0077c8, #00b8d9);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s ease;
}
.category-block:hover::after {
  transform: scaleX(1);
}

/* ---------- Блок изображения ---------- */
.category-block .image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
  position: relative;
  transition: all 0.35s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 119, 200, 0.08);
}

.category-block:hover .image {
  background: linear-gradient(135deg, #e6f2fb 0%, #d4e9f7 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 119, 200, 0.2),
              0 8px 20px rgba(0, 119, 200, 0.12);
}

.category-block .image a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.category-block .image img,
.category-block .image .img-responsive {
  max-width: 75%;
  max-height: 75%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-block:hover .image img {
  transform: scale(1.12) rotate(-2deg);
}

/* ---------- Подпись (caption) ---------- */
.category-block .caption {
  width: 100%;
  padding: 0 4px;
}

.category-block .caption h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: #1a2332;
  letter-spacing: -0.01em;
  min-height: 80px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s ease;
}

.category-block:hover .caption h3 {
  color: #0077c8;
}

.category-block .caption h3 a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.category-block .caption h3 a:hover {
  color: #0077c8;
}

.category-block .caption p {
  margin: 0;
  font-size: 13px;
  color: #6b7a8f;
  line-height: 1.5;
}

/* ---------- Стрелка-индикатор перехода ---------- */
.category-block .caption h3 a::after {
  content: '→';
  display: inline-block;
  margin-left: 6px;
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.3s ease;
  color: #00b8d9;
  font-weight: 700;
}

.category-block:hover .caption h3 a::after {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

/* Планшеты — карточки чуть меньше */
@media (max-width: 1200px) {
  .category-row {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }
  .category-block {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Мобильные — 2 колонки */
@media (max-width: 768px) {
  .category-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 12px;
  }
  .category-block {
    width: 100%;
    padding: 20px 12px 16px;
    border-radius: 12px;
  }
  .category-block .image {
    width: 120px;
    height: 120px;
    margin-bottom: 12px;
  }
  .category-block .caption h3 {
    font-size: 13px;
    min-height: 36px;
  }
  .category-block .caption p {
    font-size: 11px;
  }
}

/* Очень маленькие экраны — 1 колонка */
@media (max-width: 420px) {
  .category-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .category-block {
    flex-direction: row;
    text-align: left;
    padding: 12px;
    gap: 14px;
  }
  .category-block .image {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .category-block .caption h3 {
    font-size: 14px;
    min-height: auto;
  }
}

/* ============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ
   ============================================ */
@keyframes categoryFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-layout.category-list {
  animation: categoryFadeIn 0.5s ease both;
}

.category-layout.category-list:nth-child(1) { animation-delay: 0.05s; }
.category-layout.category-list:nth-child(2) { animation-delay: 0.10s; }
.category-layout.category-list:nth-child(3) { animation-delay: 0.15s; }
.category-layout.category-list:nth-child(4) { animation-delay: 0.20s; }
.category-layout.category-list:nth-child(5) { animation-delay: 0.25s; }
.category-layout.category-list:nth-child(6) { animation-delay: 0.30s; }
.category-layout.category-list:nth-child(7) { animation-delay: 0.35s; }
.category-layout.category-list:nth-child(8) { animation-delay: 0.40s; }
.category-layout.category-list:nth-child(n+9) { animation-delay: 0.45s; }