/**
 * MegaGen 2.0 — base resets (not overwritten by mockup sync).
 */

:root {
  --hero-sticky-top: 14px;
}

/* Legacy style.css scrolls body; v2 uses document (html) as scroll root */
html {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

body.megagen-v2 {
  --shell-width: 1440px;
  --shell-gutter: 18px;
  /* style.css sets body { display:flex; overflow:auto } — use document scroll instead */
  display: block;
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 100%;
}

/* Inner pages (catalog, product, article): topbar row at shell width */
body.megagen-v2 .topbar--full {
  display: block;
  width: 100%;
  padding: 6px 0 10px;
  background: transparent;
}

body.megagen-v2 .topbar--full.topbar {
  display: block;
  padding: 6px 0 10px;
}

body.megagen-v2 .topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: var(--shell-width, 1440px);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

body.megagen-v2 .topbar--full .topbar-group {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

body.megagen-v2 .topbar-social {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.megagen-v2 .topbar-social .footer-social-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

/* style.css sets all headers position:fixed — v2 chrome uses sticky/fixed via JS */
body.megagen-v2:is(.category, .v2-chrome-light, .megagen-v2-home, .v2-patients-page) #heroHeader.header--hero:not(.is-sticky) {
  position: sticky;
  top: var(--hero-sticky-top);
  width: 100%;
  max-width: 100%;
  z-index: 720;
}

body.megagen-v2.v2-chrome-dark #heroHeader.header--hero:not(.is-sticky) {
  position: sticky;
  top: var(--hero-sticky-top);
  width: 100%;
  max-width: 100%;
  z-index: 720;
}

body.megagen-theme a,
body.megagen-theme a:visited {
  text-decoration: none;
}

body.megagen-theme a:hover,
body.megagen-theme a:focus,
body.megagen-theme a:active {
  text-decoration: none;
}

/* WordPress content blocks inside v2 shell */
body.megagen-theme div.page a:where(:not([class])) {
  color: var(--brand, #1656e0);
}

body.megagen-theme div.page a:where(:not([class])):hover {
  color: var(--brand-deep, #0a3dae);
}

/* Footer sits flush with viewport bottom — full shell width like homepage */
body.megagen-v2 div.page {
  width: 100%;
  max-width: var(--shell-width, 1440px);
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 0;
  box-sizing: border-box;
}

body.megagen-v2-home div.page {
  padding-top: 0;
}

/* WP adds class "page" to body on Page templates — never treat body as layout shell */
body.megagen-v2.page {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Catalog / inner pages: dark logo wordmark on light header */
body.megagen-v2.v2-chrome-light .header .logo-tag {
  color: var(--ink-2, #2c313d);
}

/* Legacy inner pages — same shell width as homepage/catalog */
body.megagen-v2:not(.megagen-v2-home) .v2-inner-page {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.megagen-v2:not(.megagen-v2-home) main.main_new .container,
body.megagen-v2:not(.megagen-v2-home) main.main_new2 .container,
body.megagen-v2:not(.megagen-v2-home) .v2-inner-page .container {
  max-width: var(--shell-width, 1440px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--shell-gutter, 18px);
  padding-right: var(--shell-gutter, 18px);
  box-sizing: border-box;
}

body.megagen-v2:not(.megagen-v2-home) .v2-inner-page > .breadcrumbs,
body.megagen-v2:not(.megagen-v2-home) .v2-inner-page > nav.breadcrumbs {
  margin: 12px 0 16px;
  padding-left: var(--shell-gutter, 18px);
  padding-right: var(--shell-gutter, 18px);
  box-sizing: border-box;
}

body.megagen-v2 main.main_below::before,
body.megagen-v2 main.main_below::after {
  display: none;
}

/* Generic v2 inner pages (page.php) — white content card on dark chrome */
body.v2-chrome-dark .v2-inner-page .section_articl_1 {
  padding: 0 var(--shell-gutter, 18px) 48px;
  max-width: var(--shell-width, 1440px);
  margin: 0 auto;
  box-sizing: border-box;
}

body.v2-chrome-dark .v2-inner-page .section_articl_1 .container {
  background: transparent;
  border-radius: 0;
  padding: 8px 6px 48px;
  color: #fff;
  box-sizing: border-box;
}

body.v2-chrome-dark .v2-inner-page .section_articl_1 .catalog-title,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content p,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content li,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content h1,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content h2,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content h3,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content h4,
body.v2-chrome-dark .v2-inner-page .section_articl_1 .content strong {
  color: rgba(255, 255, 255, 0.88);
}

body.v2-chrome-dark .v2-inner-page .section_articl_1 .catalog-title {
  color: #fff;
}

body.v2-chrome-dark .v2-inner-page .section_articl_1 .content a {
  color: var(--brand, #1656e0);
}

body.v2-chrome-dark .v2-inner-page .section_articl_1 .content a:hover {
  color: #8fb4ff;
}

body.v2-chrome-dark .v2-inner-page .section_articl_1 .content .v2-inner-page-placeholder {
  color: rgba(255, 255, 255, 0.62);
  font-size: 18px;
  line-height: 1.5;
  margin: 8px 0 0;
}

body.v2-chrome-dark .v2-contacts-page .button_cont {
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Legacy dark hero blocks (акции, стоматологам, FAQ и др.) — подзаголовок на тёмном фоне */
body.megagen-v2 .screen_commoner_1 .screen_common_ferst_desc,
body.megagen-v2 .screen_commoner_1 .screen_common_ferst_desc_sale {
  color: #fff;
}

/* Акции (category-3) — крошки на светлом фоне: «Главная» и разделитель чёрные */
body.megagen-v2.category-3 .breadcrumber .breadcrumbs a,
body.megagen-v2.category-3 .breadcrumber .breadcrumbs a span,
body.megagen-v2.category-3 .breadcrumber .breadcrumbs .breadcrumbs__link,
body.megagen-v2.category-3 .breadcrumber .breadcrumbs .breadcrumbs__link span,
body.megagen-v2.category-3 .breadcrumber .breadcrumbs .kb_sep {
  color: var(--ink, #0a0e1a) !important;
}

body.megagen-v2.category-3 .breadcrumber .breadcrumbs a:hover,
body.megagen-v2.category-3 .breadcrumber .breadcrumbs a:hover span {
  color: var(--brand, #1656e0) !important;
}

/* Legacy breadcrumber on light v2 pages (events, materials, etc.) */
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs a,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs a span,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs .breadcrumbs__link,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs .breadcrumbs__link span,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs .kb_sep {
  color: var(--ink, #0a0e1a) !important;
}

body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs .curst,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs span .curst,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs .current {
  color: var(--brand, #1656e0) !important;
}

body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs a:hover,
body.megagen-v2.v2-chrome-light .breadcrumber .breadcrumbs a:hover span {
  color: var(--brand, #1656e0) !important;
}

/* Акции — сетка promo-card как на главной (без слайдера) */
body.megagen-v2.category-3 .v2-promo-archive {
  position: relative;
  width: 100%;
  max-width: 100%;
  left: auto;
  right: auto;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 48px;
  padding: 0 !important;
  background: transparent;
  overflow: visible;
  color: var(--ink, #0a0e1a);
}

body.megagen-v2.category-3 .v2-promo-archive .promo-slider-bg {
  display: none;
}

body.megagen-v2.category-3 .v2-promo-archive-page .screen_commoner_1 {
  display: none;
}

body.megagen-v2.category-3 .v2-promo-archive .promo-slider-inner {
  width: 100%;
  max-width: var(--shell-width, 1440px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

body.megagen-v2.category-3 .v2-promo-archive .promo-slider-viewport {
  overflow: visible;
  margin: 0;
  padding: 0;
}

body.megagen-v2.category-3 .v2-promo-archive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

body.megagen-v2.category-3 .v2-promo-archive .blog-pagination {
  margin-top: 40px;
}

body.megagen-v2.category-3 .v2-promo-archive .blog-pagination .page-numbers:not(.prev):not(.next) {
  background: var(--line, #e5e7eb);
  color: var(--ink, #0a0e1a);
}

body.megagen-v2.category-3 .v2-promo-archive .blog-pagination .page-numbers.current:not(.prev):not(.next) {
  background: var(--brand, #1656e0);
  color: #fff;
}

body.megagen-v2.category-3 .v2-promo-archive-empty {
  color: var(--muted, #6b7280);
  text-align: center;
  padding: 24px 0 8px;
}

body.megagen-v2.category-3 .screen_commoner_ferst_left .button.js-v2-contact-open {
  border: none;
  cursor: pointer;
  font: inherit;
}

@media (max-width: 1100px) {
  body.megagen-v2.category-3 .v2-promo-archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  body.megagen-v2.category-3 .v2-promo-archive-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body.v2-chrome-dark .v2-inner-page .section_articl_1 .container {
    padding: 4px 0 36px;
  }
}

/* Dark-surface inner pages — breadcrumbs on #2A2D30 background */
body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs a,
body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs a span,
body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs .kb_sep {
  color: rgba(255, 255, 255, 0.85);
}

body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs a:hover,
body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs a:hover span {
  color: #fff;
}

body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs .curst,
body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs span .curst,
body.v2-chrome-dark .v2-inner-page .v2-breadcrumbs .current {
  color: #80c2ff;
}

/* Dark chrome inner pages — page h1 (contacts, legacy templates) */
body.v2-chrome-dark .catalog-title,
body.megagen-v2 .page--product-dark .catalog-title {
  color: #fff;
}

/* 3D FlipBook on event/article pages — avoid zero-height embed */
body.megagen-v2 .content ._3d-flip-book,
body.megagen-v2 .section_articl_1 .content ._3d-flip-book {
  min-height: 420px;
  height: min(80vh, 720px);
  width: 100%;
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: block;
}

body.megagen-v2 .content ._3d-flip-book > *,
body.megagen-v2 .section_articl_1 .content ._3d-flip-book > * {
  min-height: inherit;
  height: 100%;
}

/* Legacy style.css: main { padding-top: 150px } — v2 uses sticky header, no offset */
body.megagen-v2 main.main_new,
body.megagen-v2 main.main_new2,
body.megagen-v2 main.main_below {
  padding-top: 0;
  overflow: visible;
}

/* v2 footer on legacy templates — override style.css footer {} */
body.megagen-theme footer.footer {
  margin-top: 48px;
  padding: 64px 0 0;
  background: var(--ink, #0a0e1a);
  color: #fff;
}

/* Top breathing room is on footer; CTA sits below the dark band */
body.megagen-v2 footer.footer .footer-cta {
  margin-top: 0;
}

/* Footer link colors — must beat div.page bare-link brand color */
body.megagen-v2 footer.footer .footer-col li a,
body.megagen-v2 footer.footer .footer-col li a:visited,
body.megagen-v2 div.page footer.footer .footer-col li a,
body.megagen-v2 div.page footer.footer .footer-col li a:visited {
  color: rgba(255, 255, 255, 0.8) !important;
}

body.megagen-v2 footer.footer .footer-col li a:hover,
body.megagen-v2 div.page footer.footer .footer-col li a:hover {
  color: #5b8def !important;
}

body.megagen-v2 footer.footer .footer-legal a,
body.megagen-v2 footer.footer .footer-legal a:visited,
body.megagen-v2 div.page footer.footer .footer-legal a,
body.megagen-v2 div.page footer.footer .footer-legal a:visited {
  color: rgba(255, 255, 255, 0.6) !important;
}

body.megagen-v2 footer.footer .footer-legal a:hover,
body.megagen-v2 div.page footer.footer .footer-legal a:hover {
  color: #5b8def !important;
}

body.megagen-v2 footer.footer .footer-cta-phone,
body.megagen-v2 footer.footer .footer-cta-phone:visited {
  color: #fff;
}

body.megagen-v2 footer.footer .footer-cta-btn {
  color: var(--brand-deep, #0a3dae);
}

body.megagen-v2 footer.footer a.footer-contact-item .fc-value {
  color: #fff;
}

body.megagen-v2 footer.footer a.footer-contact-item:hover .fc-value {
  color: #5b8def;
}

body.megagen-v2 footer.footer .footer-social-icon,
body.megagen-v2 footer.footer .footer-social-icon:visited {
  color: rgba(255, 255, 255, 0.85);
}

body.megagen-v2 footer.footer .footer-social-icon:hover {
  color: #fff;
}

/* Footer outside .page — true full viewport width (no 100vw breakout hack) */
body.megagen-theme > footer.footer {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  left: auto;
  right: auto;
  position: relative;
}

/* Product card arrows — not overwritten by mockup sync */
body.megagen-v2 .arrow-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  line-height: 0;
  font-size: 0;
  color: inherit;
  background: transparent;
  vertical-align: middle;
}

body.megagen-v2 .arrow-mini svg {
  display: block;
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
}

body.megagen-v2 .arrow-mini img.emoji {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.megagen-v2 .phero-blue .arrow-mini {
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  color: #fff;
}

body.megagen-v2 .phero-blue .arrow-mini svg {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .phero-blue .arrow-mini:not(:has(svg))::after,
body.megagen-v2 .phero-blue .arrow-mini:has(img.emoji)::after {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .phero-light .arrow-mini {
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--ink, #0a0e1a);
}

body.megagen-v2 .phero-light .arrow-mini svg {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .phero-light .arrow-mini:not(:has(svg))::after,
body.megagen-v2 .phero-light .arrow-mini:has(img.emoji)::after {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .product-card.light .arrow-mini {
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--ink, #0a0e1a);
}

body.megagen-v2 .product-card.light .arrow-mini svg {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .product-card.light .arrow-mini:not(:has(svg))::after,
body.megagen-v2 .product-card.light .arrow-mini:has(img.emoji)::after {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .arrow-mini--brand {
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--brand, #1656e0);
}

body.megagen-v2 .product-card.light:not(.cta-tile) .arrow-mini--brand {
  color: var(--ink, #0a0e1a);
}

body.megagen-v2 .product-card.cta-tile .arrow-mini--brand {
  color: var(--brand, #1656e0);
}

body.megagen-v2 .product-card.cta-tile .arrow-mini--brand svg,
body.megagen-v2 .product-card.cta-tile .arrow-mini--brand path {
  stroke: var(--brand, #1656e0);
}

body.megagen-v2 .arrow-mini--brand svg {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .arrow-mini--brand:not(:has(svg))::after,
body.megagen-v2 .arrow-mini--brand:has(img.emoji)::after {
  width: 20px;
  height: 20px;
}

body.megagen-v2 .arrow-mini:not(:has(svg))::after,
body.megagen-v2 .arrow-mini:has(img.emoji)::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

body.megagen-v2 .arrow-mini--brand:not(:has(svg))::after,
body.megagen-v2 .arrow-mini--brand:has(img.emoji)::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M5 12h14m-7-7 7 7-7 7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M5 12h14m-7-7 7 7-7 7'/%3E%3C/svg%3E");
}

body.megagen-v2 .arrow-mini:has(svg):not(:has(img.emoji))::after {
  content: none;
  display: none;
}

body.megagen-v2 .why-card .why-arrow {
  width: 36px !important;
  height: 36px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border-radius: 50% !important;
  color: var(--ink, #0a0e1a) !important;
}

body.megagen-v2 .why-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: none;
  color: var(--ink, #0a0e1a);
  font-size: 0;
  line-height: 0;
}

body.megagen-v2 .why-arrow svg {
  display: block;
  width: 16px;
  height: 16px;
}

body.megagen-v2 .why-card .why-arrow svg,
body.megagen-v2 .why-card .why-arrow path {
  stroke: var(--ink, #0a0e1a) !important;
}

body.megagen-v2 .why-arrow img.emoji {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.megagen-v2 .why-arrow:not(:has(svg))::after,
body.megagen-v2 .why-arrow:has(img.emoji)::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

body.megagen-v2 .why-arrow:has(svg):not(:has(img.emoji))::after {
  content: none;
  display: none;
}

body.megagen-v2 .event-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  flex-shrink: 0;
  line-height: 0;
  font-size: 0;
  color: var(--brand, #1656e0);
}

body.megagen-v2 .event-arrow svg {
  display: block;
  width: 20px;
  height: 20px;
}

body.megagen-v2 .event-arrow svg,
body.megagen-v2 .event-arrow path {
  stroke: var(--brand, #1656e0) !important;
}

body.megagen-v2 .event-arrow img.emoji {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.megagen-v2 .event-foot > span:not(.event-date) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  border-radius: 0 !important;
  flex-shrink: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  color: var(--brand, #1656e0) !important;
}

body.megagen-v2 .event-foot > span:not(.event-date) img.emoji {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.megagen-v2 .event-foot > span:not(.event-date):has(img.emoji)::after,
body.megagen-v2 .event-foot > span:not(.event-date):not(:has(svg))::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-color: var(--brand, #1656e0);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

body.megagen-v2 .event-foot > span:not(.event-date):has(svg):not(:has(img.emoji))::after {
  content: none;
  display: none;
}

/* ===== Mobile header + drawer (all v2 pages) ===== */
@media (max-width: 1100px) {
  body.megagen-v2 .header--light:not(.header--hero) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "logo actions burger";
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
  }

  body.megagen-v2 .header--light:not(.header--hero) .logo {
    grid-area: logo;
    min-width: 0;
  }

  body.megagen-v2 .header--light:not(.header--hero) .main-nav {
    display: none !important;
  }

  body.megagen-v2 .header--light:not(.header--hero) .header-right {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
  }

  body.megagen-v2 .header--light:not(.header--hero) .patient-nav-item,
  body.megagen-v2 .header--light:not(.header--hero) .dentist-nav-item {
    display: none !important;
  }

  body.megagen-v2 .header--light:not(.header--hero) .burger-btn {
    grid-area: burger;
    display: flex !important;
    flex-shrink: 0;
  }
}

/* Mobile: hide page topbar — contacts live in the drawer */
@media (max-width: 1100px) {
  body.megagen-v2 .topbar--desktop {
    display: none !important;
  }
}

/* ===== Mobile drawer — unified spacing (all v2 pages) ===== */
.mobile-drawer {
  --drawer-pad-x: 20px;
  --drawer-pad-y: 18px;
}

.mobile-drawer-head,
.mobile-drawer-foot {
  flex-shrink: 0;
}

.mobile-drawer-topbar {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin: 16px calc(-1 * var(--drawer-pad-x)) 0;
  padding: 16px var(--drawer-pad-x) 24px;
  border-top: 1px solid var(--line, #e5e7eb);
  background: var(--bg, #f4f5f7);
}

/* Contacts block follows nav links inside scroll area */
.mobile-nav > .m-link:has(+ .mobile-drawer-topbar) {
  border-bottom: none;
  padding-bottom: 12px;
}

.mobile-drawer-topbar__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer-topbar__group:last-child {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-drawer-topbar__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2, #2c313d);
}

.mobile-drawer-topbar__ic {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--muted, #6b7280);
}

.mobile-drawer-topbar__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand, #1656e0);
  text-decoration: none;
  white-space: nowrap;
}

.mobile-drawer-topbar__phone:hover {
  color: var(--brand-deep, #0a3dae);
}

.mobile-drawer-topbar__social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-drawer-topbar__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  color: var(--ink-2, #2c313d);
}

.mobile-drawer-topbar__social-link:hover {
  color: var(--brand, #1656e0);
  border-color: rgba(22, 86, 224, 0.35);
}

@media (max-width: 1100px) {
  .mobile-drawer-head {
    padding: var(--drawer-pad-y) var(--drawer-pad-x);
  }

  .mobile-nav {
    padding: 12px var(--drawer-pad-x) 4px;
  }

  .mobile-drawer-foot {
    padding: 16px var(--drawer-pad-x) calc(16px + env(safe-area-inset-bottom, 0));
  }

  .mobile-drawer-topbar {
    display: flex;
  }
}

.mobile-nav {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Mobile page shell — match homepage hero gutters (14px) */
@media (max-width: 768px) {
  body.megagen-v2 div.page:not(.page--product-dark) {
    padding-top: 14px;
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 0;
    overflow-x: hidden;
  }

  body.megagen-v2 .breadcrumbs {
    margin: 12px 0;
  }

  body.megagen-v2 .catalog-title {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .mobile-drawer {
    --drawer-pad-x: 16px;
  }

  .mobile-drawer-topbar__group:last-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* === Task bundle overrides (survive mockup sync) === */

/* 1 — hover «Пациентам» как у «Стоматологам» */
body.v2-chrome-dark .patient-nav-item:not(.active) .audience-pill:hover,
body.v2-chrome-dark .patient-nav-item:not(.active) a.audience-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
}

body.v2-chrome-light .patient-nav-item:not(.active) .audience-pill:hover,
body.v2-chrome-light .patient-nav-item:not(.active) a.audience-pill:hover,
body.v2-patients-page .dentist-nav-item .audience-pill:hover {
  background: #f5f7fb;
  border-color: #c5cedd;
  color: var(--ink, #0a0e1a);
}

/* 4 — promo block padding on .promo-slider (inside dark box) */
body.megagen-v2-home .promo-slider,
body.megagen-v2 .promo-slider:not(.v2-promo-archive) {
  padding: 128px 64px 136px !important;
}

body.megagen-v2-home .promo-slider-inner,
body.megagen-v2 .promo-slider:not(.v2-promo-archive) .promo-slider-inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.megagen-v2-home .promo-slider .promo-slider-head,
body.megagen-v2 .promo-slider:not(.v2-promo-archive) .promo-slider-head {
  margin-bottom: 48px !important;
}

body.megagen-v2-home .promo-slider .promo-slider-dots,
body.megagen-v2 .promo-slider:not(.v2-promo-archive) .promo-slider-dots {
  margin-top: 48px !important;
}

@media (max-width: 1100px) {
  body.megagen-v2-home .promo-slider,
  body.megagen-v2 .promo-slider:not(.v2-promo-archive) {
    padding: 72px 32px 80px !important;
  }

  body.megagen-v2-home .promo-slider .promo-slider-head,
  body.megagen-v2 .promo-slider:not(.v2-promo-archive) .promo-slider-head {
    margin-bottom: 32px !important;
  }

  body.megagen-v2-home .promo-slider .promo-slider-dots,
  body.megagen-v2 .promo-slider:not(.v2-promo-archive) .promo-slider-dots {
    margin-top: 36px !important;
  }
}

@media (max-width: 768px) {
  body.megagen-v2-home .promo-slider,
  body.megagen-v2 .promo-slider:not(.v2-promo-archive) {
    padding: 56px 24px 64px !important;
  }
}

/* 6 — light gray background under all promo card images (incl. first/dark card) */
body.megagen-v2 .promo-card-img,
body.megagen-v2 .promo-card-dark .promo-card-img {
  background-color: #E9EEF6 !important;
}

body.megagen-v2 a.promo-card-cta {
  text-decoration: none;
  color: #fff;
}

body.megagen-v2 a.promo-card-cta:hover,
body.megagen-v2 a.promo-card-cta:focus,
body.megagen-v2 a.promo-card-cta:active {
  color: #fff;
}

body.megagen-v2 .promo-card-cta {
  flex-shrink: 0;
}

body.megagen-v2 .promo-card-cta svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 16 — hide CTA form */
body.megagen-v2 .cta-form {
  display: none !important;
}

/* 5 — BYN sign (CSS mask from sign-byn.svg, solid fill, inherits price color) */
body.megagen-v2 .byn {
  display: inline-block;
  width: 0.72em;
  height: 0.86em;
  margin-left: 0.1em;
  vertical-align: -0.1em;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
  border: none;
  background-color: currentColor;
  -webkit-mask-image: url('../img/icon/sign-byn-mask.png');
  mask-image: url('../img/icon/sign-byn-mask.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

body.megagen-v2 .promo-price-now,
body.megagen-v2 .promo-price-strike {
  flex-shrink: 0;
  white-space: nowrap;
}

body.megagen-v2 .promo-price-now .byn,
body.megagen-v2 .promo-price-strike .byn,
body.megagen-v2 .mega-promo-kit .byn,
body.megagen-v2 .home-hero-promo__price .byn {
  color: inherit;
}

body.megagen-v2 .promo-price-strike .byn {
  text-decoration: none;
}

body.megagen-v2 .promo-price-strike {
  text-decoration: none;
}

body.megagen-v2 .promo-price-strike .promo-price-amount {
  text-decoration: line-through;
  text-decoration-color: #D32F2F;
  text-decoration-thickness: 1.5px;
}

/* Mega menu — surgical kit promo tile */
body.megagen-v2 a.mega-promo-kit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  height: auto;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: #fff;
}

body.megagen-v2 .mega-panel .mega-grid > a.mega-promo-kit {
  align-self: stretch;
  height: 100%;
}

body.megagen-v2 .mega-promo-kit .promo-badge {
  align-self: flex-start;
  margin-bottom: 12px;
}

body.megagen-v2 .mega-promo-kit .promo-kit-img {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 118px;
  margin: 0 0 14px;
  background-position: center center;
  background-size: contain;
  opacity: 1;
  flex-shrink: 0;
}

body.megagen-v2 .mega-promo-kit .promo-h {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.35px;
  margin: 0 0 8px;
}

body.megagen-v2 .mega-promo-kit .promo-p {
  max-width: none;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.9;
}

body.megagen-v2 .mega-promo-kit .promo-kit-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

body.megagen-v2 .mega-panel .mega-grid > a.mega-promo-kit .promo-kit-foot {
  margin-top: auto;
  padding-top: 16px;
}

body.megagen-v2 .mega-promo-kit .promo-price {
  margin: 0;
  gap: 0;
}

body.megagen-v2 .mega-promo-kit .price-now {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

body.megagen-v2 .mega-promo-kit .promo-arrow {
  position: static;
  top: auto;
  right: auto;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

body.megagen-v2 .mega-promo-kit .promo-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
}

body.megagen-v2 .mega-promo-kit .promo-arrow path {
  stroke: currentColor;
}


/* Mega menu — full-viewport dim + blur (reference: megagen-homepage.html) */
body.megagen-v2 .mega-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  background: rgba(10, 14, 26, 0.44);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 650;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

body.megagen-v2 .mega-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Keep header/chrome above dim overlay — only chrome layer, not the full hero slider */
body.megagen-v2.mega-menu-open .v2-chrome-zone,
body.megagen-v2.mega-menu-open .home-hero-zone__chrome {
  z-index: 730;
}

body.megagen-v2.mega-menu-open #heroHeader.header--hero {
  z-index: 740;
  pointer-events: auto;
}

body.megagen-v2.mega-menu-open .topbar--full.topbar--desktop {
  position: relative;
  z-index: 741;
  pointer-events: auto;
}

body.megagen-v2.mega-menu-open .mega-panel,
body.megagen-v2.mega-menu-open .mega-panel.active {
  z-index: 735;
}

body.megagen-v2 .mega-panel {
  z-index: 710;
  transform: translateY(-8px);
  transform-origin: top center;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

body.megagen-v2 .mega-panel.active {
  transform: translateY(0);
}

body.megagen-v2 #heroHeader.header--hero,
body.megagen-v2 #heroHeader.header--hero.is-sticky {
  z-index: 720;
}

/* 13 — sticky header above page sections (no isolation trap on hero zone) */
body.megagen-v2 #heroHeader.header--hero.is-sticky {
  -webkit-transform: translateX(-50%) translateZ(0);
  transform: translateX(-50%) translateZ(0);
}

/* 20 — promo slider arrows on mobile */
@media (max-width: 768px) {
  body.megagen-v2 .promo-slider-nav {
    display: flex !important;
  }
}

/* 24 — topbar phone block (7545 / A1) site-wide */
body.megagen-v2 .topbar-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

body.megagen-v2 .topbar-phone .tb-phone-num {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.1;
}

body.megagen-v2 .topbar-phone .tb-phone-note {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.72;
}

body.v2-chrome-light .topbar--light .topbar-phone .tb-phone-note,
body.megagen-v2-home .topbar--dark .topbar-phone .tb-phone-note,
body.v2-hero-chrome-page .topbar--dark .topbar-phone .tb-phone-note,
body.v2-chrome-dark .topbar--dark .topbar-phone .tb-phone-note {
  opacity: 0.72;
}

/* Shell side gutters when viewport is at or below --shell-width (1440px) */
@media (min-width: 769px) and (max-width: 1440px) {
  body.megagen-v2 div.page:not(.page--product-dark) {
    padding-left: var(--shell-gutter, 18px);
    padding-right: var(--shell-gutter, 18px);
  }

  body.v2-chrome-dark .v2-chrome-zone .topbar__inner,
  body.v2-chrome-dark .v2-chrome-zone__inner {
    padding-left: var(--shell-gutter, 18px);
    padding-right: var(--shell-gutter, 18px);
  }

  /* Full-bleed homepage sections escape div.page — pad inner shell columns */
  body.megagen-v2-home .catalog-frame > .catalog-head,
  body.megagen-v2-home .catalog-frame > .products-hero,
  body.megagen-v2-home .catalog-frame > .products,
  body.megagen-v2-home .events-frame > *,
  body.megagen-v2-home .footer-main,
  body.megagen-v2-home .footer-badges,
  body.megagen-v2-home .footer-bottom,
  body.megagen-v2-home .footer-cta {
    padding-left: var(--shell-gutter, 18px);
    padding-right: var(--shell-gutter, 18px);
    box-sizing: border-box;
  }
}

/* reCAPTCHA v3 badge — hidden (required attribution is in privacy policy) */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
