/*
Theme Name: psy-mk
Template: messia
Version: 1.0.0
*/

/* ===========================
   ПЕРЕМЕННЫЕ
=========================== */
:root {
  --orange: #f59044;
  --orange-light: #fdf3eb;
  --green: #697E3C;
  --green-light: #f2f5eb;
  --dark: #1a1a1a;
  --gray: #6b7280;
  --gray-light: #f5f5f5;
  --white: #ffffff;
  --radius: 12px;
  --radius-lg: 20px;
}

/* ===========================
   ОБЩИЕ СТИЛИ
=========================== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--dark);
  background: var(--white);
}

a { color: inherit; }

.h2-title, h2.title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--dark);
}

/* ===========================
   ХЕДЕР
=========================== */
header.header {
  background-color: #fff;
  box-shadow: 0 4px 33px 0 rgba(0, 27, 72, 0.051);
  position: sticky;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 999;
  padding: 0;
}

header.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 40px;
}

/* Скрываем текст "Демо агрегатора" рядом с логотипом */
header .logo span {
  display: none;
}

header .logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

header .logo img {
  max-height: 44px;
  width: auto;
}

/* Меню — flex с gap как в оригинале */
header .menu {
  flex: 1;
}

header .menu ul,
.menu ul {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu ul li {
  margin-left: 30px;
  position: relative;
  padding-top: 5px;
  padding-bottom: 5px;
}

.menu ul li a {
  font-size: 14px;
  color: var(--dark);
  text-decoration: none;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.menu ul li a:hover {
  color: var(--orange);
}

/* Стрелка у пунктов с подменю */
.menu ul li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  flex-shrink: 0;
  transition: transform 0.3s;
}

.menu ul li.menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

/* Подменю */
.menu ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  background: #ffffff;
  border-radius: 12px;
  display: block;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  z-index: -1;
  transition: all 0.25s ease;
  width: 240px;
  margin-top: 4px;
  border: 1px solid #f0f0f0;
}

.menu ul li:hover > ul {
  opacity: 1;
  z-index: 9999;
  visibility: visible;
}

/* Третий уровень — вправо */
.menu ul ul ul {
  left: 100%;
  top: 0;
  margin-top: 0;
}

.menu ul ul li {
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.menu ul ul li a {
  padding: 8px 16px;
  font-size: 14px;
  color: #333;
  display: block;
  white-space: normal;
  line-height: 1.4;
}

.menu ul ul li a:hover {
  background: #f9f5f0;
  color: var(--orange);
}

/* Последние 2 пункта — выпадение влево */
.menu ul > li:nth-last-child(-n+2) > ul {
  right: 0;
  left: auto;
}

/* Аватар/профиль справа */
.ava_menu {
  flex-shrink: 0;
}

.ava_menu .img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--orange);
}

.ava_menu .header-letter {
  font-weight: 700;
  font-size: 14px;
  color: var(--orange);
  text-transform: uppercase;
}

