/* Рабочий CSS темы.
 * Подтягиваем исходный макетный файл из assets/css/main.css
 * и дальше правим/перекрываем стили уже здесь.
 */
@import url("../assets/css/main.css");

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pill:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  padding: 0 10px;
  font-weight: 700;
}

body.ruyxd-modal-open {
  overflow: hidden;
}

.ruyxd-modal[hidden] {
  display: none !important;
}

.ruyxd-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ruyxd-modal__dialog {
  width: min(720px, 100%);
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  padding: 22px 22px 26px;
}

.ruyxd-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ruyxd-modal__title {
  margin: 0;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  color: var(--text-black);
}

.ruyxd-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(132, 11, 172, 0.12);
  color: var(--accent);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ruyxd-modal__close:hover {
  background: rgba(132, 11, 172, 0.18);
}

/* CF7: убираем дефолтные отступы, чтобы форма с нашими классами выглядела как макет. */
.wpcf7 form {
  margin: 0;
}

/* Текстовая область "вопрос" всегда вписывается в карточку/попап. */
textarea.order-form__input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
  min-height: 110px;
  resize: vertical;
  padding-top: 12px;
  padding-bottom: 12px;
}


.wpcf7-response-output {
  margin: 14px 0 0 !important;
  padding: 10px 14px !important;
  border-radius: 14px;
  font-size: 14px;
}

.wpcf7-not-valid-tip {
  font-size: 12px;
  margin-top: 6px;
}

.wpcf7-spinner {
  display: none;
}

.header-burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.header-burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background-color: var(--white);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-nav__mobile {
  display: none;
}

.header-nav__desktop {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 46px;
}

.header-nav {
  gap: 0;
}

/* В assets/css/main.css у многих секций из Figma стоит line-height: 20px при font-size 24–34px —
   на iPhone/Safari строки при переносе визуально «склеиваются». */
.popular-docs__title,
.prices-benefits__title,
.buy-diploma__title,
.benefits__title,
.audience__title,
.audience__subtitle,
.order-online__title,
.steps__title,
.faq__title,
.useful-info__title,
.higher-edu__title,
.vuz-moscow__title {
  line-height: 1.2;
}

.header.header--menu-open .header-burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.header.header--menu-open .header-burger span:nth-child(2) {
  opacity: 0;
}

.header.header--menu-open .header-burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Карточки в flex-ряду должны уметь сжиматься (иначе горизонтальный overflow). */
.prices-benefits__card {
  min-width: 0;
}

