/* ============================================================================
   OpticTrend — РЕДИЗАЙН РАЗДЕЛА «НОВОСТИ» (прототип news_redesign_1.html).
   Грузится только на /news/ и только при ot_news_redesign_enabled() (см. header.php).
   Всё заскоуплено под .ot-news (листинг) и .ot-article (статья), чтобы не задеть
   глобальные .breadcrumbs/.pagination/.title/.article сайта.
   Крошки НЕ стилизуем здесь — их даёт стандарт ot_breadcrumbs.css (грузится рядом).
   ============================================================================ */

/* Серый фон страницы #f3f3f3 — как каталог/PDP/кабинет (эталон cabinet.css).
   Класс ot-news-page вешается на <body> в header.php только на /news/ под флагом → фон не течёт на другие страницы.
   Блоки на сером выделяются: сайдбар-панели белые, карточки цветные, текст статьи на сером (как в прототипе). */
body.ot-news-page, body.ot-news-page .main { background: #f3f3f3; }

.ot-news, .ot-article {
  --bg: #f3f3f3;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-soft: #8a8a8a;
  --border: #e5e5e5;
  --border-soft: #efefef;
  --hover: #f5f5f5;
  --ai-accent: #1c3d6e;
  --ai-bg: #eef4ff;
  --ai-border: #cdd9ec;

  --cat-smart-bg: #1c3d6e;
  --cat-sale-bg: #c63131;
  --cat-store-bg: #2c2a26;
  --cat-vision-bg: #5d3a7c;
  --cat-sun-bg: #c8951a;
  --cat-lenses-bg: #1a6b3a;

  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}
.ot-news *, .ot-article * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.ot-news a, .ot-article a { color: inherit; text-decoration: none; }
.ot-news button { font-family: inherit; cursor: pointer; }

/* Категорийные классы-носители фона */
.ot-news .cat-smart, .ot-article .cat-smart { background: var(--cat-smart-bg); }
.ot-news .cat-sale,  .ot-article .cat-sale  { background: var(--cat-sale-bg); }
.ot-news .cat-store, .ot-article .cat-store { background: var(--cat-store-bg); }
.ot-news .cat-vision,.ot-article .cat-vision{ background: var(--cat-vision-bg); }
.ot-news .cat-sun,   .ot-article .cat-sun   { background: var(--cat-sun-bg); }
.ot-news .cat-lenses,.ot-article .cat-lenses{ background: var(--cat-lenses-bg); }

/* ==== HERO ==== */
.ot-news .news-hero { padding: 8px 0 22px; }
.ot-news .news-hero-eyebrow {
  font-size: 11.5px; color: var(--text-soft); text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600; margin-bottom: 10px;
}
.ot-news .news-hero h1 {
  font-size: 36px; font-weight: 700; letter-spacing: -0.7px; line-height: 1.1; margin: 0 0 10px;
}
.ot-news .news-hero p {
  font-size: 16px; color: var(--text-muted); line-height: 1.55; margin: 0; max-width: 600px;
}

/* ==== ЧИПЫ КАТЕГОРИЙ ==== */
.ot-news .category-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border-soft);
}
.ot-news .cat-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  background: #fff; border: 1px solid var(--border); color: var(--text);
  border-radius: 16px; font-size: 13px; font-family: inherit; cursor: pointer; line-height: 1;
}
.ot-news .cat-chip:hover { border-color: var(--text); }
.ot-news .cat-chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.ot-news .cat-chip .count { font-size: 11px; opacity: 0.6; }
.ot-news .cat-chip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ==== FEATURED ==== */
.ot-news .featured-card {
  border-radius: 16px; overflow: hidden; margin-bottom: 14px; padding: 48px 56px 44px;
  position: relative; color: #fff; min-height: 320px; display: flex;
  flex-direction: column; justify-content: flex-end; text-decoration: none;
}
.ot-news .featured-card-decor { position: absolute; right: -40px; top: -40px; opacity: 0.12; pointer-events: none; }
.ot-news .featured-card-decor svg { width: 280px; height: 280px; }
.ot-news .featured-card-top { display: flex; gap: 10px; align-items: center; margin-bottom: auto; position: relative; z-index: 2; }
.ot-news .featured-tag {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px); color: #fff; font-size: 10.5px; font-weight: 700;
  padding: 5px 11px 5px 9px; border-radius: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.ot-news .featured-tag svg { width: 11px; height: 11px; }
