/* Webhely segítő (chat) + globális kereső — magas z-index, VTB akcent */

:root {
  --z-site-search: 11500;
  --z-chat-widget: 12000;
}

/* Kereső: natív „X” eltüntetése (WebKit) */
input.hero-search__input::-webkit-search-cancel-button,
input.hero-search__input::-webkit-search-decoration,
.site-search__input::-webkit-search-cancel-button,
.site-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

input[type="search"].hero-search__input {
  appearance: none;
}

/* --- Globális kereső overlay --- */
.site-search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-site-search);
  background: rgba(10, 41, 115, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.site-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.site-search-overlay__panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  max-height: min(90vh, 560px);
  background: #fff;
  border-radius: 0 0 var(--radius-lg, 16px) var(--radius-lg, 16px);
  box-shadow: 0 16px 48px rgba(10, 41, 115, 0.2);
  transform: translateY(-12px);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-search-overlay.is-open .site-search-overlay__panel {
  transform: translateY(0);
  opacity: 1;
}

.site-search-overlay__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--color-border, #dce3eb);
  background: linear-gradient(180deg, #f4f7fb 0%, #fff 100%);
}

.site-search-overlay__head label {
  flex: 1;
  margin: 0;
}

.site-search__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--color-border, #dce3eb);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  transition: border-color 0.2s ease;
}

.site-search__input:focus {
  border-color: var(--color-accent, #009fdf);
  outline: none;
}

.site-search-overlay__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--color-accent-soft, #e5f5fc);
  color: var(--color-primary, #0a2973);
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.site-search-overlay__close:hover {
  background: #d0ebf7;
}

.site-search-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  min-height: 120px;
}

.site-search__hint {
  padding: 12px 20px;
  font-size: 0.875rem;
  color: var(--color-text-muted, #5a6572);
}

.site-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-search__item {
  margin: 0;
}

.site-search__link {
  display: block;
  padding: 12px 20px;
  color: var(--color-primary, #0a2973);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  border-left: 3px solid transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.site-search__link:hover,
.site-search__link:focus-visible {
  background: var(--color-accent-soft, #e5f5fc);
  border-left-color: var(--color-accent, #009fdf);
}

.site-search__meta {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-muted, #5a6572);
  margin-top: 4px;
}

.site-search__fallback-title {
  padding: 8px 20px 4px;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #5a6572);
}

.site-search__empty {
  padding: 16px 20px;
  font-size: 0.9375rem;
  color: var(--color-text-muted, #5a6572);
}

/* Hero sor: javaslatok a mező alatt */
.hero-search__input-wrap {
  position: relative;
}

.hero-site-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: calc(var(--z-site-search) - 1);
  background: #fff;
  border: 1px solid var(--color-border, #dce3eb);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 12px 32px rgba(10, 41, 115, 0.12);
  max-height: 280px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s;
}

.hero-site-search-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 8px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm, 8px);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.header__search-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 1024px) {
  .header__search-btn {
    display: none;
  }
}

/* --- Chat widget --- */
.chat-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--z-chat-widget);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  --chat-accent: var(--color-accent, #009fdf);
  --chat-primary: var(--color-primary, #0a2973);
}

.chat-widget__fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    var(--chat-accent) 0%,
    var(--chat-primary) 100%
  );
  color: #fff;
  box-shadow: 0 8px 28px rgba(10, 41, 115, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  z-index: 1;
}

.chat-widget__fab:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 32px rgba(10, 41, 115, 0.4);
}

.chat-widget__fab svg {
  width: 26px;
  height: 26px;
}

.chat-widget__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(100vw - 32px, 380px);
  max-height: min(100dvh - 100px, 520px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(10, 41, 115, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0.32s;
}

.chat-widget__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(
    135deg,
    var(--chat-accent) 0%,
    var(--chat-primary) 100%
  );
  color: #fff;
}

.chat-widget__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.chat-widget__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-widget__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 200px;
  max-height: 320px;
  background: #f4f7fb;
  display: flex;
  flex-direction: column;
}

.chat-widget__msg {
  max-width: 88%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9375rem;
  word-break: break-word;
}

.chat-widget__msg--user {
  margin-left: auto;
  background: linear-gradient(135deg, #009fdf 0%, #0a2973 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-widget__msg--bot {
  margin-right: auto;
  background: #fff;
  color: var(--color-text, #1c2430);
  border: 1px solid var(--color-border, #dce3eb);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(10, 41, 115, 0.06));
}

.chat-widget__msg--bot a {
  color: var(--chat-accent);
  font-weight: 600;
  text-decoration: underline;
}

.chat-widget__typing {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  max-width: 72px;
  background: #fff;
  border: 1px solid var(--color-border, #dce3eb);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  margin-bottom: 12px;
  order: 999;
}

.chat-widget__typing.is-visible {
  display: inline-flex;
}

.chat-widget__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chat-accent);
  animation: chat-typing 1.2s ease-in-out infinite;
}

.chat-widget__typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-widget__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chat-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-widget__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--color-border, #dce3eb);
  background: #fff;
}

.chat-widget__input {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid var(--color-border, #dce3eb);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
}

.chat-widget__input:focus {
  border-color: var(--chat-accent);
  outline: none;
}

.chat-widget__send {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--chat-accent) 0%,
    var(--chat-primary) 100%
  );
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chat-widget__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 1023px) {
  .chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .chat-widget__panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 80px;
    top: auto;
    width: auto;
    max-height: calc(100dvh - 96px);
    transform-origin: bottom center;
  }

  .chat-widget__panel.is-open {
    transform: translateY(0) scale(1);
  }

  .chat-widget__messages {
    max-height: min(50dvh, 360px);
  }
}

@media (max-width: 1023px) {
  .site-search-overlay__panel {
    max-height: 100%;
    border-radius: 0 0 16px 16px;
  }
}
