/* ===== FAQ page ===== */

.faq-page {
  padding: 60px 0 60px;
}

.faq-page__title {
  margin: 0 0 24px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  color: #1a1a1a;
}

.faq-empty {
  margin: 24px 0;
  color: #474747;
}

/* Top promo banner ("Рекомендации") */
.faq-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-radius: 16px;
  /*background: var(--primary-light-color, #EBF7FF);*/
  background-color: #EBF7FF;
  margin-bottom: 24px;
}

.faq-banner__wrapper {
    display: flex;
    gap: 30px
}

.faq-banner__icon {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-banner__icon img {
  width: 40px;
  height: auto;
}

.faq-banner__text {
  flex: 1 1 auto;
  min-width: 0;
}

.faq-banner__label {
  display: block;
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.faq-banner__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #292929;
  line-height: 1.3;
}

.faq-banner__subtitle {
  margin: 0;
  font-size: 16px;
  color: #474747;
}

.faq-banner__cta {
  flex: 0 0 auto;
  background-color: var(--primary-color);
  /*height: 48px;*/
  padding: 0 28px;
  white-space: nowrap;
}

/* Branch tabs */
.faq-page .price-list__filials-wrapper {
  margin-bottom: 24px;
  display: none;
}

.faq-page .price-list__filials-wrapper .tabs {
  height: 32px;
  border-radius: 7.91px;
}

.faq-page .price-list__filials-wrapper .tabs__list {
  gap: 6.6px;
  justify-content: flex-start;
}

.faq-page .price-list__filials-wrapper .tabs__list .tabs__item a {
  padding: 2.64px 10.55px;
  border-radius: 7.91px;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 767px) {

  .faq-page .price-list__filials-wrapper {
    width: 100%;
    display: block;
  }
  .faq-page .price-list__filials-wrapper .tabs {
    width: 100%;
  }
  .faq-page .price-list__filials-wrapper .tabs__item {
    width: 100%;
  }
  .faq-page .price-list__filials-wrapper .tabs__list .tabs__item a {
    padding: 0 10px;
  }
}

/* Branch chips (mobile only) */
.faq-chips {
  display: none;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.faq-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: #474747;
  background: #f3f4f6;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.faq-chip:hover {
  text-decoration: none;
  color: #1a1a1a;
}

.faq-chip.is-active {
  background: var(--primary-color);
  color: #fff;
}

/* Filter controls (search + select) */
.faq-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.faq-controls__search,
.faq-controls__select {
  min-width: 0;
}

.faq-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #D2D2D2;
  border-radius: 10px;
  padding: 0 15px;
  box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.08) inset;
  width: 100%;
}

.faq-input-wrapper:focus-within {
  border-color: var(--primary-color);
}

.faq-input-icon {
  margin-right: 12px;
  flex-shrink: 0;
}

.faq-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 0;
  font-size: 14px;
  color: #333;
  background: transparent;
  width: 100%;
  font-family: inherit;
}

.faq-input::placeholder {
  color: #999;
}

.faq-input--select {
  appearance: none;
  cursor: pointer;
  padding-right: 24px;
}

.faq-input-chevron {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  flex-shrink: 0;
}

/* Native search clear icon — hide in favor of our own button */
.faq-input[type="search"]::-webkit-search-cancel-button,
.faq-input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Search autocomplete */
.faq-autocomplete {
  position: relative;
}

.faq-autocomplete__clear {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 8px;
  border: none;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.faq-autocomplete__clear:hover {
  /*background: #e5e7eb;*/
}

.faq-autocomplete__clear[hidden] {
  display: none;
}

.faq-autocomplete__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  z-index: 10;
  max-height: 280px;
  overflow-y: auto;
}

.faq-autocomplete__list[hidden] {
  display: none;
}

.faq-autocomplete__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  line-height: 1.3;
}

.faq-autocomplete__item:hover,
.faq-autocomplete__item.is-active {
  background: #f3f4f6;
}

.faq-autocomplete__item-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-autocomplete__item-title b {
  color: var(--primary-color);
  font-weight: 600;
}

.faq-autocomplete__item-count {
  flex: 0 0 auto;
  font-size: 12px;
  color: #959593;
}

.faq-autocomplete__empty {
  padding: 12px 16px;
  font-size: 14px;
  color: #959593;
}

/* Two-column grid (list + sidebar) */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

