/* CRO v2.3 base styles for tolkmaster.ru */

/* 1. Safe overflow & layout guards */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.main_body {
  max-width: 100%;
  overflow-x: hidden;
}

/* 2. Safe reCAPTCHA badge hiding (never display: none) */
.grecaptcha-badge {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.cro-recaptcha-legal {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  line-height: 1.45;
  color: #b4c0ce;
  text-align: center;
}

.cro-recaptcha-legal a {
  color: #dce7f5;
  text-decoration: underline;
}

/* 3. Header search & responsive adjustments */
header.tm-header {
  height: auto;
}

.tm-header__search {
  background: #1f538f;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 0;
}

.tm-search-form {
  position: relative;
  display: flex;
  align-items: stretch;
  max-width: 620px;
  margin: 0 auto;
}

@media (min-width: 993px) {
  .tm-header .tm-header__wrapper {
    min-height: 79px;
  }
}

@media (min-width: 993px) and (max-width: 1200px) {
  .tm-search-form {
    max-width: 470px;
    margin: 0 240px 0 auto;
  }
}

@media (min-width: 1201px) {
  .tm-search-form {
    max-width: 550px;
    margin: 0 305px 0 auto;
  }
}

.tm-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 6px 12px;
  border: 1px solid #d0d9e3;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  background: #ffffff;
  color: #222222;
  font-size: 14px;
  outline: none;
}

.tm-search-input:focus {
  border-color: #f28034;
}

.tm-search-btn {
  flex: 0 0 44px;
  height: 36px;
  border: 0;
  border-radius: 0 4px 4px 0;
  background: #f28034;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
}

.tm-search-btn:hover {
  background: #dc6d23;
}

.tm-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 90;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #d0d9e3;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(17, 36, 58, 0.16);
  max-height: 340px;
  overflow-y: auto;
  text-align: left;
}

.tm-search-dropdown[hidden] {
  display: none !important;
}

.tm-search-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f6;
  color: #1f2933;
  font-size: 13.5px;
  text-decoration: none;
}

.tm-search-dropdown__item:last-child {
  border-bottom: 0;
}

.tm-search-dropdown__item:hover {
  background: #f2f7fc;
  text-decoration: none;
}

.tm-search-dropdown__type {
  flex-shrink: 0;
  font-size: 11px;
  color: #2c72c3;
  background: #eaf2fb;
  padding: 2px 7px;
  border-radius: 3px;
}

/* 4. Static Hero (CRO v2.3, autoplay: false) */
.cro-hero {
  background: linear-gradient(135deg, #1b385c 0%, #2c72c3 100%);
  color: #ffffff;
  padding: 28px 0;
  border-bottom: 4px solid #f28034;
}

.cro-hero__grid {
  display: flex;
  align-items: center;
  gap: 24px;
}

.cro-hero__content {
  flex: 1 1 58%;
  min-width: 0;
}

.cro-hero__eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cro-hero__title {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  color: #ffffff;
}

.cro-hero__lead {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: #eef4fb;
}

.cro-hero__bullets {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

.cro-hero__bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #ffffff;
}

.cro-hero__bullets li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #ffb84d;
  font-weight: 700;
}

.cro-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.cro-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 4px;
  background: #f28034;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.cro-hero__btn:hover {
  background: #dc6d23;
}

.cro-hero__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.cro-hero__link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-decoration: none;
}

.cro-hero__media {
  flex: 0 0 38%;
  max-width: 420px;
}

.cro-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

/* 5. Sidebar tidy paddings (18-24px => 20px) and clean image fit */
aside #container #text-4,
aside #container #text-6 {
  padding: 20px !important;
  box-sizing: border-box;
  background: #ffffff !important;
  border-top: 4px solid #2c72c3;
  border-right: 3px solid #cfcfcf;
  border-bottom: 2px solid #cfcfcf;
}

aside #container #text-4 .widget-title,
aside #container #text-6 .widget-title {
  color: #1b2f46 !important;
  padding: 0 0 14px 0 !important;
  font-weight: 700;
  border-bottom: 1px solid #e6ebf1;
  margin-bottom: 16px;
}

aside #container #text-5 img,
aside #container #text-7 img {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

aside #container .widget_nav_menu {
  margin-top: 20px !important;
  margin-bottom: 0 !important;
}

