/* ============================================
   МИР ЛЕКАРСТВ — основной стиль
   Медицинский, строгий, доверие
   ============================================ */

:root {
  --blue-dark: #1B4F72;      /* основной синий */
  --blue-mid: #2E6DA4;       /* синий светлее */
  --blue-light: #EBF5FB;     /* подложки */
  --text-dark: #2C3E50;      /* основной текст */
  --text-mid: #5D6D7E;       /* вторичный */
  --green: #27AE60;          /* в наличии, успех */
  --red: #C0392B;            /* предупреждения */
  --white: #FFFFFF;
  --border: #D5DBDB;         /* рамки */
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 10px;
}

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

body {
  font-family: 'PT Sans', 'Inter', Arial, sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'PT Serif', 'Playfair Display', Georgia, serif;
  color: var(--blue-dark);
  font-weight: 600;
}

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

/* ============ ШАПКА ============ */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo img { height: 42px; width: 42px; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-family: 'PT Serif', serif; font-size: 20px; font-weight: 700; color: var(--blue-dark); line-height: 1.1; }
.logo-sub { font-size: 11px; color: var(--text-mid); }

.nav { display: flex; gap: 24px; align-items: center; }
.nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}
.nav a:hover { color: var(--blue-dark); }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--blue-dark); color: var(--white); }
.btn-primary:hover { background: var(--blue-mid); }
.btn-outline { border: 2px solid var(--blue-dark); color: var(--blue-dark); background: transparent; }
.btn-outline:hover { background: var(--blue-light); }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { opacity: 0.9; }

/* Бургер */
.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; }
.burger span { width: 26px; height: 3px; background: var(--blue-dark); border-radius: 2px; }

/* ============ HERO ============ */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  color: var(--white);
  padding: 70px 0;
  text-align: center;
}
.hero h1 { color: var(--white); font-size: 40px; margin-bottom: 16px; }
.hero p { font-size: 18px; opacity: 0.9; max-width: 700px; margin: 0 auto 30px; }
.hero .btn { font-size: 17px; padding: 14px 36px; }

/* ============ БЛОКИ ============ */
.section { padding: 56px 0; }
.section-title { text-align: center; font-size: 30px; margin-bottom: 40px; }
.section-alt { background: var(--blue-light); }

/* Три преимущества */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.feature {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--text-mid); }

/* Шаги */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; counter-reset: step; }
.step { text-align: center; padding: 24px; }
.step-num {
  width: 48px; height: 48px;
  background: var(--blue-dark); color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  margin: 0 auto 16px;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--text-mid); }

/* ============ КАРТОЧКИ ТОВАРОВ ============ */
.catalog-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 992px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .catalog-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.product-card:hover { transform: translateY(-3px); }
.product-card img { width: 100%; height: 180px; object-fit: contain; background: #fff; padding: 12px; border: 1px solid #e0e0e0; border-radius: 4px; }
.product-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { font-size: 16px; margin-bottom: 4px; min-height: 44px; display: flex; align-items: center; }
.product-card .dose { font-size: 13px; color: var(--text-mid); margin-bottom: 10px; }
.stock { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.stock-in { color: var(--green); }
.stock-out { color: var(--text-mid); }
.product-card .btn { margin-top: auto; text-align: center; }

/* ============ ТОВАР (карточка) ============ */
.breadcrumbs { font-size: 13px; color: var(--text-mid); padding: 20px 0 0; }
.breadcrumbs a { color: var(--blue-mid); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 30px 0 50px;
}
@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15px; padding: 0 10px; }
  .section-title { font-size: 24px; }
  .container { padding: 0 16px; }
}
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; } }
.product-photo {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  min-height: 320px;
}
.product-photo img { max-width: 100%; max-height: 320px; object-fit: contain; }
.product-info h1 { font-size: 28px; margin-bottom: 6px; }
.product-info .dose { font-size: 16px; color: var(--text-mid); margin-bottom: 16px; }
.product-info .stock { font-size: 16px; }
.product-info .actions { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; }

.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 15px; }
.spec-table td:first-child { color: var(--text-mid); width: 40%; }

.disc { background: var(--blue-light); border-left: 4px solid var(--blue-mid); padding: 14px 18px; font-size: 13px; color: var(--text-mid); border-radius: 0 8px 8px 0; margin: 20px 0; }

/* Похожие */
.related { padding: 30px 0 60px; }

/* ============ СТРАНИЦЫ ============ */
.page-hero { background: var(--blue-light); padding: 40px 0; text-align: center; }
.page-hero h1 { font-size: 32px; }
.page-content { padding: 40px 0 60px; max-width: 800px; }
.page-content h2 { font-size: 22px; margin: 28px 0 12px; }
.page-content p { margin-bottom: 14px; color: var(--text-dark); }
.page-content ul { margin: 0 0 14px 20px; }

/* ============ ФОРМЫ ============ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: 2px solid var(--blue-mid); border-color: transparent; }

/* ============ ФУТЕР ============ */
.footer { background: var(--blue-dark); color: var(--white); padding: 40px 0 20px; }
.footer-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer h4 { color: var(--white); font-size: 16px; margin-bottom: 12px; }
.footer a { color: rgba(255,255,255,0.8); text-decoration: none; display: block; margin-bottom: 6px; font-size: 14px; }
.footer a:hover { color: var(--white); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.15); margin-top: 30px; padding-top: 16px; font-size: 13px; color: rgba(255,255,255,0.6); }

