/* =========================================================
   SEARCH ATX — MOBILE / TABLET
   - mobile-first
   - tablet stabilny (bez chowania)
   - desktop OBSŁUGIWANY OSOBNO
========================================================= */


/* =========================================================
   SEARCH HOST — FIXED (KANON)
========================================================= */

:root {
  --search-h: 60px; /* było optycznie ~52 */
}

#search-host {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  z-index: 300;
  background: #ffffff;

  transform: translateY(0);
  transition: transform .25s ease, opacity .2s ease;
  will-change: transform;
}

/* HIDE */
#search-host.is-hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   WRAP
========================================================= */

body.ui-internal #search-atx-wrap {
  background: #ffffff;
  margin: 0;
  z-index: 300;
}


/* =========================================================
   TABLET (768–1023px)
   - search ZAWSZE widoczny
   - JS scroll WYŁĄCZONY
========================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  #search-host,
  #search-host.is-hidden {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}




/* =========================================================
   FORM — GRID (MOBILE)
========================================================= */

body.ui-internal #search-atx-bar {
  display: grid;
  grid-template-columns: 70% 15% 15%;
  align-items: stretch;
}


/* =========================================================
   LEWA KOLUMNA — INPUT + MAPA
========================================================= */

.search-atx-row {
  grid-column: 1 / 2;
  display: flex;
  align-items: center;
}


/* =========================================================
   MAPA (LINK)
========================================================= */

body.ui-internal .search-atx-map {
  width: 55px;
  height: var(--search-h);

  display: flex;
align-items: stretch;
  justify-content: stretch;

  padding: 0;
  overflow: hidden;

  color: #111;
  text-decoration: none;
}

body.ui-internal .search-atx-map img {
  width: 100%;
  height: 100%;
  display: block;

  object-fit: cover; /* albo cover – patrz uwaga */
}


/* =========================================================
   INPUT
========================================================= */

body.ui-internal .search-atx-input {
  position: relative;
  height: var(--search-h);

  border-left: 1px solid #e5e7eb;
}

body.ui-internal .search-atx-input input {
  width: 100%;
  height: 100%;

  padding: 0 5px 0 10px;
  border: 0;

  font-size: 17px;
  background: #ffffff;
  color: #111;
}


/* =========================================================
   CLEAR (LOGIKA ZOSTAJE, UI WYŁĄCZONE)
========================================================= */

body.ui-internal .search-atx-clear {
  display: none;
}


/* =========================================================
   REGION — JEDNO ŹRÓDŁO PRAWDY
========================================================= */

body.ui-internal #search-atx-region {
  grid-column: 2 / 3;

  position: relative;
  display: flex;
  align-items: center;

  width: 100%;
  height: var(--search-h);

  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}

body.ui-internal #search-atx-region select {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: #475569;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-bottom: 5px;
}


/* STRZAŁKA SELECTA */

body.ui-internal #search-atx-region::after {
  content: "";
  position: absolute;

  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);

  width: 10px;
  height: 10px;

  border-right: 2px solid #666;
  border-bottom: 2px solid #666;

  pointer-events: none;
  opacity: 0.85;
}


/* =========================================================
   STANY REGIONU
========================================================= */

body.ui-internal #search-atx-region:not(.has-value) select {
  text-indent: -9999px;
}

body.ui-internal #search-atx-region.has-value select {
  text-indent: 0;
}


/* =========================================================
   SUBMIT
========================================================= */

.search-atx-submit {
  grid-column: 3 / 4;

  width: 100%;
  height: var(--search-h);

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0;
}

.search-atx-submit img {
  width: 30px;
  height: 30px;
  display: block;
}


/* =========================================================
   FOCUS — KANON (GLOBAL SEARCH)
========================================================= */

body.ui-internal .search-atx-input input:focus,
body.ui-internal .search-atx-input input:focus-visible,
body.ui-internal #search-atx-region select:focus,
body.ui-internal #search-atx-region select:focus-visible {
  outline: none;
  box-shadow: none;
}

/* =========================================================
   PAGE SHOW — SEARCH OFF (MOBILE + TABLET)
   show.php
========================================================= */

@media (max-width: 1023px) {
  body.page-show #search-host,
  body.page-show #search-atx-wrap {
    display: none !important;
  }
}


