/* DS.Med — responsive overrides for phones & tablets.
   NOTE: the runtime renders inline styles as "prop: value" (space after colon,
   value verbatim). Every attribute selector below therefore appears in BOTH
   forms: authored (no space) and rendered (space after colon). */
.ds-burger{display:none}

@media (max-width: 960px){
  div[style*="min-width:1080px"],
  div[style*="min-width: 1080px"]{min-width:0 !important}
  div[style*="max-width:1200px"],
  div[style*="max-width: 1200px"]{padding-left:20px !important;padding-right:20px !important}
  /* header: hide desktop nav, show burger */
  header nav{display:none !important}
  .ds-burger{display:inline-flex !important;align-items:center;justify-content:center;width:42px;height:42px;border:1px solid #d7e1ec;border-radius:9px;background:#fff;cursor:pointer;margin-left:auto;flex:none}
  header a[href*="#quote"]{margin-left:0 !important}
  header > div{gap:14px !important}
  /* top contact bar: hide tagline */
  span[style*="letter-spacing:0.04em"],
  span[style*="letter-spacing: 0.04em"]{display:none}
  /* multi-column grids → 2 cols */
  div[style*="grid-template-columns:repeat(5,1fr)"],
  div[style*="grid-template-columns: repeat(5,1fr)"],
  div[style*="grid-template-columns: repeat(5, 1fr)"]{grid-template-columns:repeat(3,1fr) !important}
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns: repeat(4,1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"]{grid-template-columns:repeat(2,1fr) !important}
  /* two-column hero/content grids → single column */
  div[style*="grid-template-columns:1.2fr 1fr"],
  div[style*="grid-template-columns: 1.2fr 1fr"],
  div[style*="grid-template-columns:1.05fr 0.95fr"],
  div[style*="grid-template-columns: 1.05fr 0.95fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1.1fr 0.9fr"],
  div[style*="grid-template-columns: 1.1fr 0.9fr"],
  div[style*="grid-template-columns:0.9fr 1.1fr"],
  div[style*="grid-template-columns: 0.9fr 1.1fr"],
  div[style*="grid-template-columns:300px 1fr"],
  div[style*="grid-template-columns: 300px 1fr"]{grid-template-columns:1fr !important}
  /* hero photo panels shrink */
  div[style*="height:380px"],
  div[style*="height: 380px"]{height:300px !important}
  div[style*="height:420px"],
  div[style*="height: 420px"]{height:320px !important}
  /* CTA / footer rows wrap */
  div[style*="justify-content:space-between"],
  div[style*="justify-content: space-between"]{flex-wrap:wrap}
  footer div[style*="display:flex"],
  footer div[style*="display: flex"]{flex-wrap:wrap}
  /* spec-table cards scroll */
  div[style*="padding:12px 40px"],
  div[style*="padding: 12px 40px"]{padding:12px 16px !important;overflow-x:auto}
}

@media (max-width: 640px){
  h1{font-size:28px !important}
  h2{font-size:22px !important}
  div[style*="max-width:1200px"],
  div[style*="max-width: 1200px"]{padding-left:16px !important;padding-right:16px !important}
  section > div{padding-top:36px !important;padding-bottom:36px !important}
  header > div{height:60px !important}
  header img[alt="DS.Med"]{height:26px !important}
  header a[href*="#quote"]{padding:9px 14px !important;font-size:12.5px !important}
  /* every grid → single column; specialty chips keep 2 */
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns: repeat(4,1fr)"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3,1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"],
  div[style*="grid-template-columns:repeat(2,1fr)"],
  div[style*="grid-template-columns: repeat(2,1fr)"],
  div[style*="grid-template-columns: repeat(2, 1fr)"]{grid-template-columns:1fr !important}
  div[style*="grid-template-columns:repeat(5,1fr)"],
  div[style*="grid-template-columns: repeat(5,1fr)"],
  div[style*="grid-template-columns: repeat(5, 1fr)"]{grid-template-columns:repeat(2,1fr) !important}
  /* card-row grids (product photo + text) → stack */
  div[style*="grid-template-columns:1.3fr 1fr 1fr"],
  div[style*="grid-template-columns: 1.3fr 1fr 1fr"],
  div[style*="grid-template-columns:190px 1fr"],
  div[style*="grid-template-columns: 190px 1fr"],
  div[style*="grid-template-columns:150px 1fr"],
  div[style*="grid-template-columns: 150px 1fr"],
  div[style*="grid-template-columns:110px 1fr"],
  div[style*="grid-template-columns: 110px 1fr"]{grid-template-columns:1fr !important}
  /* top contact bar wraps */
  div[style*="margin-left:auto"][style*="gap:22px"],
  div[style*="margin-left: auto"][style*="gap: 22px"]{margin-left:0 !important;flex-wrap:wrap;gap:8px 14px !important}
  /* homepage hero: stats wrap, decorative art hidden */
  div[style*="display:flex"][style*="gap:40px"],
  div[style*="display: flex"][style*="gap: 40px"],
  div[style*="display:flex"][style*="gap:36px"],
  div[style*="display: flex"][style*="gap: 36px"]{flex-wrap:wrap;gap:18px 28px !important}
  div[style*="position:relative"][style*="height:440px"],
  div[style*="position: relative"][style*="height: 440px"]{display:none !important}
  /* button rows wrap */
  div[style*="display:flex"][style*="gap:14px"],
  div[style*="display: flex"][style*="gap: 14px"]{flex-wrap:wrap}
  /* wide tables scroll instead of overflowing */
  table{display:block;overflow-x:auto}
  table thead, table tbody{display:table;width:100%;min-width:480px}
  /* hero photo panels tighter */
  div[style*="height:380px"],
  div[style*="height: 380px"],
  div[style*="height:420px"],
  div[style*="height: 420px"]{height:240px !important}
}


/* ── v3: category hero art, product rows, comparison tables ── */
@media (max-width: 960px){
  /* product row cards: photo column collapses */
  div[style*="grid-template-columns:400px 1fr"],
  div[style*="grid-template-columns: 400px 1fr"]{grid-template-columns:1fr !important}
  div[style*="grid-template-columns:400px 1fr"] > div:first-child,
  div[style*="grid-template-columns: 400px 1fr"] > div:first-child{border-right:none !important;border-bottom:1px solid #e4ebf2 !important;min-height:0 !important;padding:18px !important}
  div[style*="grid-template-columns:400px 1fr"] a[style*="min-height:272px"],
  div[style*="grid-template-columns: 400px 1fr"] a[style*="min-height: 272px"]{min-height:200px !important;height:200px !important}
  /* comparison grids scroll horizontally inside their card */
  div[style*="border-radius:16px"][style*="overflow:hidden"],
  div[style*="border-radius: 16px"][style*="overflow: hidden"]{overflow-x:auto !important}
  div[style*="grid-template-columns:1.5fr 1fr 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr"]{min-width:620px}
  div[style*="grid-template-columns:1.2fr 1fr 1fr"],
  div[style*="grid-template-columns: 1.2fr 1fr 1fr"]{min-width:520px}
  /* comparison table card padding */
  div[style*="padding:36px 40px"],
  div[style*="padding: 36px 40px"]{padding:22px 18px !important;overflow-x:auto}
}
@media (max-width: 640px){
  /* category hero: shrink the orbit art, hide the decorative rings */
  div[style*="position:relative"][style*="height:400px"],
  div[style*="position: relative"][style*="height: 400px"]{height:250px !important}
  div[style*="position:absolute"][style*="width:540px"],
  div[style*="position: absolute"][style*="width: 540px"],
  div[style*="position:absolute"][style*="width:420px"],
  div[style*="position: absolute"][style*="width: 420px"]{display:none !important}
  div[style*="position:absolute"][style*="width:460px"],
  div[style*="position: absolute"][style*="width: 460px"]{width:280px !important;height:280px !important}
  img[style*="max-height:330px"],
  img[style*="max-height: 330px"]{max-height:210px !important;max-width:82% !important}
  /* product row photos a touch smaller */
  div[style*="grid-template-columns:400px 1fr"] a[style*="min-height:272px"],
  div[style*="grid-template-columns: 400px 1fr"] a[style*="min-height: 272px"]{min-height:170px !important;height:170px !important}
  div[style*="grid-template-columns:1.5fr 1fr 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr"]{min-width:560px}
}


/* ── v5: homepage hero art on phones + specialty chips ── */
@media (max-width: 640px){
  /* specialty chips: 2 columns, compact so long names fit */
  section#specialties div[style*="grid-template-columns:repeat(5,1fr)"],
  section#specialties div[style*="grid-template-columns: repeat(5, 1fr)"],
  section#specialties div[style*="grid-template-columns: repeat(5,1fr)"]{grid-template-columns:repeat(2,1fr) !important;gap:10px !important}
  section#specialties a[style*="padding:16px 18px"],
  section#specialties a[style*="padding: 16px 18px"]{padding:11px 12px !important;font-size:12.5px !important;gap:8px !important;line-height:1.25;text-wrap:balance}
  section#specialties a[style*="padding:16px 18px"] > div,
  section#specialties a[style*="padding: 16px 18px"] > div{width:26px !important;height:26px !important;border-radius:7px !important}
  section#specialties a[style*="padding:16px 18px"] > div svg,
  section#specialties a[style*="padding: 16px 18px"] > div svg{width:15px !important;height:15px !important}
  /* homepage hero art: show again, compact, below the copy */
  section#top div[style*="position:relative"][style*="height:440px"],
  section#top div[style*="position: relative"][style*="height: 440px"]{display:block !important;height:300px !important;margin-top:8px}
  /* the 4 product chips: re-laid as a 2x2 grid instead of scattered */
  section#top div[style*="height: 440px"] > div > div:nth-child(6){top:5% !important;left:4% !important}
  section#top div[style*="height: 440px"] > div > div:nth-child(7){top:5% !important;left:auto !important;right:4%}
  section#top div[style*="height: 440px"] > div > div:nth-child(8){top:auto !important;bottom:22% !important;left:4% !important}
  section#top div[style*="height: 440px"] > div > div:nth-child(9){top:auto !important;bottom:22% !important;left:auto !important;right:4%}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9){padding:7px 9px !important;gap:7px !important;max-width:46%}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9) > div:first-child{width:26px !important;height:26px !important}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9) > div:first-child svg{width:15px !important;height:15px !important}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9) > div:last-child > div:first-child{font-size:8.5px !important;margin-bottom:2px !important}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9) > div:last-child > div:last-child{font-size:12px !important}
  /* pulse rings out of the way, caption smaller */
  section#top div[style*="height: 440px"] > div > div[style*="right: 36px"]{display:none !important}
  section#top div[style*="height: 440px"] > div > div:last-child{font-size:9px !important;right:12px !important;bottom:9px !important}
}


/* v6: длинные подписи чипов в шапке главной не выходят за плашку */
section#top div[style*="height: 440px"] div,
section#top div[style*="height:440px"] div{overflow-wrap:anywhere;hyphens:auto}
@media (max-width: 640px){
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9){max-width:44% !important}
}


/* ── v7: специальности, чипы графики, форма запроса КП ── */
@media (max-width: 640px){
  /* Оборудование для каждой специальности: длинные названия переносятся */
  section#specialties a[style*="padding:16px 18px"],
  section#specialties a[style*="padding: 16px 18px"]{padding:10px 11px !important;font-size:11.5px !important;gap:7px !important;line-height:1.3;overflow-wrap:anywhere;hyphens:auto;align-items:flex-start !important}
  section#specialties a[style*="padding:16px 18px"] > div:first-child,
  section#specialties a[style*="padding: 16px 18px"] > div:first-child{width:24px !important;height:24px !important;border-radius:6px !important;flex:none}
  section#specialties a[style*="padding:16px 18px"] > div:first-child svg,
  section#specialties a[style*="padding: 16px 18px"] > div:first-child svg{width:14px !important;height:14px !important}
  /* чипы в графике шапки: марки не разрываются посередине */
  section#top div[style*="height: 440px"] a,
  section#top div[style*="height:440px"] a{white-space:nowrap}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9) > div:last-child > div:last-child,
  section#top div[style*="height:440px"] > div > div:nth-child(n+6):nth-child(-n+9) > div:last-child > div:last-child{font-size:11px !important;line-height:1.35;display:flex;flex-wrap:wrap;gap:0 4px}
  section#top div[style*="height: 440px"] > div > div:nth-child(n+6):nth-child(-n+9),
  section#top div[style*="height:440px"] > div > div:nth-child(n+6):nth-child(-n+9){max-width:43% !important;padding:6px 8px !important}
  /* форма «Запросить КП»: заголовок и поля вписываются в экран */
  section#quote h2, section[id="quote"] h2{font-size:20px !important;line-height:1.3 !important;overflow-wrap:anywhere}
  section#quote input, section#quote select, section#quote textarea,
  section[id="quote"] input, section[id="quote"] select, section[id="quote"] textarea{max-width:100% !important;width:100% !important}
  section#quote div[style*="grid-template-columns"],
  section[id="quote"] div[style*="grid-template-columns"]{grid-template-columns:1fr !important}
}
@media (max-width: 400px){
  section#specialties div[style*="grid-template-columns:repeat(5,1fr)"],
  section#specialties div[style*="grid-template-columns: repeat(5, 1fr)"],
  section#specialties div[style*="grid-template-columns: repeat(5,1fr)"]{grid-template-columns:1fr !important}
}


/* ── v9: mobile — no motion outside the hero; RU catalog rows & tables ── */
@media (max-width: 960px){
  /* RU product rows: photo | text | price → single column */
  div[style*="grid-template-columns:260px 1fr 240px"],
  div[style*="grid-template-columns: 260px 1fr 240px"]{grid-template-columns:1fr !important}
  div[style*="grid-template-columns:260px 1fr 240px"] > a:first-child,
  div[style*="grid-template-columns: 260px 1fr 240px"] > a:first-child{border-right:none !important;border-bottom:1px solid #e4ebf2 !important;min-height:200px !important;padding:16px !important}
  div[style*="grid-template-columns:260px 1fr 240px"] > div:last-child,
  div[style*="grid-template-columns: 260px 1fr 240px"] > div:last-child{border-left:none !important;border-top:1px solid #eef2f7 !important}
  /* every spec/comparison table scrolls inside its card instead of stretching the page */
  table{display:block;width:100% !important;overflow-x:auto;-webkit-overflow-scrolling:touch}
  table tbody, table thead{display:table;width:100%;min-width:420px}
}
@media (max-width: 640px){
  div[style*="grid-template-columns:260px 1fr 240px"] > a:first-child,
  div[style*="grid-template-columns: 260px 1fr 240px"] > a:first-child{min-height:165px !important}
  table tbody, table thead{min-width:380px}
  /* Homepage only: no motion outside the hero graphic (section#top stays animated) */
  body:has(section#top) section:not(#top),
  body:has(section#top) section:not(#top) *,
  body:has(section#top) footer,
  body:has(section#top) footer *{animation:none !important;transition:none !important;transform:none !important}
}

/* mobile nav dropdown panel */
.ds-mobile-nav{display:none;position:fixed;left:0;right:0;bottom:0;z-index:1000;background:#ffffff;border-bottom:1px solid #e2e8f0;box-shadow:0 18px 40px rgba(14,32,56,0.18);padding:10px 20px 24px;flex-direction:column;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.ds-mobile-nav.open{display:flex}
.ds-mobile-nav a{display:block;padding:13px 6px;font:500 15px 'Montserrat',sans-serif;color:#31465c;text-decoration:none;border-bottom:1px solid #eef2f7}
.ds-mobile-nav a:last-child{border-bottom:none}