/* Главная: три колонки (две сетки + картинка) не помещаются при ~1025–1100px — раньше переходим в колонку. */
@media (max-width: 1200px) {
  .benefits__content {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    gap: 20px;
  }

  .benefits__col,
  .benefits__col--right {
    width: 100%;
    max-width: 100%;
  }

  .benefits__art {
    width: min(100%, 320px);
    height: auto;
    aspect-ratio: 263 / 398;
    max-height: 320px;
    margin: 0 auto;
  }

  .prices-benefits__rows {
    gap: 20px;
  }

  .prices-benefits__row,
  .prices-benefits__row--bottom {
    flex-direction: column;
    gap: 16px;
  }

  .prices-benefits__card {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .header {
    position: sticky;
  }

  .sidebar {
    display: none;
  }

  .body {
    margin-left: 0;
    padding-top: 20px;
  }

  .header__inner--main {
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 32px;
    height: auto;
    gap: 24px;
  }

  .header-brand {
    align-items: center;
  }

  .header-main__pic {
    display: none;
  }

  .header-contacts__address {
    display: none;
  }

  .header-contacts {
    margin-left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    column-gap: 16px;
    row-gap: 16px;
    align-items: center;
  }

  .header-contacts__group {
    width: 100%;
    max-width: 320px;
  }

  .header-contacts__group--address {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 260px;
    gap: 0;
  }

  .header-contacts__group--phones {
    grid-column: 1;
    justify-self: end;
    max-width: 200px;
  }

  .header-contacts__group--action {
    grid-column: 2;
    justify-self: start;
    max-width: 200px;
    gap: 10px;
  }

  .header-contacts__group--address,
  .header-contacts__group--phones,
  .header-contacts__group--action {
    width: 100%;
  }

  .header-contacts__group--address .header-contacts__btn--accent,
  .header-contacts__group--action .header-contacts__btn--primary {
    width: 100%;
  }

  .header-contacts__item {
    padding: 0;
  }

  .header-top--nav {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header__inner--top {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-burger {
    display: inline-flex;
    order: 1;
  }

  .header-search {
    order: 2;
    margin-left: auto;
    width: 190px;
    height: 32px;
  }

  .header-nav {
    order: 3;
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    background: #ffffff;
    border-radius: 0;
    overflow: auto;
    z-index: 30;
  }

  .header-nav__desktop {
    display: none;
  }

  .header-nav__mobile {
    display: block;
    padding: 64px 16px 20px;
  }

  .mobile-menu__section+.mobile-menu__section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-menu__title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
    padding: 0 8px;
    margin-bottom: 10px;
  }

  .mobile-menu__list,
  .mobile-menu__list ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-menu__list>li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .mobile-menu__list>li:last-child {
    border-bottom: none;
  }

  .mobile-menu__list li {
    position: relative;
  }

  .mobile-menu__list a {
    display: block;
    padding: 12px 44px 12px 12px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 16px;
    line-height: 1.3;
    background: #ffffff;
  }

  .mobile-menu__list .sub-menu {
    display: none;
    padding-bottom: 8px;
  }

  .mobile-menu__list .sub-menu a {
    font-size: 14px;
    padding: 10px 12px 10px 20px;
    color: rgba(0, 0, 0, 0.8);
  }

  .mobile-menu__list li.is-submenu-open>.sub-menu {
    display: block;
  }

  .mobile-menu__toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.75);
  }

  .mobile-menu__toggle::before {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -2px;
  }

  .mobile-menu__list li.is-submenu-open>.mobile-menu__toggle::before {
    transform: rotate(-135deg);
    margin-top: 2px;
  }

  .mobile-menu__toggle:focus-visible {
    outline: 2px solid rgba(132, 11, 172, 0.35);
    outline-offset: 2px;
    border-radius: 10px;
  }

  .header.header--menu-open .header-nav {
    display: block;
  }

  .header.header--menu-open .header-search {
    display: none;
  }

  .header.header--menu-open .header-burger {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 40;
  }

  .header-nav__link {
    display: block;
    padding: 12px 24px;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--text-dark);
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  .header-nav__link:last-child {
    border-bottom: none;
  }

  .header-nav__link--active {
    background: var(--accent);
    color: var(--white);
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 1;
    padding-left: 56px;
    padding-right: 56px;
  }

  .header-top--categories {
    display: none;
  }

  .header.header--menu-open .header-main {
    display: none;
  }
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 1024px) {

  html,
  body {
    overflow-x: hidden;
  }

  body.is-menu-open {
    overflow: hidden;
  }

  .page {
    max-width: 100%;
  }

  .body__container {
    gap: 48px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  .hero__left {
    width: 100%;
    height: auto;
    padding: 0;
    gap: 24px;
  }

  .hero__text {
    width: auto;
    max-width: 640px;
  }

  .hero__title {
    font-size: 36px;
    line-height: 1.15;
    text-align: center;
  }

  .hero__desc {
    width: auto;
    text-align: center;
  }

  .hero__image {
    height: 320px;
  }

  .buy-diploma__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pill {
    padding: 6px 16px;
  }

  .popular-docs {
    height: auto;
  }

  .popular-docs__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .popular-docs__titleGroup {
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

  .popular-docs__title {
    font-size: 28px;
  }

  .popular-docs__all {
    align-self: flex-end;
  }

  .popular-docs__grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .popular-docs__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
  }

  .doc-card {
    width: 100%;
    height: auto;
    padding: 12px;
  }

  .doc-card__name {
    width: auto;
    white-space: normal;
    line-height: 1.3;
  }

  .benefits__content {
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  .benefits__head {
    gap: 18px;
  }

  .benefits__title {
    font-size: 28px;
  }

  .benefits__subtitle {
    font-size: 14px;
    line-height: 1.35;
  }

  .benefits__art {
    width: 100%;
    height: auto;
    aspect-ratio: 263 / 398;
    max-height: 320px;
  }

  .benefit-card {
    height: auto;
  }

  /* Форма заказа: отступы и поля на узких экранах. */
  .order-online__card {
    padding: 32px 20px;
    border-radius: 36px;
  }

  .order-online__cardHead {
    gap: 12px;
  }

  .order-online__cardTitle {
    font-size: clamp(28px, 7vw, 40px);
    line-height: 1.15;
  }

  .order-form__input,
  .order-form__select {
    box-sizing: border-box;
    min-height: 48px;
    height: auto;
    padding: 12px 18px;
    line-height: 1.35;
  }

  .order-form__select {
    padding-right: 52px;
  }

  .steps__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
  }

  .step-card {
    width: 100%;
    height: auto;
    padding: 24px 12px;
  }



  .price-card {
    flex-direction: column;
    /* align-items: stretch; */
    gap: 14px;
  }

  .price-card__thumb {
    width: 100%;
  }

  .price-card__side {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }

  .prices-cta {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .prices-cta__content {
    max-width: 100%;
  }

  .prices-cta__text {
    text-align: center;
    font-size: 18px;
  }

  .prices-cta__side {
    width: 100%;
  }

  .prices-cta__btn {
    width: 100%;
    max-width: 320px;
  }
}

@media (max-width: 640px) {
   .prices-group__list {
    grid-template-columns: 1fr;
  }
  .header-search {
    width: 160px;
  }

  .hero__title {
    font-size: 28px;
  }

  .hero__image {
    height: 240px;
  }

  .buy-diploma__row {
    grid-template-columns: 1fr;
  }

  .popular-docs__row {
    grid-template-columns: 1fr;
  }

  .steps__row {
    grid-template-columns: 1fr;
  }

  .price-card__side {
    flex-direction: column;
    /* align-items: flex-start; */
  }

  .prices-cta__btn {
    max-width: 100%;
  }

  .order-online__card {
    padding: 24px 16px;
    border-radius: 28px;
  }

  .order-online__cardTitle {
    font-size: 26px;
    line-height: 1.2;
  }

  .order-form__input,
  .order-form__select {
    font-size: 15px;
    letter-spacing: -0.02em;
    padding-left: 16px;
    padding-right: 16px;
  }

  .order-form__select {
    padding-right: 48px;
  }
}

@media (max-width: 1024px) {
  .footer__inner {
    padding: 24px 16px;
    gap: 24px;
  }

  .footer-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0;
    background: transparent;
    border-radius: 0;
  }

  .footer-nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
    text-align: center;
    gap: 8px;
  }

  .footer-nav__link--active {
    background: rgba(255, 255, 255, 0.22);
  }

  .footer-bottom {
    width: 100%;
    flex-direction: column;
    gap: 24px;
  }

  .footer-brand {
    width: auto;
  }

  .footer-contacts {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    justify-items: center;
  }

  .footer-contacts__group {
    width: 100%;
    max-width: 320px;
  }

  .footer-contacts__group--meta {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 360px;
    gap: 12px;
  }

  .footer-meta__time,
  .footer-meta__address {
    text-align: center;
  }

  .footer-pay,
  .footer-socials {
    max-width: 100%;
    height: auto;
  }

  .footer-contacts__group--phones,
  .footer-contacts__group--actions {
    align-items: center;
  }

  .footer-contacts__item {
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .footer-contacts {
    grid-template-columns: 1fr;
  }

  .footer-contacts__group--phones,
  .footer-contacts__group--actions {
    grid-column: 1 / -1;
  }
}