@import url("/local/mama/ui2/components.css");

/* Shared article sidebar: prices and doctor are independent cards. */
.mama-content-aside {
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(100%, 320px);
  font-family: var(--mama-font-sans);
}
.mama-aside-price,
.mama-aside-doctor {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--mama-color-border);
  border-radius: var(--mama-radius-lg);
  background: var(--mama-color-surface);
  color: var(--mama-color-text);
}
.mama-aside-price h3,
.mama-aside-doctor h3 {
  margin: 0 0 16px;
  color: var(--mama-color-heading);
  font: 600 20px/1.25 var(--mama-font-sans);
}
.mama-aside-price__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--mama-color-border-subtle);
  font: 400 14px/1.4 var(--mama-font-sans);
}
.mama-aside-price__row strong {
  white-space: nowrap;
  font-weight: 600;
}
.mama-aside-doctor img {
  display: block;
  width: 108px;
  height: 108px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}
.mama-aside-doctor p {
  margin: 0 0 16px;
  color: var(--mama-color-text-muted);
  font: 400 14px/1.5 var(--mama-font-sans);
}
.mama-aside-doctor .mama-button {
  width: 100%;
  text-align: center;
}

/* RAIL-001: keep the Bitrix article body and existing rail in one stable grid. */
body.mama-ui2-shell .mama-article-rail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 24px;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 var(--mama-space-12);
}
body.mama-ui2-shell .mama-article-rail-layout--left {
  grid-template-columns: minmax(0, 1fr);
}
html.mama-encyclopedia-rail-booting
  body.section-encyclopedia
  .mama-article-rail-layout {
  grid-template-columns: minmax(0, 1fr);
}
html.mama-encyclopedia-rail-booting
  body.section-encyclopedia
  .mama-article-rail-layout
  > .b-service__rightbar {
  visibility: hidden;
}
body.mama-ui2-shell .mama-article-rail-layout > .b-service__content--wrapper {
  grid-column: 1;
  float: none;
  position: static;
  left: auto;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
}
body.mama-ui2-shell .mama-article-rail-layout .content_main {
  float: none;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
body.mama-ui2-shell .mama-article-rail-layout .content_main > .article-title {
  margin: 0 0 var(--mama-space-6);
}
body.mama-ui2-shell .mama-article-rail-layout > .b-service__rightbar {
  grid-column: 2;
  float: none;
  position: static !important;
  left: auto;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
}
body.mama-ui2-shell .mama-article-rail-search {
  box-sizing: border-box;
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid var(--mama-color-border);
  border-radius: var(--mama-radius-lg);
  background: var(--mama-color-surface);
}
body.mama-ui2-shell .mama-article-rail-search form {
  display: block;
  width: 100%;
  margin: 0;
}
body.mama-ui2-shell .mama-article-rail-search input[name="q"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--mama-color-border);
  border-radius: var(--mama-radius-sm);
  background: var(--mama-color-surface);
  color: var(--mama-color-text);
  font: 400 15px/1.4 var(--mama-font-sans);
}
@media (max-width: 1399px) {
  body.mama-ui2-shell .mama-article-rail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  body.mama-ui2-shell .mama-article-rail-layout > .b-service__rightbar {
    grid-column: 1;
  }
}

/* Bitrix adapters retain the existing infoblock prices, doctors, and links. */
body.mama-ui2-shell .b-service__rightbar {
  box-sizing: border-box;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mama-color-text);
  font-family: var(--mama-font-sans);
  box-shadow: none;
}
body.mama-ui2-shell .b-service__rightbar .action-rightbar-rotator {
  width: 100% !important;
}
body.mama-ui2-shell .b-service__rightbar .action-rightbar-rotator__slide {
  box-sizing: border-box;
}
body.mama-ui2-shell .b-service__rightbar .gray-dashed-box-right {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid var(--mama-color-border);
  border-radius: var(--mama-radius-lg);
  background: var(--mama-color-surface);
  box-shadow: none;
}
body.mama-ui2-shell .b-service__rightbar .gray-dashed-box-right > .h3 {
  display: block;
  margin: 0 0 14px;
  color: var(--mama-color-heading) !important;
  font: 600 20px/1.25 var(--mama-font-sans);
  text-decoration: none;
}
body.mama-ui2-shell
  .b-service__rightbar
  .gray-dashed-box-right
  > .h3
  .i-link__decoration {
  border: 0;
  color: inherit;
  text-decoration: none;
}
body.mama-ui2-shell
  .b-service__rightbar
  .gray-dashed-box-right
  > .h3
  .i-link__decoration {
  color: var(--mama-color-heading) !important;
}
body.mama-ui2-shell .b-service__rightbar .action-rightbar__cta .b-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--mama-radius-sm);
  background: var(--mama-color-action) !important;
  box-shadow: none;
  color: var(--mama-color-action-text) !important;
  text-decoration: none;
  text-shadow: none;
  font: 600 14px/1.35 var(--mama-font-sans) !important;
}
body.mama-ui2-shell
  .b-service__rightbar
  .action-rightbar__cta
  .b-button::before,
