.g-search2pro {
  position: relative;
  width: var(--s2p-width, 100%);
  max-width: var(--s2p-max-width, 620px);
  margin-top: var(--s2p-margin-top, 0px);
  margin-right: var(--s2p-margin-right, 0px);
  margin-bottom: var(--s2p-margin-bottom, 0px);
  margin-left: var(--s2p-margin-left, 0px);
  align-self: var(--s2p-vertical-align, center);
  font-family: inherit;
  z-index: 1000;
}

.g-search2pro--align-left { margin-right: auto; }
.g-search2pro--align-center { margin-left: auto; margin-right: auto; }
.g-search2pro--align-right { margin-left: auto; }

.g-search2pro__form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--s2p-height, 44px);
  margin: 0;
  overflow: hidden;
  border-radius: var(--s2p-radius, 9999px);
  transition:
    border-color .18s ease,
    background-color .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}

/* Styl pro horní pozadí #312f38 */
.g-search2pro--dark_header .g-search2pro__form {
  background: #26242c;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 5px 18px rgba(0,0,0,.20);
}

.g-search2pro--dark_header .g-search2pro__form:hover {
  background: #292730;
  border-color: rgba(255, 255, 255, .24);
}

.g-search2pro--dark_header .g-search2pro__form:focus-within {
  background: #24222a;
  border-color: rgba(74, 126, 255, .90);
  box-shadow:
    0 0 0 3px rgba(42, 99, 255, .20),
    0 8px 24px rgba(0,0,0,.30);
}

.g-search2pro--light .g-search2pro__form {
  background: #fff;
  border: 1px solid #d9dde5;
  box-shadow: 0 2px 10px rgba(15,23,42,.08);
}

.g-search2pro__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  flex: 0 0 42px;
}

.g-search2pro--dark_header .g-search2pro__icon {
  color: #a8acb7;
}

.g-search2pro--light .g-search2pro__icon {
  color: #667085;
}

.g-search2pro svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.g-search2pro__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px 0 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font: inherit;
  font-size: 13px !important;
  line-height: 1 !important;
}

.g-search2pro--dark_header .g-search2pro__input {
  color: #ffffff !important;
}

.g-search2pro--dark_header .g-search2pro__input::placeholder {
  color: #999da8;
  opacity: 1;
}

.g-search2pro--light .g-search2pro__input {
  color: #111827 !important;
}

.g-search2pro--light .g-search2pro__input::placeholder {
  color: #7a8493;
  opacity: 1;
}

.g-search2pro__clear,
.g-search2pro__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.g-search2pro__clear {
  width: 34px;
  font-size: 20px;
  line-height: 1;
}

.g-search2pro__submit {
  width: 44px;
}

.g-search2pro--dark_header .g-search2pro__clear,
.g-search2pro--dark_header .g-search2pro__submit {
  color: #aab1bd;
}

.g-search2pro--light .g-search2pro__clear,
.g-search2pro--light .g-search2pro__submit {
  color: #667085;
}

/* Výsledky */
.g-search2pro__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-height: var(--s2p-list-height, 460px);
  overflow: auto;
  background: #25232b;
  color: #f7f8fa;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.46);
  z-index: 1001;
}

.g-search2pro--light .g-search2pro__dropdown {
  background: #fff;
  color: #111827;
  border-color: #e4e7ec;
  box-shadow: 0 18px 50px rgba(15,23,42,.16);
}

.g-search2pro__items {
  padding: 8px;
}

.g-search2pro__item {
  display: flex !important;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 13px;
  border-radius: 10px;
  color: inherit !important;
  text-decoration: none !important;
  transition: background-color .15s ease, transform .15s ease;
}

.g-search2pro__item:hover,
.g-search2pro__item.is-active {
  background: rgba(66, 111, 255, .13);
  transform: translateX(2px);
}

.g-search2pro--light .g-search2pro__item:hover,
.g-search2pro--light .g-search2pro__item.is-active {
  background: #f1f5ff;
}

.g-search2pro__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.g-search2pro__title {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  color: #ffffff;
}

.g-search2pro--light .g-search2pro__title {
  color: #111827;
}

.g-search2pro__description {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: #a6a9b3;
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.g-search2pro--light .g-search2pro__description {
  color: #697386;
}

.g-search2pro__type {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(63, 111, 255, .18);
  color: #9ab4ff;
  font-size: 10px;
  white-space: nowrap;
  border: 1px solid rgba(99, 136, 255, .18);
}

.g-search2pro--light .g-search2pro__type {
  background: #eef3ff;
  color: #315dcc;
  border-color: #dce6ff;
}

.g-search2pro__message {
  padding: 20px;
  color: #a6afbc;
  text-align: center;
  font-size: 12px;
}

.g-search2pro__all {
  display: block !important;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.09);
  color: #8eabff !important;
  text-align: center;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 600;
}

.g-search2pro--light .g-search2pro__all {
  border-top-color: #e6e9ef;
  color: #2f62db !important;
}

.g-search2pro__all:hover {
  background: rgba(255,255,255,.045);
}

/* Pomocné pravidlo pro Gantry blok v headeru */
#g-navigation .g-search2pro,
#g-header .g-search2pro {
  width: 100%;
}