/* Question card */
.faq-card {
  background: #fff;
  /*border: 1px solid #eef0f2;*/
  border-radius: 12px;
  padding: 20px 24px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.faq-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.faq-card__name {
  font-size: 14px;
  color: #9ca3af;
  font-weight: 600;
}

.faq-card__date {
  font-size: 13px;
  color: #959593;
  white-space: nowrap;
}

.faq-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.faq-card__footer-left {
  flex: 1 1 auto;
  min-width: 0;
}

.faq-card__footer-left:empty {
  display: none;
}

.faq-card__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.faq-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
  line-height: 1.3;
  color: #474747;
  text-decoration: none;
  max-width: 100%;
}

a.faq-card__meta-item:hover {
  background: var(--primary-light-color, #ebf7ff);
  color: var(--primary-color);
  text-decoration: none;
}

.faq-card__meta-item svg {
  flex-shrink: 0;
  color: #959593;
}

a.faq-card__meta-item:hover svg {
  color: var(--primary-color);
}

.faq-card__meta-label {
  color: #959593;
  flex-shrink: 0;
}

.faq-card__meta-value {
  color: inherit;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.faq-card__question {
  font-size: 16px;
  color: #474747;
  line-height: 1.5;
  font-weight: 600;
}

.faq-card__no-answer {
  margin: 0;
  color: #959593;
  font-size: 13px;
}

.faq-card__answer {
  /*margin-top: 16px;*/
  /*padding: 16px 0;*/
  /*background: #f7f9fa;*/
  border-radius: 10px;
  display: none;
}

.faq-card.is-expanded .faq-card__answer {
  display: block;
}

.faq-card__toggle {
  display: inline-block;
  font-size: 14px;
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
}

.faq-card__toggle:hover {
  text-decoration: underline;
}

.faq-card__answer-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.faq-card__answer-content {
  flex: 1;
  min-width: 0;
}

.faq-card__answer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.faq-card__answer-icon {
  flex: 0 0 57px;
  width: 57px;
  height: 57px;
  border-radius: 50%;
  background-color: var(--primary-light-color, #eefdff);
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.faq-card__answer-icon--default {
  background-image: url("../img/icons/clock_icon_small.d0afcfa4b5b8.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.faq-card__answer-author {
  flex: 1 1 auto;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
}

.faq-card__answer-date {
  color: #959593;
  font-size: 13px;
  white-space: nowrap;
}

.faq-card__answer-text {
    font-size: 14px;
    color: #474747;
    line-height: 1.5;
    /*font-weight: 600;*/
}

/* Sidebar promo (appointment) */
.faq-promo {
  position: sticky;
  top: 16px;
}

.faq-promo__inner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  padding: 220px 24px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 45%, rgba(0, 174, 203, 0.55) 70%, var(--primary-color) 100%),
    radial-gradient(circle at 50% 30%, #d6f4fb 0%, #9be4f0 60%, var(--primary-color) 100%);
  color: #fff;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: center;
}

.faq-promo__img--desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.faq-promo__img--mobile {
  display: none;
}

.faq-promo__title,
.faq-promo__cta {
  position: relative;
  z-index: 1;
}

.faq-promo__title {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.3;
  /*font-weight: 600;*/
  color: #fff;
}

.faq-promo__cta {
  /*width: 100%;*/
  background-color: var(--conflict-color);
  /*height: 48px;*/
}

.faq-promo__cta:hover {
  opacity: 0.92;
}

/* ===== Dialog (Задать вопрос) ===== */
.faq-dialog {
  max-width: 640px;
  padding: 32px 32px 28px;
  gap: 16px;
}

.faq-form__header {
  margin-bottom: 4px;
}

.faq-form__header h3 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
}

.faq-form__header p {
  margin-top: 4px;
  color: #474747;
  font-size: 14px;
}

.faq-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.faq-form__field {
  position: relative;
  min-width: 0;
}

.faq-form__input,
.faq-form__select,
.faq-form__textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #f3f4f6;
  font-size: 14px;
  color: #1a1a1a;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

.faq-form__textarea {
  min-height: 130px;
}

.faq-form__select {
  appearance: none;
  padding-right: 44px;
  cursor: pointer;
}

.faq-form__field:has(.faq-form__select)::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #959593;
  border-bottom: 2px solid #959593;
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
}

.faq-form__input::placeholder,
.faq-form__textarea::placeholder {
  color: #959593;
}

/* Doctor combobox in ask form */
.faq-doctor-select {
  position: relative;
}

.faq-doctor-select__input {
  padding-right: 64px;
  cursor: text;
}

.faq-doctor-select__chevron {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.faq-doctor-select__clear {
  position: absolute;
  top: 50%;
  right: 38px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.faq-doctor-select__clear:hover {
  background: #e5e7eb;
}

.faq-doctor-select__clear[hidden] {
  display: none;
}

.faq-doctor-select.is-filled .faq-doctor-select__chevron {
  display: none;
}

.faq-doctor-select.is-filled .faq-doctor-select__clear {
  right: 18px;
}

.faq-doctor-select__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
}

.faq-doctor-select__list[hidden] {
  display: none;
}

.faq-doctor-select__item {
  padding: 10px 16px;
  font-size: 14px;
  color: #1a1a1a;
  cursor: pointer;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.faq-doctor-select__item:hover,
.faq-doctor-select__item.is-active {
  background: #f3f4f6;
}

.faq-doctor-select__empty {
  padding: 12px 16px;
  font-size: 14px;
  color: #959593;
}

.faq-form__input:focus,
.faq-form__select:focus,
.faq-form__textarea:focus {
  border-color: var(--primary-color);
  background: #fff;
}

.faq-form__privacy {
  margin: 0;
  font-size: 12px;
  color: #959593;
  line-height: 1.55;
}

.faq-form__privacy a {
  color: var(--primary-color);
  text-decoration: underline;
}

.faq-form__error {
  color: #fd4741;
  font-size: 13px;
}

/* Privacy checkbox (shared markup with contacts form) */
.faq-form .contacts-form__privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.faq-form .contacts-form__privacy-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.faq-form .contacts-form__privacy-box {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  background: #fff;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.faq-form .contacts-form__privacy-box::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 2px;
  background: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.faq-form .contacts-form__privacy-input:checked + .contacts-form__privacy-box {
  border-color: var(--primary-color);
}

.faq-form .contacts-form__privacy-input:checked + .contacts-form__privacy-box::after {
  opacity: 1;
}

.faq-form .contacts-form__privacy-input:focus-visible + .contacts-form__privacy-box {
  outline: 2px solid rgba(0, 174, 203, 0.25);
  outline-offset: 2px;
}

.faq-form .contacts-form__privacy-text {
  font-size: 12px;
  color: #959593;
  line-height: 1.4;
}

.faq-form .contacts-form__privacy-text a {
  color: var(--primary-color);
}

.faq-form__submit {
  align-self: flex-start;
  min-width: 220px;
  height: 48px;
  background-color: var(--primary-color);
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
  .faq-grid {
    display: flex;
    flex-direction: column;
  }
  .faq-list{
      margin-top: 30px;
  }
  .faq-promo {
    position: static;
    width: 100%;
    /*order: -1;*/
  }
  .faq-promo__inner {
    padding: 24px 160px 24px 24px;
    min-height: 200px;
    text-align: left;
    justify-content: center;
    background:
      linear-gradient(90deg, var(--primary-color) 0%, rgba(0, 174, 203, 0.6) 100%);
  }
  .faq-promo__img--desktop {
    display: none;
  }
  .faq-promo__img--mobile {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: auto;
    pointer-events: none;
  }
  .faq-promo__cta {
    /*width: auto;*/
    align-self: flex-start;
    padding: 0 28px;
  }
}

@media (max-width: 767px) {


  .faq-page {
    padding: 60px 0 60px;
  }
  .faq-input-wrapper{
      height: 36px;
  }
  .faq-page__title {
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
  }
  .faq-banner__label{
      margin-bottom: 0;
  }
  .faq-chips {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
  }
  .faq-chip{
      font-size: 12px;
  }
  .faq-banner__title{
      font-size: 16px;
  }
  .faq-banner__subtitle{
      font-size: 14px;
  }
  .faq-banner__wrapper img{
      width: 46px;
  }
  .faq-banner__text{
      display: flex;
      flex-direction: column;
      gap: 4px;
  }
  .faq-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    text-align: left;
  }
  .faq-banner__cta {
    width: 100%;
  }
  .faq-controls {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .faq-form__row {
    grid-template-columns: 1fr;
  }
  .dialog-overlay:has(.faq-dialog) {
    align-items: flex-end;
  }
  .faq-dialog {
    padding: 24px 20px 20px;
    max-height: 90dvh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    margin: 0;
  }
  .faq-card {
    padding: 16px 18px;
  }
  .faq-card__answer {
    /*padding: 14px 16px;*/
  }
  .faq-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .faq-card__meta {
    justify-content: flex-start;
    width: 100%;
  }
  .faq-promo__title{
      font-size: 16px;
  }
}

@media (max-width: 479px) {
  .faq-card {
    padding: 14px 16px;
  }
}