.ot-news .featured-cat-label {
  font-size: 11px; color: rgba(255,255,255,0.8); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600;
}
.ot-news .featured-card h2 {
  font-size: 32px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.12;
  margin: 24px 0 12px; max-width: 720px; position: relative; z-index: 2; color: #fff;
}
.ot-news .featured-card-excerpt {
  font-size: 15px; color: rgba(255,255,255,0.85); line-height: 1.55; margin: 0 0 18px; max-width: 620px; position: relative; z-index: 2;
}
.ot-news .featured-card-meta { font-size: 12.5px; color: rgba(255,255,255,0.7); display: flex; gap: 10px; align-items: center; position: relative; z-index: 2; }
.ot-news .featured-card-meta .sep { opacity: 0.5; }

/* ==== LAYOUT ==== */
.ot-news .news-layout { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }
.ot-news .news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ==== КАРТОЧКА СТАТЬИ В СЕТКЕ ==== */
.ot-news .article-card {
  border-radius: 14px; overflow: hidden; padding: 22px 24px 20px; position: relative;
  min-height: 240px; display: flex; flex-direction: column; text-decoration: none; color: #fff; transition: transform 0.12s;
}
.ot-news .article-card:hover { transform: translateY(-3px); }
.ot-news .article-card-decor { position: absolute; right: -20px; bottom: -20px; opacity: 0.10; pointer-events: none; }
.ot-news .article-card-decor svg { width: 140px; height: 140px; }
.ot-news .article-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; position: relative; z-index: 2; }
.ot-news .article-cat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; color: rgba(255,255,255,0.85); }
.ot-news .article-card h3 {
  font-size: 17px; font-weight: 700; line-height: 1.28; margin: 0 0 8px; letter-spacing: -0.15px; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 2;
}
.ot-news .article-card-excerpt {
  font-size: 12.5px; color: rgba(255,255,255,0.78); line-height: 1.5; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 2;
}
.ot-news .article-card-meta { font-size: 11px; color: rgba(255,255,255,0.65); display: flex; gap: 7px; align-items: center; margin-top: auto; position: relative; z-index: 2; }
.ot-news .article-card-meta .sep { opacity: 0.5; }