body.mama-ui2-shell
  .b-service__rightbar
  .action-rightbar__cta
  .b-button::after {
  display: none;
}
body.mama-ui2-shell
  .b-service__rightbar
  .action-rightbar__cta
  .b-button
  .b-button__content {
  padding: 0;
  border: 0;
  background: none;
  color: inherit !important;
  font: inherit !important;
  text-shadow: none;
}
body.mama-ui2-shell .b-service__rightbar .b-service__rightbar__button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--mama-color-border-subtle);
  border-radius: 0;
  background: transparent;
  color: var(--mama-color-text);
  box-shadow: none;
}
body.mama-ui2-shell
  .b-service__rightbar
  .b-service__rightbar__button
  :where(.rightbar_text, .rightbar_text a, .rightbar_price, strong) {
  color: var(--mama-color-text) !important;
  font: 400 14px/1.45 var(--mama-font-sans);
  text-decoration: none;
  overflow-wrap: anywhere;
}
body.mama-ui2-shell
  .b-service__rightbar
  .gray-dashed-box-right
  .rightbar_text
  a {
  color: var(--mama-color-text) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.mama-ui2-shell
  .b-service__rightbar
  .b-service__rightbar__button
  .rightbar_price
  strong {
  font-weight: 600;
}
body.mama-ui2-shell .b-service__rightbar .doctor-cons_servis {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--mama-color-border);
  border-radius: var(--mama-radius-lg);
  background: var(--mama-color-surface);
  color: var(--mama-color-text);
  box-shadow: none;
  text-align: left;
}
body.mama-ui2-shell .b-service__rightbar .doctor-cons_servis .ava_66 {
  display: block;
  float: none;
  width: 108px;
  height: 108px;
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 50%;
}
body.mama-ui2-shell .b-service__rightbar .doctor-cons_servis .ava_66 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
body.mama-ui2-shell
  .b-service__rightbar
  .doctor-cons_servis
  :where(.d-name, .d-surname, .d-type) {
  display: block;
  color: var(--mama-color-text);
  font-family: var(--mama-font-sans);
  text-align: center;
}
body.mama-ui2-shell
  .b-service__rightbar
  .doctor-cons_servis
  :where(.d-name, .d-surname) {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
body.mama-ui2-shell .b-service__rightbar .doctor-cons_servis .d-type {
  margin-top: 8px;
  color: var(--mama-color-text-muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}
body.mama-ui2-shell .b-service__rightbar .ask_quesction_link {
  display: block;
  margin-top: 12px;
  text-decoration: none;
}
body.mama-ui2-shell .b-service__rightbar .ask_question {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  height: auto;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--mama-radius-sm);
  background: var(--mama-color-action) !important;
  background-image: none !important;
  color: var(--mama-color-action-text) !important;
  box-shadow: none;
  text-shadow: none;
  font: 600 14px/1.35 var(--mama-font-sans) !important;
}
body.mama-ui2-shell .b-service__rightbar .ask_question::before {
  display: none;
}
body.mama-ui2-shell .b-service__rightbar .ask_question:hover {
  background: var(--mama-color-action-hover) !important;
}
body.mama-ui2-shell .b-service__rightbar .ask_question span {
  color: inherit !important;
  font: inherit !important;
}

body.mama-ui2-shell .b-service__rightbar a:focus-visible {
  outline: 3px solid var(--mama-color-focus);
  outline-offset: 2px;
}

/* READ-002: стоимость — явный переход всей карточкой. */
.mama-price-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--mama-space-4);
  color: var(--mama-color-link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.mama-price-link::after {
  content: "→";
  flex: none;
}