/* ===========================
   HERO / CAP
=========================== */
.cap {
  background: linear-gradient(135deg, #fff9f4 0%, #fff 100%);
  padding: 60px 0 50px;
  border-bottom: 1px solid #f0e8e0;
}

.cap .container {
  display: flex;
  align-items: center;
  gap: 40px;
}

.cap-left {
  flex: 1;
  max-width: 600px;
}

.main--header__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.main--header__tag {
  background: var(--orange-light);
  color: var(--orange);
  border: 1px solid #f5d0b0;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

.cap .h1 {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--dark);
}

.cap .text {
  font-size: 15px;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 520px;
}

/* Поисковая форма */
.cap-search-new .selects {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cap-search-new select,
.cap-search-new .select2-container {
  min-width: 220px;
  flex: 1;
}

.cap-search-new .select2-selection--single {
  height: 48px !important;
  border: 1.5px solid #ddd !important;
  border-radius: var(--radius) !important;
  padding: 0 16px !important;
  font-size: 15px;
  display: flex;
  align-items: center;
  background: var(--white) !important;
}

.cap-search-new .select2-selection__rendered {
  line-height: 48px !important;
  color: var(--dark) !important;
}

.cap-search-new .select2-selection__arrow {
  height: 48px !important;
  right: 12px !important;
}

/* Кнопки */
.btn_blue, .btn_orange, a.btn_blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: var(--white) !important;
  border: none;
  border-radius: var(--radius);
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn_blue:hover {
  background: #e07e30;
  transform: translateY(-1px);
}

.btn-o, a.btn-o {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--green) !important;
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-o:hover {
  background: var(--green);
  color: var(--white) !important;
}

.btn-white {
  background: var(--white);
  color: var(--dark) !important;
  border: 1.5px solid #ddd;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ===========================
   СЕКЦИЯ ПРОБЛЕМ (main--problemsSolve)
=========================== */
.main--problemsSolve {
  padding: 60px 0;
  background: var(--white);
}

.main--problemsSolve .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.main--problemsSolve__title {
  margin-bottom: 36px;
}

.main--problemsSolve__title .h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
}

.main--problemsSolve__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.main--problemsSolve__item {
  background: var(--white);
  border: 1.5px solid #eee;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.main--problemsSolve__item:hover {
  box-shadow: 0 8px 32px rgba(245,144,68,0.12);
  border-color: var(--orange);
  transform: translateY(-2px);
}

.main--problemsSolve__item-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.main--problemsSolve__item--icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--orange-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main--problemsSolve__item--icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.main--problemsSolve__item-top-text .h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.main--problemsSolve__item--text {
  font-size: 13px;
  color: var(--gray);
  font-style: italic;
  line-height: 1.4;
}

.main--problemsSolve__item--blocks {
  font-size: 13px;
  color: #444;
  line-height: 1.6;
}

.main--problemsSolve__item--blocks p {
  margin: 0 0 6px;
}

.main--problemsSolve__item--blocks p strong {
  color: var(--dark);
  font-weight: 600;
}

.main--problemsSolve__item--blocks ul {
  margin: 4px 0 8px 16px;
  padding: 0;
}

.main--problemsSolve__item--blocks ul li {
  margin-bottom: 3px;
  font-size: 12.5px;
}

.main--problemsSolve__item--link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

.main--problemsSolve__item--link svg {
  flex-shrink: 0;
}

/* ===========================
   СЕКЦИЯ ПРЕИМУЩЕСТВ (why)
=========================== */
.why.section {
  background: var(--green-light);
  padding: 60px 0;
}

.why .items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.why .item {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.why .item .img {
  margin-bottom: 16px;
}

.why .item .img img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 50%;
}

.why .item .title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.why .item .text {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

/* Счётчики */
.why .stat-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.why .stat-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
}

.why .stat-item .num {
  font-size: 32px;
  font-weight: 800;
  color: var(--orange);
  display: block;
}

.why .stat-item .label {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.4;
}

/* ===========================
   ОТЗЫВЫ
=========================== */
.reviews-container, .section .reviews-wrap {
  padding: 60px 0;
  background: var(--white);
}

.reviews-wrap .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.item[itemprop="itemListElement"] {
  background: var(--white);
  border: 1.5px solid #eee;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item .user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--orange-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.first_letter.comment-letter {
  font-weight: 700;
  font-size: 18px;
  color: var(--orange);
  text-transform: uppercase;
}

.item .name {
  font-weight: 600;
  font-size: 15px;
}

.item .stars .mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--orange);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.item .date {
  font-size: 12px;
  color: var(--gray);
}

.item .text[itemprop="reviewBody"] {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  flex: 1;
}

.item .doctor {
  font-size: 13px;
  color: var(--gray);
}

.item .doctor a {
  color: var(--green);
  text-decoration: underline;
}

/* ===========================
   СТАТЬИ
=========================== */
.articles-home.section {
  padding: 60px 0;
  background: var(--gray-light);
}

.articles-home .h2-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.articles-home .count-rev {
  font-size: 14px;
  color: var(--gray);
  font-weight: 400;
}

.articles-home .count-rev a {
  color: var(--orange);
  text-decoration: none;
}

.slider-articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.slider-articles .item.top-item {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  transition: box-shadow 0.2s;
}

.slider-articles .item.top-item:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.slider-articles .top-img {
  position: relative;
  overflow: hidden;
  height: 180px;
}

.slider-articles .top-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.slider-articles .item:hover .top-img img {
  transform: scale(1.04);
}

.slider-articles .categories.labels {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  gap: 4px;
}

.slider-articles .categories.labels a {
  background: rgba(255,255,255,0.9);
  color: var(--dark);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}

.slider-articles a.title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  text-decoration: none;
  padding: 16px 16px 8px;
  display: block;
  line-height: 1.4;
}

.slider-articles a.title:hover {
  color: var(--orange);
}

.slider-articles .text {
  font-size: 13px;
  color: var(--gray);
  padding: 0 16px 12px;
  line-height: 1.6;
}

.slider-articles .btn-o {
  margin: auto 16px 16px;
}

/* ===========================
   ЭКСТРЕННАЯ ПОМОЩЬ
=========================== */
.footer-sos_outer {
  background: #1e2a3a;
  padding: 48px 0;
}

.footer-sos {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-sos_top {
  text-align: center;
  margin-bottom: 36px;
}

.footer-sos_h2-title {
  color: var(--white) !important;
  font-size: 26px;
  margin-bottom: 12px;
}

.footer-sos_description {
  color: rgba(255,255,255,0.7);
  font-size: 15px;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer-sos_wrapper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.footer-sos_wrapper_item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.footer-sos_wrapper_item_tel {
  display: block;
  color: var(--orange) !important;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 8px;
}

.footer-sos_wrapper_item_tel:hover {
  color: #ffb07a !important;
}

.footer-sos_wrapper_item_description {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

/* ===========================
   ФУТЕР
=========================== */
footer {
  background: #f9f9f9;
  border-top: 1px solid #eee;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

footer .title-footer {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer ul li {
  margin-bottom: 8px;
}

footer ul li a {
  font-size: 14px;
  color: var(--gray);
  text-decoration: none;
  transition: color 0.2s;
}

footer ul li a:hover {
  color: var(--orange);
}

footer .footer_soc_media_wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray);
  margin-top: 16px;
  flex-wrap: wrap;
}

footer .footer_soc_media_wrapper img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

footer .copy {
  color: var(--gray);
  font-size: 13px;
}

/* ===========================
   АДАПТИВ
=========================== */
@media (max-width: 1024px) {
  .main--problemsSolve__list {
    grid-template-columns: repeat(2, 1fr);
  }
  .slider-articles {
    grid-template-columns: repeat(2, 1fr);
  }
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-sos_wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cap .h1 { font-size: 26px; }
  .cap .container { flex-direction: column; }
  .main--problemsSolve__list { grid-template-columns: 1fr; }
  .why .items { grid-template-columns: 1fr; }
  .slider-articles { grid-template-columns: 1fr; }
  .reviews-grid { grid-template-columns: 1fr; }
  .footer-sos_wrapper { grid-template-columns: 1fr; }
  footer .container { flex-direction: column; }
  .h2-title, h2.title { font-size: 22px; }
}