@media (max-width: 767px) {
  .g-search2pro {
    max-width: none;
  }

  .g-search2pro__dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 70px;
    max-height: min(65vh, var(--s2p-list-height, 460px));
  }

  .g-search2pro__type {
    display: inline-flex;
  }
}

/* Ruční odsazení z administrace má přednost před výchozím zarovnáním. */
.g-search2pro[style*="--s2p-margin-left:"]:not([style*="--s2p-margin-left:0px"]) {
  margin-left: var(--s2p-margin-left) !important;
}
.g-search2pro[style*="--s2p-margin-right:"]:not([style*="--s2p-margin-right:0px"]) {
  margin-right: var(--s2p-margin-right) !important;
}


/* ==========================================================
   Theme Engine 2.2 – čitelné výsledky hledání
   ========================================================== */

.g-search2pro__dropdown {
  border-radius: 14px !important;
}

.g-search2pro__items {
  padding: 10px !important;
}

.g-search2pro__item {
  gap: 16px !important;
  min-height: 64px !important;
  padding: 13px 14px !important;
  border: 1px solid transparent !important;
}

.g-search2pro__item + .g-search2pro__item {
  border-top-color: rgba(255,255,255,.07) !important;
}

.g-search2pro__title {
  display: block !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  opacity: 1 !important;
}

.g-search2pro__description {
  margin-top: 5px !important;
  color: #c7cad2 !important;
  font-size: 12.5px !important;
  line-height: 1.48 !important;
  opacity: 1 !important;
}

.g-search2pro__type {
  margin-top: 2px !important;
  padding: 5px 9px !important;
  color: #d7e1ff !important;
  background: rgba(71,117,255,.24) !important;
  border-color: rgba(125,155,255,.35) !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .g-search2pro__dropdown,
.g-search2pro--light .g-search2pro__dropdown {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: #d7dce5 !important;
}

html[data-theme="light"] .g-search2pro__item + .g-search2pro__item,
.g-search2pro--light .g-search2pro__item + .g-search2pro__item {
  border-top-color: #e9edf3 !important;
}

html[data-theme="light"] .g-search2pro__title,
.g-search2pro--light .g-search2pro__title {
  color: #111827 !important;
}

html[data-theme="light"] .g-search2pro__description,
.g-search2pro--light .g-search2pro__description {
  color: #4b5563 !important;
}

html[data-theme="light"] .g-search2pro__type,
.g-search2pro--light .g-search2pro__type {
  color: #244aa5 !important;
  background: #e7edff !important;
  border-color: #c8d5ff !important;
}

html[data-theme="light"] .g-search2pro__item:hover,
html[data-theme="light"] .g-search2pro__item.is-active,
.g-search2pro--light .g-search2pro__item:hover,
.g-search2pro--light .g-search2pro__item.is-active {
  background: #eef3ff !important;
  border-color: #d7e2ff !important;
}

/* v236: Stabilní přepnutí světlého/tmavého motivu bez blikání vyhledávání. */
html[data-theme] .g-search2pro,
html[data-theme] .g-search2pro__form,
html[data-theme] .g-search2pro__input,
html[data-theme] .g-search2pro__icon,
html[data-theme] .g-search2pro__clear,
html[data-theme] .g-search2pro__submit,
html[data-theme] .g-search2pro__dropdown,
html[data-theme] .g-search2pro svg {
  transition: none !important;
  animation: none !important;
}

/* Barvu a rámeček nese pouze vnější formulář; input zůstává průhledný. */
html[data-theme] .g-search2pro__form {
  width: 100% !important;
  transform: none !important;
  background-color: var(--site-input-bg) !important;
  border-color: var(--site-border) !important;
  color: var(--site-input-text) !important;
}

html[data-theme] .g-search2pro__input,
html[data-theme] .g-search2pro input[type="search"] {
  width: auto !important;
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--site-input-text) !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme] .g-search2pro__input::placeholder,
html[data-theme] .g-search2pro input[type="search"]::placeholder {
  color: var(--site-placeholder) !important;
  opacity: 1 !important;
}

/* v269: iOS search – prevent focus zoom and keep results above the keyboard. */
@media (max-width: 767.98px) {
  html .g-search2pro__input,
  html .g-search2pro input[type="search"] {
    font-size: 16px !important;
    line-height: 1.25 !important;
    touch-action: manipulation !important;
  }

  html .g-search2pro__form {
    min-height: 48px !important;
  }

  html .g-search2pro__input::placeholder,
  html .g-search2pro input[type="search"]::placeholder {
    font-size: 14px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    opacity: .78 !important;
  }

  html .g-search2pro__dropdown {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: var(--s2p-mobile-results-height, 45dvh) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 10050 !important;
  }
}

/* v270: Mobile result labels and collision-free dropdown. */
@media (max-width: 767.98px) {
  html .g-search2pro__item {
    align-items: center !important;
    gap: 10px !important;
    min-height: 58px !important;
    padding: 11px 12px !important;
  }

  html .g-search2pro__main {
    flex: 1 1 auto !important;
  }

  html .g-search2pro__type {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}
