/**
 * Embed шорткода [atsp_search] на сторінках Elementor / теми.
 * Нейтралізує глобальні стилі Kit і відновлює вигляд як на /poshuk-pro/.
 */

/* ── Базова ізоляція ── */
.atsp-embed-root.atsp-scope {
  font-family: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #12213a;
  line-height: 1.4;
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
}

.atsp-embed-root.atsp-scope *,
.atsp-embed-root.atsp-scope *::before,
.atsp-embed-root.atsp-scope *::after {
  box-sizing: border-box;
}

.atsp-embed-root .proto-hero--embed {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  background: transparent !important;
}

.atsp-embed-root .proto-hero--embed .proto-page,
.atsp-embed-root .proto-hero--embed .hero-stage,
.atsp-embed-root .proto-hero--embed .hero-layout {
  max-width: none;
  padding: 0;
  margin: 0;
  min-height: 0 !important;
  height: auto !important;
}

/* Elementor: overflow щоб панелі не обрізались */
.elementor-widget-shortcode:has(.atsp-embed-root),
.elementor-element:has(.atsp-embed-root),
.elementor-widget-shortcode:has(.atsp-embed-root) .elementor-widget-container,
.elementor-element:has(.atsp-embed-root) .e-con-inner {
  overflow: visible !important;
}

/* ── Контейнер віджета ── */
.atsp-embed-root .atsp-embed-widget {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.atsp-embed-root .atsp-embed-widget .hero-stage,
.atsp-embed-root .atsp-embed-widget .hero-layout {
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
}

.atsp-embed-root .atsp-embed-widget .hero-search-card,
.atsp-embed-root .atsp-embed-widget .hero-search-card--catalog,
.atsp-embed-root .atsp-embed-widget .hero-catalog-form,
.atsp-embed-root .atsp-embed-widget #popular-search-form {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

.atsp-embed-root .atsp-embed-widget .ps-hidden-fields {
  display: none !important;
}

/* ── Головний бар ── */
.atsp-embed-root .atsp-embed-widget .anex-search-bar {
  display: flex !important;
  align-items: stretch !important;
  min-height: 68px;
  background: #fff !important;
  box-shadow: 0 12px 40px rgba(7, 19, 42, 0.18) !important;
  border-radius: 14px !important;
  overflow: hidden;
  width: 100%;
}

/* ── Поле країни (input, не кнопка) ── */
.atsp-embed-root .atsp-embed-widget .anex-search-segment--country-edit {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 18px;
  border: 0;
  border-right: 1px solid #e8ecf2;
  background: transparent;
  min-width: 0;
}

.atsp-embed-root .atsp-embed-widget .anex-segment-input,
.atsp-embed-root .atsp-embed-widget input.anex-segment-input,
.elementor-kit-5 .atsp-embed-root .anex-segment-input,
[class*="elementor-kit-"] .atsp-embed-root .anex-segment-input {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: #1a2233 !important;
  -webkit-text-fill-color: #1a2233 !important;
  appearance: none;
  border-radius: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}

.atsp-embed-root .atsp-embed-widget .anex-segment-input::placeholder {
  color: #9aa3b5 !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

/* ── Elementor Kit: скидання всіх button у віджеті ── */
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget button,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget button:hover,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget button:focus,
[class*="elementor-kit-"] .atsp-embed-root .atsp-embed-widget button {
  background-image: none !important;
  text-decoration: none !important;
  transform: none !important;
}

/* Сегменти пошуку */
.atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment,
.atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment:visited,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment:hover,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment:focus {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #1a2233 !important;
  -webkit-text-fill-color: #1a2233 !important;
  border: 0 !important;
  border-right: 1px solid #e8ecf2 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  opacity: 1 !important;
  padding: 12px 18px !important;
  min-height: 0 !important;
  height: auto !important;
  align-self: stretch !important;
}

.atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment:hover,
.atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment.is-open,
.atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment:focus,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment:hover,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-bar button.anex-search-segment.is-open {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  color: #1a2233 !important;
}

.atsp-embed-root .atsp-embed-widget .anex-segment-label {
  color: #8b95a8 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

.atsp-embed-root .atsp-embed-widget .anex-segment-value {
  color: #1a2233 !important;
  -webkit-text-fill-color: #1a2233 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

.atsp-embed-root .atsp-embed-widget .anex-segment-value.is-placeholder {
  color: #9aa3b5 !important;
  -webkit-text-fill-color: #9aa3b5 !important;
  font-weight: 600 !important;
}

/* «Шукати» */
.atsp-embed-root .atsp-embed-widget .anex-search-bar .ps-submit,
.atsp-embed-root .atsp-embed-widget .anex-search-bar .ps-submit:hover,
.atsp-embed-root .atsp-embed-widget .anex-search-bar .ps-submit:focus,
.atsp-embed-root .atsp-embed-widget .anex-search-bar .ps-submit:active,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget button.ps-submit,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget button.ps-submit:hover,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget button.ps-submit:focus {
  background: #f31624 !important;
  background-color: #f31624 !important;
  background-image: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border: 0 !important;
  border-radius: 0 14px 14px 0 !important;
  box-shadow: none !important;
  transform: none !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  min-width: 132px !important;
  padding: 0 28px !important;
  align-self: stretch !important;
}

.atsp-embed-root .atsp-embed-widget .anex-search-bar .ps-submit:hover {
  background: #de0f1c !important;
  background-color: #de0f1c !important;
}

/* Таби «Пляжні / Екскурсійні» */
.atsp-embed-root .atsp-embed-widget .anex-search-mode-btn,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-mode-btn {
  color: #1a2233 !important;
  background: #fff !important;
  background-color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
}

.atsp-embed-root .atsp-embed-widget .anex-search-mode-btn.is-active,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-mode-btn.is-active {
  color: #f31624 !important;
  border: 2px solid #f31624 !important;
  padding: 9px 17px !important;
}

.atsp-embed-root .atsp-embed-widget .anex-search-mode-btn:hover,
.atsp-embed-root .atsp-embed-widget .anex-search-mode-btn:focus,
.elementor-kit-5 .atsp-embed-root .atsp-embed-widget .anex-search-mode-btn:hover {
  color: #f31624 !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12) !important;
}

/* Панелі в body (portal) — поверх Elementor */
body > .anex-panel-portal.anex-panel-backdrop:not([hidden]) {
  z-index: 99998 !important;
}

body > .anex-panel-portal.anex-panel:not([hidden]) {
  z-index: 99999 !important;
}

/* Мобільна кнопка — тільки на мобільному */
@media (min-width: 769px) {
  .atsp-embed-root .atsp-embed-widget .ps-submit--mobile {
    display: none !important;
  }

  .atsp-embed-root .atsp-embed-widget .anex-search-segment--country-btn {
    display: none !important;
  }

  .atsp-embed-root .atsp-embed-widget .anex-search-segment--country-edit {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .atsp-embed-root .atsp-embed-widget .anex-search-bar .ps-submit {
    display: none !important;
  }

  .atsp-embed-root .atsp-embed-widget .ps-submit--mobile {
    display: flex !important;
    width: 100%;
    margin-top: 12px;
    border-radius: 14px !important;
    min-height: 52px;
    background: #f31624 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
}