/* Hide legacy misleading 5%-discount sidebar image; show clean service card via CSS if kept */
aside #container #text-7 {
  margin: 20px 0 0 0 !important;
  padding: 20px !important;
  background: #ffffff;
  border-right: 3px solid #cfcfcf;
  border-bottom: 2px solid #cfcfcf;
}

/* 6. UTP block (Thesis + It means...) */
.cro-utp {
  margin: 18px 0 24px;
}

.cro-utp__box {
  background: #f5f9ff;
  border: 1px solid #d4e3f6;
  border-left: 4px solid #2c72c3;
  border-radius: 4px;
  padding: 18px 20px;
}

.cro-utp__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1b2f46;
}

.cro-utp__list {
  margin: 0;
  padding: 0;
  list-style: none !important;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

article #content .cro-utp__list {
  list-style: none !important;
  list-style-image: none !important;
  margin: 0 !important;
}

.cro-utp__list li {
  background: #ffffff;
  border: 1px solid #e2eaf4;
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.48;
  color: #333b44;
}

.cro-utp__list li strong {
  display: block;
  margin-bottom: 4px;
  color: #1b2f46;
}

/* 7. Deterministic FAQ Accordion */
.cro-faq {
  margin: 24px 0;
  background: #ffffff;
  border: 1px solid #e1e6ec;
  border-radius: 4px;
  padding: 20px;
}

.cro-faq__heading {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: #1b2f46;
}

.cro-faq__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cro-faq__item {
  border: 1px solid #dce3ec;
  border-radius: 4px;
  overflow: hidden;
  background: #fafcff;
}

.cro-faq__qwrap {
  margin: 0;
}

.cro-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  background: #ffffff;
  color: #1b2f46;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.cro-faq__question[aria-expanded="true"] {
  background: #eef5fd;
  color: #144a8a;
}

.cro-faq__icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  position: relative;
}

.cro-faq__icon::before,
.cro-faq__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: #2c72c3;
  transform: translate(-50%, -50%);
}

.cro-faq__icon::before {
  width: 12px;
  height: 2px;
}

.cro-faq__icon::after {
  width: 2px;
  height: 12px;
  transition: opacity 0.15s ease;
}

.cro-faq__question[aria-expanded="true"] .cro-faq__icon::after {
  opacity: 0;
}

.cro-faq__answer[hidden] {
  display: none !important;
}

.cro-faq__answer-inner {
  padding: 12px 16px 14px;
  border-top: 1px solid #e4ebf2;
  background: #ffffff;
  font-size: 14.5px;
  line-height: 1.55;
  color: #3f4750;
}

.cro-faq__answer-inner p:last-child {
  margin-bottom: 0;
}

/* 8. Eternal Reviews Carousel (no autoplay, platform tabs, <= 768px card accordion) */
.cro-reviews {
  margin: 26px 0;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e1e6ec;
  border-radius: 4px;
}

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

.cro-reviews__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1b2f46;
}

.cro-reviews__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cro-reviews__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cro-reviews__tab {
  padding: 6px 11px;
  border: 1px solid #d0dbe7;
  border-radius: 4px;
  background: #f6f9fc;
  color: #2c4057;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cro-reviews__tab.is-active {
  background: #2c72c3;
  border-color: #2c72c3;
  color: #ffffff;
}

.cro-reviews__nav {
  display: flex;
  gap: 6px;
}

.cro-reviews__arrow {
  width: 34px;
  height: 34px;
  border: 1px solid #d0dbe7;
  border-radius: 4px;
  background: #ffffff;
  color: #1b2f46;
  font-size: 16px;
  cursor: pointer;
}

.cro-reviews__arrow:hover {
  background: #eef5fd;
}

.cro-reviews__viewport {
  overflow: hidden;
  width: 100%;
}

.cro-reviews__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc(50% - 8px);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 6px;
}

.cro-review-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: #f9fbfe;
  border: 1px solid #dce5f0;
  border-radius: 6px;
  padding: 15px;
  box-sizing: border-box;
}

.cro-review-card[hidden] {
  display: none !important;
}

.cro-review-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cro-review-card__avatar {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2c72c3;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cro-review-card__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.cro-review-card__author {
  font-size: 14.5px;
  font-weight: 700;
  color: #1b2f46;
}

.cro-review-card__sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #667483;
}

.cro-review-card__badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

