/* NST Plus v15 — design refinements. Loaded after the existing public styles. */

/* Preserve the brand spelling: НСТ плюс. */
.eyebrow-brand { text-transform: none; }

/* v15: compact service overview and visible search context. */
.hero-process {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
  margin-bottom: 0;
  padding: 22px 0 26px;
}
.hero-process li { display: flex; align-items: center; gap: 12px; padding: 0; }
.hero-process li > span { color: #9fb8cc; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.hero-process strong { margin: 0; font-size: .9375rem; line-height: 1.5; font-weight: 500; }
.catalog-search { margin-bottom: 16px; }
.catalog-status { margin-bottom: 24px; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.catalog-filters li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; max-width: 100%; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); font-size: .875rem; }
.catalog-filters li > span { min-width: 0; overflow-wrap: anywhere; }
.catalog-filters strong { font-weight: 500; color: var(--navy); }
.catalog-filters a { display: inline-flex; align-items: center; min-height: 36px; font-size: .8125rem; font-weight: 500; }
.catalog-status .catalog-meta { justify-content: flex-start; gap: 7px; margin: 0; }
.catalog-empty { text-align: left; }
.catalog-empty p { max-width: 52ch; margin-bottom: 0; }
.catalog-empty .button { margin-top: 22px; }
@media (max-width: 700px) {
  .hero-process { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; margin-top: 28px; padding-block: 20px 24px; }
  .hero-process li { align-items: baseline; gap: 9px; }
  .hero-process strong { font-size: .875rem; }
  .catalog-filters { flex-direction: column; }
  .catalog-filters li { justify-content: space-between; }
}

/* One quiet interaction rhythm. Gallery transitions and translucent panels stay. */
:root { --motion-fast: 220ms; --motion-enter: 360ms; --motion-ease: cubic-bezier(.22,.61,.36,1); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .button, .category-card, .product-card, .news-card, .document-card {
    transition: border-color var(--motion-fast), background-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast) var(--motion-ease);
  }
  .button::after { display: none; }
  .button:hover:not(:disabled) { transform: translateY(-1px); }
  .category-card:hover, .product-card:hover, .news-card:hover, .document-card:hover { transform: translateY(-2px); }
  .product-card:hover .product-media img { transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .tech-entered { animation-duration: var(--motion-enter); animation-name: nst-polish-enter; }
  .hero::before { animation-duration: 2400ms; }
  .tech-scan .hero-stage::after { animation-duration: 1800ms; }
}
@keyframes nst-polish-enter { from { opacity: .25; transform: translateY(10px); } to { opacity: 1; transform: none; } }


/* Product cards share text baselines within each row, without truncating model names. */
@media (min-width: 601px) {
  .product-body .product-category { min-height: 3em; }
  .product-body h3 { min-height: 2.9em; }
  .product-body .product-summary { min-height: 4.95em; }
  @supports (grid-template-rows: subgrid) {
    .product-card {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 5;
      row-gap: 0;
    }
    .product-body {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 4;
      row-gap: 0;
      align-items: start;
    }
    .product-body .product-category,
    .product-body h3,
    .product-body .product-summary { min-height: 0; }
    .product-body > .text-link { align-self: end; justify-self: start; margin-top: 0; }
  }
}

/* The source order is heading, photograph, details on every screen. */
.product-overview {
  grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr);
  row-gap: 0;
}
.product-heading { grid-column: 2; grid-row: 2; }
.product-heading .eyebrow { text-transform: none; letter-spacing: 0; font-weight: 500; }
.product-heading h1 {
  margin-bottom: 22px;
  font-size: clamp(1.875rem, 3.3vw, 2.75rem);
  letter-spacing: -.025em;
  line-height: 1.3;
}
.product-photo { grid-column: 1; grid-row: 1 / -1; align-self: center; }
.product-intro { grid-column: 2; grid-row: 3; }
.product-photo > a { display: block; width: 100%; }

/* Reading measure applies to prose, leaving tables and media at their full width. */
.rich-text { line-height: 1.8; }
.rich-text p, .rich-text > ul, .rich-text > ol, .rich-text > blockquote { max-width: 72ch; }
.rich-text p { margin-bottom: 1.35em; }
.rich-text p:has(img, iframe, video),
.rich-text table p, .rich-text table ul, .rich-text table ol { max-width: none; }
.rich-text :is(h2, h3, h4, h5, h6) { max-width: 34em; margin-bottom: .7em; }
.rich-text h2 { margin-top: 2em; }
.rich-text h3 { margin-top: 1.8em; }
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }

@media (max-width: 920px) {
  .product-heading h1 { font-size: 1.875rem; }
}
@media (max-width: 700px) {
  .product-overview { display: flex; flex-direction: column; align-items: stretch; gap: 24px; }
  .product-photo { width: 100%; align-self: center; }
  .product-heading h1 { margin-bottom: 0; font-size: 2rem; }
  .product-heading .eyebrow { margin-bottom: 12px; }
  .product-intro { display: flex; flex-direction: column; align-items: stretch; }
  .product-intro .actions { order: -1; margin: 0 0 22px; }
  .product-intro .actions .button { width: 100%; }
  .product-intro > .text-link { margin-top: 0; }
}
@media (max-width: 480px) {
  .product-heading h1 { font-size: 1.75rem; }
  .product-overview { gap: 20px; }
}


