/* =============================================================
   CarbonFin — komponent stillari (look main.css dan keladi)
   Bu yerda faqat SAQLANADIGAN funksiyalar: server-qidiruv
   dropdown'i + kontakt/auth forma + intl-tel-input.
   Hammasi CarbonFin :root o'zgaruvchilari orqali marun rangga
   bo'ysunadi.
   ============================================================= */

/* CarbonFin palitrasiga moslovchi qo'shimcha o'zgaruvchilar
   (ko'chirilgan shablon stillari --accent / --soft-2 ishlatadi) */
:root {
  --accent: var(--primary-bright, #9e1f29);
  --soft-2: var(--soft, #f5eceb);
}

/* ---- WP admin-bar bilan fixed topnav mos kelishi (bo'sh joy muammosi) ---- */
/* WP kirgan foydalanuvchiga html margin-top:32px qo'shadi, fixed .g7-topnav
   esa top:0 da qolib admin-bar ostida bo'sh joy hosil qiladi. Offset beramiz. */
body.admin-bar .g7-topnav {
  top: 32px;
}
body.admin-bar .site-header {
  top: 72px;
}
body.admin-bar .g7-panel {
  top: 72px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .g7-topnav {
    top: 46px;
  }
  body.admin-bar .site-header {
    top: 86px;
  }
  body.admin-bar .g7-panel {
    top: 86px;
  }
}

/* ---- Input fokus (forma) ---- */
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
}
textarea {
  font-family: inherit;
}

/* ---- intl-tel-input (telefon maydoni) ---- */
.iti {
  width: 100%;
}
.iti__flag {
  background-image: image-set('../intl-tel-input/img/flags.webp' 1x, '../intl-tel-input/img/flags@2x.webp' 2x);
}
.iti__search-input {
  margin: 0 !important;
  padding-left: 34px !important;
}

/* =============================================================
   SERVER-QIDIRUV DROPDOWN (search.js yaratadi: .search-results)
   ============================================================= */
.sr-only {
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  position: absolute !important;
  overflow: hidden !important;
}
.search-results {
  width: min(440px, calc(100vw - 24px));
  color: var(--ink, #321015);
  background: #fff;
  border: 1px solid rgba(74, 15, 22, 0.09);
  border-radius: 14px;
  padding: 12px 12px 8px;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 60px rgba(50, 16, 21, 0.20);
  z-index: 300;
}
/* Нос (стрелка вверх) */
.search-results::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 3px;
  border-left: 1px solid rgba(74, 15, 22, 0.09);
  border-top: 1px solid rgba(74, 15, 22, 0.09);
}
.search-results-head {
  color: var(--muted, #785e61);
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 10px;
  display: flex;
}
.search-results-head > span {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  font-size: 11px;
}
.search-results-head small {
  color: var(--muted, #785e61);
  font-size: 11px;
}

/* Карточка результата (светло-розовая) */
.search-results > a {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #faf0ef;
  border: 1px solid rgba(158, 31, 41, 0.10);
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.search-results > a:hover,
.search-results > a.active {
  background: #f6e1df;
  border-color: rgba(158, 31, 41, 0.28);
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.search-result-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(158, 31, 41, 0.12);
  color: var(--primary-bright, #9e1f29);
  display: grid;
  place-items: center;
}
.search-result-icon .sc-icon {
  width: 20px;
  height: 20px;
  display: block;
}
.search-result-icon svg {
  width: 20px;
  height: 20px;
}
.search-result-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.search-result-body b {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink, #321015);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-body small {
  color: var(--primary-bright, #9e1f29);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  font-weight: 700;
}
.search-result-body em {
  color: var(--muted, #785e61);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result > i {
  font-size: 18px;
  font-style: normal;
  color: var(--primary-bright, #9e1f29);
  flex: 0 0 auto;
  transition: transform 0.15s;
}
.search-results > a:hover > i,
.search-results > a.active > i {
  transform: translateX(3px);
}
.search-results mark {
  background: transparent;
  color: var(--primary-bright, #9e1f29);
  padding: 0;
  font-weight: 700;
}
.search-empty {
  border-top: 1px solid var(--line, #4a0f1629);
  gap: 4px;
  padding: 14px 10px;
  display: grid;
}
.search-empty b {
  font-size: 13px;
}
.search-empty span {
  color: var(--muted, #785e61);
  font-size: 12px;
}
.search-empty > i {
  border: 2px solid var(--line, #4a0f1629);
  border-top-color: var(--primary, #6b0b12);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  margin-bottom: 3px;
  animation: search-spin 0.7s linear infinite;
}
.search-error b {
  color: #a33b35;
}
@keyframes search-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Нижняя подсказка с кнопками-клавишами */
.search-help {
  color: var(--muted, #785e61);
  border-top: 1px solid rgba(74, 15, 22, 0.07);
  gap: 18px;
  padding: 10px 4px 2px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  font-size: 11px;
}
.search-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.search-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f3efee;
  border: 1px solid rgba(74, 15, 22, 0.12);
  box-shadow: 0 1px 0 rgba(74, 15, 22, 0.10);
  font-family: inherit;
  font-size: 10px;
  font-weight: 650;
  color: var(--ink, #321015);
  line-height: 1;
}

@media (max-width: 1180px) {
  /* header-tools (desktop search) скрыт <=1180px — dropdown живёт внутри mobile-menu.
     Остаётся absolute под полем ввода (не оверлей поверх хедера) и выравнивается
     по всей ширине поля. */
  .mobile-menu .smart-search {
    width: 100%;
  }
  .search-results {
    width: auto;
    left: 0;
    right: 0;
    transform: none;
    max-height: calc(100vh - 120px);
    top: calc(100% + 8px);
  }
  .search-results::before {
    display: none;
  }
  .search-result-body b,
  .search-result-body em {
    white-space: normal;
  }
}

/* =============================================================
   KONTAKT / AUTH FORMA (.form -> form.js -> Bitrix24)
   ============================================================= */
.access-section {
  background: var(--paper, #fffdf9);
  grid-template-columns: 1fr 0.85fr;
  align-items: start;
  gap: 64px;
  display: grid;
  max-width: var(--max, 1360px);
  margin: auto;
  padding: 90px 30px;
}
.access-copy .section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-bright, #9e1f29);
  font-size: 13px;
  font-weight: 700;
}
.access-copy__title {
  letter-spacing: -0.03em;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin: 18px 0 0;
  color: var(--ink, #321015);
}
.access-copy__description {
  color: var(--muted, #785e61);
  font-size: 16px;
  line-height: 1.7;
  max-width: 590px;
  margin: 22px 0 0;
}

.contact-card {
  background: var(--soft-2, #f5eceb);
  border-top: 4px solid var(--primary, #6b0b12);
  box-shadow: 0 20px 60px rgba(107, 11, 18, 0.13);
  align-items: center;
  min-height: 470px;
  padding: 38px;
  border-radius: 14px;
  display: flex;
}
.contact-card form {
  width: 100%;
}
.form-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary-bright, #9e1f29);
  font-size: 10px;
  font-weight: 700;
}
.contact-card h3 {
  margin: 12px 0 8px;
  font-size: 25px;
  color: var(--ink, #321015);
}
.contact-card form > p {
  color: var(--muted, #785e61);
  font-size: 13px;
  margin: 0 0 25px;
}
.contact-card label {
  margin: 0 0 17px;
  font-size: 12px;
  font-weight: 700;
  display: block;
  color: var(--ink, #321015);
}
.contact-card input:not([type="hidden"]),
.contact-card textarea {
  border: 1px solid rgba(107, 11, 18, 0.25);
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  display: block;
  color: var(--ink, #321015);
  background: #fff;
  border-radius: 6px;
  outline: none;
  padding: 14px;
  font-weight: 400;
}
.contact-card input:not([type="hidden"]):focus,
.contact-card textarea:focus {
  border-color: var(--primary, #6b0b12);
  box-shadow: 0 0 0 3px rgba(107, 11, 18, 0.12);
}
.contact-card textarea {
  min-height: 120px;
  resize: vertical;
  font: inherit;
}
.form-submit {
  background: var(--primary, #6b0b12);
  color: #fff;
  cursor: pointer;
  border: 0;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 8px;
  padding: 15px 18px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  transition: background 0.2s, transform 0.2s;
}
.form-submit:hover,
.form-submit:focus-visible {
  background: var(--primary-bright, #9e1f29);
}
.form-submit[disabled] {
  opacity: 0.6;
  cursor: default;
}
.form__message {
  min-height: 18px;
  margin-top: 13px;
  color: var(--ink, #321015);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .access-section {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 64px 24px;
  }
  .contact-card {
    padding: 26px;
    min-height: 0;
  }
}