/* ============ АДАПТИВ ============ */
@media (max-width: 768px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); flex-direction: column; padding: 20px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .burger { display: flex; }
  .features, .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  /* Симметрия на мобильных */
  .hero, .section, .page-hero, .page-content { text-align: center; }
  .page-content ul, .page-content ol { text-align: left; max-width: 480px; margin-left: auto; margin-right: auto; }
  .spec-table { max-width: 480px; margin-left: auto; margin-right: auto; }
  .product-detail { text-align: left; }
  .product-info .actions { justify-content: center; }
  .breadcrumbs { text-align: left; }
  .footer-inner { text-align: left; }
  .footer-bottom { text-align: center; }
}

/* Утилиты */
.text-center { text-align: center; }
.mt-2 { margin-top: 20px; }
.mt-4 { margin-top: 40px; }

/* ===== Значки термо-режима и рецепта ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}
.badge-normal { background: #e8f5e9; color: #2e7d32; }
.badge-cold { background: #e3f2fd; color: #1565c0; }
.badge-recipe { background: #fff3e0; color: #e65100; }

/* ===== Юр. дисклеймеры в футере ===== */
.footer-legal {
  border-top: 1px solid rgba(255,255,255,0.15);
  margin-top: 24px;
  padding-top: 16px;
  font-size: 12px;
  opacity: 0.75;
  line-height: 1.7;
}
.footer-legal p { margin: 6px 0; }

/* ===== Галерея (миниатюры-калейдоскоп) ===== */
.gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}
.gallery-thumbs .thumb {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.gallery-thumbs .thumb:hover { transform: scale(1.06); }
.gallery-thumbs .thumb-active { border-color: var(--green, #27ae60); }

/* ===== Lightbox (увеличение по клику) ===== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* ===== Блоки состава и фасовки ===== */
.spec-block {
  background: #f8fafc;
  border: 1px solid #e8edf2;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0;
}
.spec-block h3 {
  font-size: 15px;
  color: var(--blue-dark, #1B4F72);
  margin-bottom: 6px;
}
.spec-block p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark, #2c3e50);
  margin: 0;
}
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.spec-block.small { margin: 0; }
@media (max-width: 560px) {
  .spec-grid { grid-template-columns: 1fr; }
}

/* ===== Блок цен ===== */
.price-block {
  background: #fffbea;
  border: 1px solid #f0e2b6;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 16px 0;
}
.price-tur { font-size: 15px; margin-bottom: 4px; }
.price-tur b { font-size: 19px; color: #c0392b; }
.price-note { font-size: 12px; color: var(--text-mid); }
.price-rf { font-size: 13px; color: var(--text-mid); margin-bottom: 4px; text-decoration: line-through; }
.price-save { font-size: 13px; color: #27ae60; font-weight: 600; margin-bottom: 6px; }
.price-disclaimer { font-size: 11px; color: var(--text-mid); opacity: 0.8; }

/* ===== Пояснение про мин. партию ===== */
.price-party {
  font-size: 12px;
  color: var(--text-mid);
  margin: 6px 0;
  line-height: 1.5;
}

/* ===== Цена в карточке каталога ===== */
.card-price {
  font-size: 16px;
  font-weight: 700;
  color: #c0392b;
  margin-bottom: 4px;
}
.price-min {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-mid);
}

/* ===== Документы ===== */
.doc-meta {
  color: #888;
  font-size: 0.9em;
  margin-bottom: 24px;
}
.doc-divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 40px 0;
}
.page-content h3 {
  margin-top: 24px;
  font-size: 1.15em;
  color: #1a3a5c;
}
.page-content ul, .page-content ol {
  padding-left: 22px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.page-content li {
  margin-bottom: 6px;
}
.page-content p {
  line-height: 1.7;
  margin-bottom: 12px;
}

/* ===== Карточка товара: блоки доверия и шагов ===== */
.trust-block {
  background: #f0f7f0;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 15px;
  line-height: 1.6;
}
.trust-block p { margin: 4px 0; }
.order-steps {
  padding-left: 22px;
  line-height: 1.8;
  font-size: 15px;
}
.order-steps li { margin-bottom: 8px; }
.disc-legal {
  background: #f5f5f5;
  border-left-color: #999;
  font-size: 13px;
  line-height: 1.6;
}

/* ===== Фильтры каталога (P0-4/5) ===== */
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.catalog-filters .filter-btn {
  padding: 10px 18px;
  border: 1px solid var(--border, #ddd);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.catalog-filters .filter-btn:hover { border-color: var(--blue-mid); color: var(--blue-mid); }
.catalog-filters .filter-btn.active { background: var(--blue-mid, #0d3b66); color: #fff; border-color: var(--blue-mid, #0d3b66); }
@media (max-width: 480px) {
  .catalog-filters { flex-direction: column; }
  .catalog-filters .filter-btn { width: 100%; text-align: center; padding: 14px; font-size: 16px; }
}

.feature-icon svg { display: block; margin: 0 auto; }

/* ===== Блок цены: выделение ===== */
.price-block {
  background: #f0f7f0;
  border: 1px solid #d5e8d5;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 32px 0 16px;
}
.price-tur { font-size: 20px; margin-bottom: 8px; }
.price-tur b { color: #c0392b; font-size: 24px; }
.price-note { font-size: 14px; color: #666; font-weight: 400; }
.price-party { font-size: 15px; color: #2d5a2d; }
.price-disclaimer { font-size: 12px; color: #888; margin-top: 8px; }

/* ===== Бейдж доверия ===== */
.trust-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #2d5a2d;
  border: 1px solid #a5d6a7;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 12px;
  vertical-align: middle;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .trust-badge { display: none; }
}

.header-badge { margin-left: 16px; }
@media (max-width: 992px) { .header-badge { display: none; } }