.cro-review-card__badge--yandex {
  background: #e13b2d;
}

.cro-review-card__badge--google {
  background: #2c72c3;
}

.cro-review-card__badge--twogis {
  background: #2e8f48;
}

.cro-review-card__stars {
  color: #f59e0b;
  font-size: 14px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.cro-review-card__full-desktop {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #36414d;
  text-align: left !important;
}

.cro-review-card__preview,
.cro-review-card__toggle,
.cro-review-card__accordion {
  display: none;
}

/* 9. Advantage cards ("Thesis + It means...") */
.advantage .advantage_content > div.cro-adv-card {
  padding-top: 20px !important;
  padding-bottom: 20px;
  background-image: none !important;
}

.cro-adv-card__inner {
  background: #ffffff;
  border: 1px solid #dce4ee;
  border-top: 3px solid #f28034;
  border-radius: 4px;
  padding: 18px 16px;
  height: 100%;
}

.cro-adv-card__inner label {
  margin-bottom: 8px !important;
}

.cro-adv-card__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.48;
  color: #46505a;
}

/* 10. Search & Sitemap pages */
.cro-search-page__form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.cro-search-page__btn {
  flex-shrink: 0;
  padding: 0 22px;
  height: 36px;
  border: 0;
  border-radius: 4px;
  background: #f28034;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.cro-sitemap__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.cro-sitemap__tags a {
  display: inline-block;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #d5dfe9;
  border-radius: 3px;
  color: #1f538f;
  font-size: 13px;
}

/* 11. Tables & Catalog overflow fixes */
table.price_table {
  width: 100%;
  table-layout: fixed;
}

table.price_table td {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

table.price_table tbody tr td:nth-child(even) {
  width: 140px;
}

.catalog-cats-list .catalog-cats .cattitle:after {
  display: none;
}

.cro-pagination {
  margin: 20px 0;
  text-align: center;
}

.masters-slider .slide img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* 12. Modal isolation & floating buttons safety */
.cro-modal-open .fixed-phone,
.cro-modal-open .button-up {
  display: none !important;
}

/* 13. Mobile rules <= 768px & <= 992px */
@media (max-width: 992px) {
  .cro-hero__grid {
    flex-direction: column;
    align-items: stretch;
  }

  .cro-hero__media {
    max-width: 100%;
  }

  .cro-utp__list {
    grid-template-columns: 1fr;
  }

  .tm-header #menu-top-menu {
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .cro-hero {
    padding: 20px 0;
  }

  .cro-hero__title {
    font-size: 21px;
  }

  .cro-hero__bullets {
    grid-template-columns: 1fr;
  }

  .cro-hero__media {
    display: none;
  }

  /* Required FAQ mobile typography */
  .cro-faq__question {
    font-size: 15.5px !important;
    line-height: 1.4;
    padding: 13px 14px;
  }

  .cro-faq__answer,
  .cro-faq__answer-inner,
  .cro-faq__answer p {
    font-size: 14.5px !important;
    line-height: 1.5;
  }

  /* Mobile reviews accordion strictly inside clicked card (<= 768px) */
  .cro-reviews {
    padding: 16px;
  }

  .cro-reviews__nav {
    display: none;
  }

  .cro-reviews__track {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .cro-review-card__full-desktop {
    display: none;
  }

  .cro-review-card__preview {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
    color: #36414d;
    text-align: left !important;
  }

  .cro-review-card__toggle {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 6px 12px;
    border: 1px solid #2c72c3;
    border-radius: 4px;
    background: #ffffff;
    color: #2c72c3;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
  }

  .cro-review-card__toggle[aria-expanded="true"] {
    background: #2c72c3;
    color: #ffffff;
  }

  .cro-review-card__accordion {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dce5f0;
    font-size: 14.5px;
    line-height: 1.5;
    color: #24303c;
  }

  .cro-review-card__accordion[hidden] {
    display: none !important;
  }

  .cro-review-card__accordion p {
    margin: 0;
    text-align: left !important;
  }

  /* Prevent fixed-phone / button-up from overlapping footer or page buttons */
  footer {
    padding-bottom: 84px !important;
  }

  table.price_table tbody tr td:nth-child(even) {
    width: 112px !important;
  }

  .catalog-cats-list .catalog-cats .cattitle {
    padding-left: 10px;
    padding-right: 10px;
  }
}