/* Company documents and a shared image viewer. Original media stays untouched. */
.company-materials { scroll-margin-top: 28px; }
.company-materials .section-heading p { max-width: 65ch; }
.company-materials .document-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.company-materials .document-card { width: 100%; padding: 14px; border-radius: 18px; border-color: #dbe4ec; box-shadow: 0 5px 18px -12px rgba(23,50,79,.16); }
.company-materials .document-card .document-preview { display: flex; align-items: center; justify-content: center; padding: 12px; height: 280px; border-radius: 10px; background: #f1f4f7; }
.company-materials .document-preview img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; background: transparent; }
.company-materials .document-card .document-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 4px 5px; font-size: .875rem; font-weight: 500; }
.company-materials .document-action > span { padding: 0; color: #536d87; font-size: 1.15rem; }
.company-materials .client-grid { gap: 20px; }
.company-materials .client-mark { min-height: 130px; padding: 24px; border-color: #e0e7ee; border-radius: 16px; }
.company-materials .client-mark img { max-height: 76px; }
body.media-viewer-open { overflow: hidden; }
.media-viewer { width: min(1100px, calc(100% - 48px)); height: min(88vh, 920px); height: min(88dvh, 920px); max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden; border: 1px solid #d7e2ed; border-radius: 20px; background: #f2f5f8; color: var(--text); box-shadow: 0 28px 90px rgba(0,10,24,.3); }
.media-viewer[open] { display: flex; flex-direction: column; }
.media-viewer::backdrop { background: rgba(7,22,37,.78); }
.media-viewer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex: 0 0 auto; padding: 18px 22px 12px; background: #fff; }
.media-viewer-caption { margin: 9px 0 0; color: var(--navy); font-size: 1rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.media-viewer-close, .media-viewer-control { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 15px; border: 1px solid #b8c9d9; border-radius: 10px; background: #fff; color: var(--navy); font: inherit; font-size: .875rem; font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none; }
.media-viewer-close { flex-shrink: 0; }
.media-viewer-close:hover, .media-viewer-control:hover { background: #eaf0f6; color: var(--navy); border-color: #8ba5bd; }
.media-viewer-controls { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; padding: 0 22px 16px; background: #fff; border-bottom: 1px solid #dce5ee; }
.media-viewer-stage { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px; }
.media-viewer-stage:focus-visible { outline-offset: -4px; }
.media-viewer-canvas { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-width: 100%; min-height: 100%; }
.media-viewer-image { flex: 0 0 auto; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 5px 22px rgba(23,50,79,.1); }
.media-viewer.is-zoomed .media-viewer-canvas { width: max-content; height: max-content; }
.media-viewer.is-zoomed .media-viewer-image { max-width: none; max-height: none; }
.media-viewer-status { margin: 0; padding: 14px 22px 0; font-size: .875rem; color: var(--muted); }
@media (max-width: 920px) {
  .company-materials .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .company-materials .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .company-materials .document-card { padding: 9px; border-radius: 14px; }
  .company-materials .document-card .document-preview { height: auto; aspect-ratio: 3 / 4; padding: 7px; border-radius: 7px; }
  .company-materials .document-card .document-action { gap: 6px; padding: 12px 2px 3px; font-size: .8125rem; }
  .company-materials .client-grid { gap: 12px; }
  .company-materials .client-mark { min-height: 110px; padding: 20px; }
  .media-viewer { width: calc(100% - 20px); height: calc(100vh - 24px); height: calc(100dvh - 24px); border-radius: 14px; }
  .media-viewer-header { gap: 12px; padding: 12px 13px; }
  .media-viewer-caption { margin-top: 10px; font-size: .875rem; }
  .media-viewer-controls { gap: 8px; padding: 0 13px 12px; }
  .media-viewer-close, .media-viewer-control { padding-inline: 11px; font-size: .8125rem; }
  .media-viewer-stage { padding: 10px; }
  .media-viewer-status { padding: 12px 13px 0; }
}
@media (max-width: 360px) {
  .company-materials .document-grid { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .media-viewer { display: none !important; }
  .company-materials .document-card { break-inside: avoid; box-shadow: none; }
}


/* Map refinement: preserve the existing pin dimensions and geographic coordinates. */
body .nst-geography .nst-geo-map .nst-geo-marker::before {
  content: "";
  position: absolute;
  left: var(--geo-hit-left, 0px);
  right: var(--geo-hit-right, 0px);
  top: var(--geo-hit-top, 0px);
  bottom: var(--geo-hit-bottom, 0px);
  border-radius: 8px;
}
body .nst-geography .nst-geo-map .nst-geo-marker:focus-visible {
  z-index: 4;
}
body .nst-geography .nst-geo-map .nst-geo-label {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 10px;
  color: #17324f;
  background: #f7fbff;
  box-shadow: 0 4px 14px rgba(9,26,43,.18);
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  pointer-events: none;
}
body .nst-geography .nst-geo-map .nst-geo-label::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d92c27;
}
@media print {
  body .nst-geography .nst-geo-map .nst-geo-label { display: none; }
}
