/* ============================================================================
   DeliveryGoods — секции страниц (@layer components). Hero, тикер ставок,
   карта покрытия, мобильное меню + адаптив секций. Порт из прототипа.
   Подключается через extra_css. SEO-страницы (route/city/service) дополняют
   этот файл своими блоками в Фазе 4.
   ============================================================================ */

@layer components {

  /* Мобильное меню (drawer) перенесено в ui.css — оно глобальное (часть шапки) */

  /* ── Hero ──────────────────────────────────────────────────────────── */
  .hero { position: relative; padding: calc(64px * var(--density)) 0 calc(72px * var(--density)); overflow: hidden; }
  .hero::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
      radial-gradient(52% 46% at 82% -4%, var(--accent-tint), transparent 72%),
      radial-gradient(var(--line-2) 1.1px, transparent 1.1px) 0 0 / 26px 26px;
    -webkit-mask-image: radial-gradient(130% 100% at 70% -10%, #000 30%, transparent 78%);
    mask-image: radial-gradient(130% 100% at 70% -10%, #000 30%, transparent 78%);
    opacity: .55;
  }
  .hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
  [data-hero="center"] .hero-inner { grid-template-columns: 1fr; max-width: 760px; margin: 0 auto; text-align: center; }
  [data-hero="center"] .trust-row { justify-content: center; }
  [data-hero="center"] .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .hero h1 em { font-style: normal; color: var(--accent); }
  .hero-sub { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); margin-top: 22px; max-width: 30ch; }
  [data-hero="center"] .hero-sub { max-width: 46ch; }
  .trust-row { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; }
  .trust-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
  .trust-pill svg { width: 17px; height: 17px; color: var(--positive); flex: none; }

  /* ── Живой тикер ставок ────────────────────────────────────────────── */
  .rate-tape { margin-top: 30px; max-width: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in oklab, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); overflow: hidden; }
  [data-hero="center"] .rate-tape { margin-left: auto; margin-right: auto; }
  .rate-tape-head { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 11.5px; font-family: var(--font-mono); letter-spacing: .04em; color: var(--ink-2); text-transform: uppercase; }
  .rate-tape-head .rt-ago { margin-left: auto; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-family: var(--font-text); }
  .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); position: relative; flex: none; }
  .live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--positive); animation: livepulse 1.8s ease-out infinite; }
  @keyframes livepulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
  .rate-tape-viewport { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
  .rate-tape-track { display: flex; gap: 10px; padding: 11px 0; width: max-content; animation: tape 32s linear infinite; }
  .rate-tape:hover .rate-tape-track { animation-play-state: paused; }
  @media (prefers-reduced-motion: reduce) { .rate-tape-track { animation: none; } }
  @keyframes tape { to { transform: translateX(-50%); } }
  .rt-chip { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); white-space: nowrap; flex: none; }
  .rt-chip .rt-route { font-size: 12.5px; color: var(--ink-2); }
  .rt-chip .rt-price { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--ink); }
  .rt-chip .rt-tick { font-family: var(--font-mono); font-size: 11px; }
  .rt-chip .rt-tick.up { color: var(--positive); }
  .rt-chip .rt-tick.down { color: oklch(0.6 0.13 25); }

  /* ── Карта покрытия (дашборд) ──────────────────────────────────────── */
  .network { position: relative; background: oklch(0.16 0.018 158); color: oklch(0.96 0.005 158); padding: calc(84px * var(--density)) 0 calc(72px * var(--density)); overflow: hidden; }
  .net-aurora { position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(50% 60% at 18% 12%, var(--accent-tint), transparent 70%), radial-gradient(46% 70% at 88% 90%, oklch(0.55 0.13 158 / .14), transparent 72%); }
  .net-head { position: relative; max-width: 680px; }
  .net-head .eyebrow { color: oklch(0.78 0.12 158); }
  .net-head h2 { color: #fff; margin-top: 14px; }
  .net-head p { color: oklch(0.74 0.012 158); margin-top: 14px; font-size: 17px; max-width: 56ch; }
  .net-stage { position: relative; margin-top: 30px; }
  .net-map-wrap { position: relative; min-height: 200px; }
  #netMap { width: 100%; height: auto; display: block; overflow: visible; }
  .net-map-fallback { width: 100%; height: auto; display: block; opacity: .9; }
  .net-land { fill: oklch(0.2 0.02 158 / .35); stroke: none; }
  .net-cover { opacity: .85; }
  .net-cover-dot { fill: oklch(0.52 0.07 158); }
  .net-city { fill: oklch(0.7 0.09 158); }
  .net-city.hub { fill: oklch(0.85 0.11 158); filter: drop-shadow(0 0 4px oklch(0.78 0.14 158 / .9)); }
  .net-city.conf { fill: oklch(0.78 0.15 158); filter: drop-shadow(0 0 5px oklch(0.72 0.16 158)); }
  .net-label { fill: oklch(0.8 0.015 158); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; paint-order: stroke; stroke: oklch(0.14 0.015 158); stroke-width: 2.4px; }
  .net-label.hub { fill: oklch(0.94 0.01 158); }

  /* HUD-панели */
  .net-panel {
    position: absolute; z-index: 2; background: oklch(0.19 0.02 158 / .72);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid oklch(0.42 0.04 158 / .55); border-radius: 12px; padding: 14px 16px;
    font-family: var(--font-mono); box-shadow: 0 8px 30px rgba(0,0,0,.35);
  }
  .net-panel::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, oklch(0.7 0.13 158 / .8), transparent); }
  .net-hud { top: 14px; left: 14px; min-width: 208px; padding: 12px 14px; }
  .np-head { display: flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: oklch(0.78 0.05 158); margin-bottom: 12px; }
  .np-led { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 3px oklch(0.7 0.13 158 / .18); }
  .np-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 5px 0; font-size: 11.5px; }
  .np-row span { color: oklch(0.66 0.015 158); text-transform: uppercase; letter-spacing: .04em; }
  .np-row b { font-size: 15px; font-weight: 500; color: #fff; font-variant-numeric: tabular-nums; }
  .net-legend { bottom: 14px; left: 14px; padding: 11px 14px; }
  .nl-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 11px; color: oklch(0.74 0.015 158); text-transform: uppercase; letter-spacing: .05em; }
  .nl-g { width: 16px; height: 14px; flex: none; background-repeat: no-repeat; background-position: center; }
  .nl-g.node { background-image: radial-gradient(circle at center, oklch(0.85 0.11 158) 3.4px, transparent 4px); }
  .nl-g.conf { background-image: radial-gradient(circle at center, oklch(0.78 0.15 158) 3.4px, transparent 4px); }
  .nl-g.cover { background-image: radial-gradient(circle at center, oklch(0.55 0.07 158) 0.9px, transparent 1.4px); background-size: 5px 5px; }
  .net-routeinfo { top: 14px; right: 14px; min-width: 208px; padding: 12px 14px; }
  .nr-pair { display: flex; flex-direction: column; gap: 3px; padding-bottom: 9px; margin-bottom: 5px; border-bottom: 1px solid oklch(0.42 0.04 158 / .4); }
  .nr-pair span, .nr-row span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: oklch(0.62 0.015 158); }
  .nr-pair b { font-size: 13.5px; color: #fff; font-family: var(--font-text); font-weight: 500; transition: opacity .3s; }
  .nr-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 4px 0; }
  .nr-row b { font-size: 13px; color: oklch(0.86 0.03 158); font-variant-numeric: tabular-nums; transition: opacity .3s; }

  /* ── Адаптив секций ────────────────────────────────────────────────── */
  @media (max-width: 1080px) {
    .hero-inner { grid-template-columns: 1fr; gap: 36px; }
    [data-hero="split"] .hero-copy { max-width: 640px; }
    .types-grid { grid-template-columns: repeat(2, 1fr); }
    .routes-grid { grid-template-columns: repeat(2, 1fr); }
    .guarantee-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 900px) {
    .net-panel { position: static; -webkit-backdrop-filter: none; backdrop-filter: none; background: oklch(0.2 0.02 158 / .55); margin-top: 12px; }
    .net-panel::before { display: none; }
    .net-hud { min-width: 0; }
    .net-legend, .net-routeinfo { display: none; }
    .net-hud .np-row { font-size: 12.5px; }
    .net-hud .np-row b { font-size: 16px; }
  }
  @media (max-width: 720px) {
    .hero { padding: 36px 0 44px; }
    .types-grid { grid-template-columns: 1fr 1fr; }
    .steps { grid-template-columns: 1fr; gap: 28px; }
    .step { padding: 0 0 28px; }
    .step:not(:last-child)::after { left: 0; right: auto; top: auto; bottom: 0; width: 40px; height: 1px; }
    .routes-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 460px) {
    .types-grid { grid-template-columns: 1fr; }
  }

  /* ════════════════════════════════════════════════════════════════════
     SEO-страницы (route / city / service / cargo / blog).
     Контракт классов для шаблонов Фазы 4 + макросов (macros.html).
     ════════════════════════════════════════════════════════════════════ */

  /* ── Хлебные крошки ────────────────────────────────────────────────── */
  .breadcrumbs { padding-top: 18px; }
  .breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; list-style: none; padding: 0; margin: 0; font-size: 13px; }
  .breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
  .breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--line-2); }
  .breadcrumbs a { color: var(--ink-2); }
  .breadcrumbs a:hover { color: var(--accent); }
  .breadcrumbs [aria-current="page"] { color: var(--ink); }

  /* ── Компактный hero SEO-страницы ──────────────────────────────────── */
  .page-hero { position: relative; padding: 22px 0 calc(40px * var(--density)); overflow: hidden; }
  .page-hero::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(48% 44% at 88% -8%, var(--accent-tint), transparent 72%),
                radial-gradient(var(--line-2) 1.1px, transparent 1.1px) 0 0 / 26px 26px;
    -webkit-mask-image: radial-gradient(120% 100% at 75% -10%, #000 28%, transparent 76%);
    mask-image: radial-gradient(120% 100% at 75% -10%, #000 28%, transparent 76%);
    opacity: .5;
  }
  .page-hero > .wrap { position: relative; z-index: 1; }
  .page-hero .eyebrow { margin-bottom: 14px; display: inline-block; }
  .page-hero h1 { max-width: 20ch; }
  .page-hero .lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); margin-top: 16px; max-width: 60ch; }
  .page-facts { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 26px; }
  .page-fact { display: flex; flex-direction: column; gap: 2px; }
  .page-fact .k { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .07em; }
  .page-fact .v { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
  .page-fact .v.accent { color: var(--accent); }
  .page-cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

  /* ── Таблица цен ───────────────────────────────────────────────────── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pricing-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .pricing-table th, .pricing-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
  .pricing-table thead th { background: var(--surface-2); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
  .pricing-table tbody tr:last-child td { border-bottom: 0; }
  .pricing-table tbody tr:hover { background: var(--surface-2); }
  .pricing-table th:last-child, .pricing-table td:last-child { text-align: right; }
  .pricing-table td:last-child { color: var(--accent); font-weight: 600; }

  /* ── FAQ-аккордеон (нативные <details>, без JS) ────────────────────── */
  .faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
  .faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
  .faq-item[open] { border-color: var(--line-2); }
  .faq-q { cursor: pointer; padding: 16px 20px; font-weight: 500; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--ink); }
  .faq-q::-webkit-details-marker { display: none; }
  .faq-q::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform var(--transition-base); flex: none; }
  .faq-item[open] .faq-q::after { transform: rotate(-135deg); }
  .faq-a { padding: 0 20px 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
  .faq-a p { margin-bottom: 10px; }
  .faq-a p:last-child { margin-bottom: 0; }

  /* ── Длинный SEO-текст (проза) ─────────────────────────────────────── */
  .prose { max-width: 760px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
  .prose > :first-child { margin-top: 0; }
  .prose h2 { margin: 34px 0 12px; }
  .prose h3 { margin: 26px 0 10px; }
  .prose p { margin-bottom: 14px; }
  .prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
  .prose li { margin-bottom: 6px; }
  .prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
  .prose strong, .prose b { color: var(--ink); font-weight: 600; }

  /* ── Инфо/преимущества-карточки ────────────────────────────────────── */
  .info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
  .info-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .info-card .info-ico { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
  .info-card .info-ico svg { width: 22px; height: 22px; }
  .info-card h3 { font-size: 16px; letter-spacing: -0.01em; }
  .info-card p { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.5; }

  /* ── Перелинковка: «показать все направления» (CSS-only disclosure) ── */
  .routes-disclosure { margin-top: 14px; }
  .routes-disclosure > summary { display: inline-flex; list-style: none; cursor: pointer; }
  .routes-disclosure > summary::-webkit-details-marker { display: none; }
  .routes-disclosure[open] > summary { display: none; }
  .routes-disclosure > .routes-grid { margin-top: 12px; }

  /* ── Узкий контейнер для контента статьи/блога ─────────────────────── */
  .content-narrow { max-width: 820px; }
  .page-section-title { margin-bottom: 22px; }

  /* ── Мета-строка карточки (блог/категории) — токены, не inline ──────── */
  .card-meta {
    font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: .07em;
  }

  /* ── CTA-баннер (статьи блога) — акцентный, заменяет AI-градиенты ───── */
  .cta-banner {
    margin: 28px 0;
    padding: clamp(22px, 4vw, 32px);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent), var(--accent-press));
    color: var(--accent-ink);
    box-shadow: var(--shadow-2);
  }
  .cta-banner :is(h2, h3, h4) { color: var(--accent-ink); margin-top: 0; }
  .cta-banner p { color: color-mix(in oklab, var(--accent-ink) 86%, transparent); margin: 8px 0 0; }
  .cta-banner a:not(.btn) { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
  .cta-banner .btn { margin-top: 16px; }

  /* ── Колауты в прозе статей (заменяют ad-hoc inline hex) ────────────── */
  .callout {
    margin: 18px 0; padding: 16px 18px;
    border: 1px solid var(--line); border-left: 4px solid var(--accent);
    border-radius: var(--radius); background: var(--accent-tint);
    color: var(--ink); font-size: 15px; line-height: 1.6;
  }
  .callout > :first-child { margin-top: 0; }
  .callout > :last-child { margin-bottom: 0; }
  .callout--ok   { border-left-color: var(--positive); background: var(--positive-tint); }
  .callout--warn { border-left-color: oklch(0.76 0.15 75); background: oklch(0.76 0.15 75 / 0.12); }
  .callout--bad  { border-left-color: var(--danger); background: var(--danger-tint); }

  /* ── Bootstrap-совместимость в прозе статей ──────────────────────────
     Статьи блога написаны на легаси Bootstrap-классах (card/card-header/
     badge/bg-*/text-*), которых нет в дизайн-системе — без этого слоя
     заголовки карточек рендерились невидимым белым по прозрачному фону.
     Маппим на токены, scoped под .prose, чтобы не протекало на другие
     страницы (там .prose содержит только текст, без .card). */
  .prose .card {
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); overflow: hidden; margin: 18px 0;
  }
  .prose .card-body { padding: 16px 18px; }
  .prose .card-header {
    padding: 12px 18px; font-weight: 600; color: var(--ink);
    background: var(--surface-2); border-bottom: 1px solid var(--line);
  }
  .prose .card-header :is(h1, h2, h3, h4, h5, h6) { margin: 0; font-size: 1.05em; color: inherit; }
  .prose .bg-primary { background: var(--accent); }
  .prose .bg-success { background: var(--positive); }
  .prose .bg-danger  { background: var(--danger); }
  .prose .bg-info    { background: oklch(0.55 0.09 220); }
  .prose .bg-warning { background: oklch(0.76 0.15 75); }
  .prose .bg-light   { background: var(--surface-2); }
  .prose .card-header:is(.bg-primary, .bg-success, .bg-danger, .bg-info, .bg-warning) { border-bottom-color: transparent; }
  .prose .text-white,
  .prose .text-white :is(h1, h2, h3, h4, h5, h6, p, span, strong, b, a, li) { color: #fff; }
  .prose .text-muted { color: var(--ink-3); }
  .prose .small { font-size: 0.875em; }
  .prose .mb-4 { margin-bottom: 24px; }
  .prose .mb-3 { margin-bottom: 16px; }
  .prose .mt-4 { margin-top: 24px; }
  /* бейджи (в т.ч. кружки-нумерация шагов) */
  .prose .badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.85em; color: #fff;
    border-radius: var(--radius-sm); padding: 3px 9px;
  }
  .prose .badge.rounded-circle { border-radius: 50%; aspect-ratio: 1; padding: 0; }
  .prose .badge.p-2 { width: 38px; height: 38px; }
  .prose .badge.p-3 { width: 46px; height: 46px; }
}