/* ==== САЙДБАР ==== */
.ot-news .sidebar { position: sticky; top: 14px; }
.ot-news .sidebar-panel { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin-bottom: 14px; }
.ot-news .sidebar-panel-title {
  font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 6px;
}
.ot-news .sidebar-panel-title svg { width: 12px; height: 12px; }
.ot-news .popular-list { display: flex; flex-direction: column; gap: 14px; }
.ot-news .popular-item { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; }
.ot-news .popular-item-num {
  width: 22px; height: 22px; background: var(--bg); border-radius: 50%; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ot-news .popular-item-num.top { background: var(--text); color: #fff; }
.ot-news .popular-item-body { flex: 1; min-width: 0; }
.ot-news .popular-item-cat {
  font-size: 10px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.4px;
  font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 5px;
}
.ot-news .popular-item-cat .dot { width: 6px; height: 6px; border-radius: 50%; }
.ot-news .popular-item h4 {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 0; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ot-news .popular-item:hover h4 { color: var(--ai-accent); }

/* AI-блок */
.ot-news .sidebar-ai-block { background: var(--ai-bg); border: 1px solid var(--ai-border); border-radius: 12px; padding: 18px 20px; text-align: center; }
.ot-news .sidebar-ai-icon {
  width: 36px; height: 36px; background: var(--ai-accent); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 8px;
}
.ot-news .sidebar-ai-icon svg { width: 17px; height: 17px; }
.ot-news .sidebar-ai-block h4 { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: var(--ai-accent); }
.ot-news .sidebar-ai-block p { font-size: 12.5px; color: var(--ai-accent); opacity: 0.8; margin: 0 0 12px; line-height: 1.5; }
.ot-news .sidebar-ai-btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--ai-accent); color: #fff;
  border: none; padding: 8px 16px; border-radius: 16px; font-size: 12.5px; font-weight: 500; font-family: inherit; cursor: pointer;
}
.ot-news .sidebar-ai-btn svg { width: 12px; height: 12px; }

/* ==== ПАГИНАЦИЯ (стилизуем стандартный пейджер Битрикса под .ot-news) ==== */
.ot-news .news-pager { margin: 28px 0 40px; }
.ot-news .news-pager .modern-page-navigation,
.ot-news .news-pager .bx-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ot-news .news-pager a,
.ot-news .news-pager span.modern-page-current,
.ot-news .news-pager .modern-page-current,
.ot-news .news-pager .modern-page-next,
.ot-news .news-pager .modern-page-previous,
.ot-news .news-pager .modern-page-dots {
  min-width: 36px; height: 36px; border-radius: 18px; border: 1px solid var(--border); background: #fff;
  color: var(--text); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; text-decoration: none;
}
.ot-news .news-pager a:hover { border-color: var(--text); }
.ot-news .news-pager .modern-page-current { background: var(--text); color: #fff; border-color: var(--text); }
.ot-news .news-pager .modern-page-dots { border: none; }

/* ============================================================================
   СТРАНИЦА СТАТЬИ (.ot-article)
   ============================================================================ */
.ot-article .article-page { max-width: 760px; margin: 0 auto; }
.ot-article .article-head { padding: 8px 0 28px; }
.ot-article .article-head-cat {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; font-weight: 700; padding: 6px 14px; border-radius: 12px; margin-bottom: 18px; color: #fff;
}
.ot-article .article-head h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.7px; line-height: 1.12; margin: 0 0 18px; }
.ot-article .article-head-meta { font-size: 13px; color: var(--text-muted); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ot-article .article-head-meta svg { width: 14px; height: 14px; }
.ot-article .article-head-meta .item { display: inline-flex; align-items: center; gap: 5px; }

.ot-article .article-hero { border-radius: 16px; padding: 36px 40px; margin-bottom: 32px; position: relative; overflow: hidden; color: #fff; }
.ot-article .article-hero-decor { position: absolute; right: -30px; bottom: -30px; opacity: 0.13; pointer-events: none; }
.ot-article .article-hero-decor svg { width: 220px; height: 220px; }
.ot-article .article-hero-lead {
  font-size: 19px; font-weight: 500; line-height: 1.55; margin: 0; color: rgba(255,255,255,0.95);
  letter-spacing: -0.2px; max-width: 580px; position: relative; z-index: 2;
}

.ot-article .article-content { font-size: 16.5px; line-height: 1.75; color: var(--text); }
.ot-article .article-content p { margin: 0 0 18px; }
.ot-article .article-content h2 { font-size: 24px; font-weight: 700; margin: 36px 0 14px; letter-spacing: -0.4px; }
.ot-article .article-content h3 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; }
.ot-article .article-content ul, .ot-article .article-content ol { padding-left: 24px; margin: 0 0 18px; }
.ot-article .article-content ul li, .ot-article .article-content ol li { margin-bottom: 8px; }
.ot-article .article-content blockquote {
  border-left: 3px solid var(--ai-accent); padding: 4px 0 4px 18px; margin: 22px 0;
  font-style: italic; color: var(--text-muted); font-size: 17px;
}
.ot-article .article-content a { color: var(--ai-accent); border-bottom: 1px solid var(--ai-border); }

/* Кнопки-ссылки внутри статей (импортные блоки <div class="btns"><a class="btn|btn light">...).
   Скоуп .ot-article .article-content .btn — не конфликтует с глобальным .btn lens4u (он вне статьи). */
.ot-article .article-content .btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; align-items: center; }
.ot-article .article-content .btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 11px 20px; border-radius: 22px;
	font-size: 14px; font-weight: 600; line-height: 1.2;
	background: var(--text); color: #fff; border: 1px solid var(--text);
	text-decoration: none; transition: background .12s, color .12s, border-color .12s;
}
.ot-article .article-content a.btn { border-bottom: 1px solid var(--text); color: #fff; } /* перебиваем общее правило ссылок */
.ot-article .article-content .btn:hover { background: #000; border-color: #000; color: #fff; }
.ot-article .article-content .btn.light {
	background: #fff; color: var(--text); border: 1px solid var(--border);
}
.ot-article .article-content a.btn.light { border-bottom: 1px solid var(--border); color: var(--text); }
.ot-article .article-content .btn.light:hover { background: #fff; border-color: var(--text); color: var(--text); }

/* Аватарка автора-«редакции» вместо битой /local/img/authors/optic-expert.jpg — наш SVG-«глаз» в круге. */
.ot-article .article-content .ot-author-avatar {
	display: inline-flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; border-radius: 50%;
	background: var(--ai-bg); color: var(--ai-accent);
	flex-shrink: 0; vertical-align: middle;
}
.ot-article .article-content .ot-author-avatar svg { width: 22px; height: 22px; }
.ot-article .article-content img { max-width: 100%; height: auto; border-radius: 12px; }
.ot-article .article-content figure { margin: 22px 0; }
.ot-article .article-content figcaption { font-size: 13px; color: var(--text-soft); margin-top: 6px; }

/* AI-CTA в статье */
.ot-article .article-ai-cta { background: var(--ai-bg); border: 1px solid var(--ai-border); border-radius: 12px; padding: 22px 26px; margin: 28px 0; display: flex; align-items: center; gap: 16px; }
.ot-article .article-ai-cta-icon { width: 44px; height: 44px; background: var(--ai-accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ot-article .article-ai-cta-icon svg { width: 20px; height: 20px; }
.ot-article .article-ai-cta-body { flex: 1; }
.ot-article .article-ai-cta h4 { font-size: 15px; font-weight: 700; margin: 0 0 3px; color: var(--ai-accent); }
.ot-article .article-ai-cta p { font-size: 13px; color: var(--ai-accent); opacity: 0.85; margin: 0; }
.ot-article .article-ai-cta a { background: var(--ai-accent); color: #fff; padding: 9px 18px; border-radius: 16px; font-size: 13px; font-weight: 500; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: none; }
.ot-article .article-ai-cta a svg { width: 12px; height: 12px; }

/* Поделиться */
.ot-article .article-share { display: flex; gap: 8px; align-items: center; margin: 36px 0 28px; padding: 18px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.ot-article .article-share-label { font-size: 12.5px; color: var(--text-muted); margin-right: 6px; }
.ot-article .share-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); border: none; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; }
.ot-article .share-btn:hover { background: var(--text); color: #fff; }
.ot-article .share-btn svg { width: 15px; height: 15px; }

/* Похожее */
.ot-article .article-related { margin-top: 36px; }
.ot-article .article-related h3 { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin: 0 0 14px; }
.ot-article .related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* карточки внутри related переиспользуют .ot-news .article-card — задаём те же правила локально */
.ot-article .related-grid .article-card { border-radius: 14px; overflow: hidden; padding: 20px 22px 18px; position: relative; min-height: 180px; display: flex; flex-direction: column; text-decoration: none; color: #fff; }
.ot-article .related-grid .article-card-decor { position: absolute; right: -20px; bottom: -20px; opacity: 0.10; pointer-events: none; }
.ot-article .related-grid .article-card-decor svg { width: 140px; height: 140px; }
.ot-article .related-grid .article-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; position: relative; z-index: 2; }
.ot-article .related-grid .article-cat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; color: rgba(255,255,255,0.85); }
.ot-article .related-grid .article-card h3 { font-size: 15px; font-weight: 700; line-height: 1.28; margin: 0 0 8px; color: #fff; text-transform: none; letter-spacing: -0.15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; position: relative; z-index: 2; }
.ot-article .related-grid .article-card-meta { font-size: 11px; color: rgba(255,255,255,0.65); display: flex; gap: 7px; align-items: center; margin-top: auto; position: relative; z-index: 2; }
.ot-article .related-grid .article-card-meta .sep { opacity: 0.5; }

/* Кнопка «назад к списку» на мобайле статьи */
.ot-article .article-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin: 4px 0 10px; }
.ot-article .article-back svg { width: 14px; height: 14px; }
.ot-article .article-back:hover { color: var(--text); }

/* ==== RESPONSIVE ==== */
@media (max-width: 1000px) {
  .ot-news .news-layout { grid-template-columns: 1fr; }
  .ot-news .sidebar { position: static; }
  .ot-news .news-grid { grid-template-columns: repeat(2, 1fr); }
  .ot-news .featured-card { padding: 40px 36px; min-height: 280px; }
  .ot-news .featured-card h2 { font-size: 26px; }
}
@media (max-width: 700px) {
  .ot-news .news-grid { grid-template-columns: 1fr; }
  .ot-article .related-grid { grid-template-columns: 1fr; }
  .ot-news .news-hero h1 { font-size: 26px; }
  .ot-news .featured-card { padding: 32px 26px; }
  .ot-news .featured-card h2 { font-size: 22px; }
  .ot-article .article-head h1 { font-size: 26px; }
  .ot-article .article-hero { padding: 26px 24px; }
  .ot-article .article-hero-lead { font-size: 16px; }
  .ot-article .article-content { font-size: 15.5px; }
  .ot-article .article-content h2 { font-size: 20px; }
  .ot-article .article-ai-cta { flex-direction: column; text-align: center; }
}
