/* =========================================================
   Divi Search Toolbar — toolbar.css v1.1
   ========================================================= */

:root {
  --dst-blue:      #1a6fb5;
  --dst-blue-dark: #155a94;
  --dst-text:      #1a2e44;
  --dst-border:    #d0d8e0;
  --dst-bg:        #ffffff;
  --dst-radius:    4px;
  --dst-trans:     180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Toolbar container ---------------------------------- */
.dst-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: inherit;
  font-size: 14px;
  color: var(--dst-text);
  position: relative;
  z-index: 9999;
}

/* --- Generic button reset ------------------------------- */
.dst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--dst-radius);
  cursor: pointer;
  color: var(--dst-text);
  padding: 6px 8px;
  line-height: 1;
  transition: color var(--dst-trans), border-color var(--dst-trans), background var(--dst-trans);
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
}
.dst-btn:hover,
.dst-btn:focus-visible {
  color: var(--dst-blue);
  border-color: var(--dst-blue);
  outline: none;
}
.dst-btn:focus-visible {
  outline: 2px solid var(--dst-blue);
  outline-offset: 2px;
}
.dst-btn svg { flex-shrink: 0; pointer-events: none; }

.dst-btn--icon.active,
.dst-btn--icon[aria-pressed="true"],
.dst-btn--icon[aria-expanded="true"] {
  color: var(--dst-blue);
  border-color: var(--dst-blue);
}

/* --- Language switcher ---------------------------------- */
.dst-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.dst-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
}
.dst-globe { flex-shrink: 0; }

.dst-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--dst-bg);
  border: 1px solid var(--dst-border);
  border-radius: var(--dst-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 80px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  pointer-events: none;
  transition: opacity var(--dst-trans), transform var(--dst-trans);
  z-index: 10001;
}
.dst-lang-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dst-lang-item {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--dst-text);
  text-decoration: none;
  transition: background var(--dst-trans), color var(--dst-trans);
}
.dst-lang-item:hover,
.dst-lang-item:focus-visible {
  background: #f0f5fb;
  color: var(--dst-blue);
  outline: none;
}
.dst-lang-item.current {
  font-weight: 600;
  color: var(--dst-blue);
}

/* --- Separator ------------------------------------------ */
.dst-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--dst-border);
  margin: 0 4px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* --- Font size button ----------------------------------- */
.dst-btn--text {
  gap: 1px;
  padding: 4px 8px;
  letter-spacing: -0.5px;
}
.dst-t-small { font-size: 11px; line-height: 1; font-weight: 700; opacity: .7; }
.dst-t-large { font-size: 17px; line-height: 1; font-weight: 700; }

/* --- High contrast -------------------------------------- */
body.dst-high-contrast { filter: contrast(1.6) grayscale(0.2); }
body.dst-high-contrast .dst-search-bar { filter: none; }

/* --- Font size states ----------------------------------- */
body.dst-font-large  { font-size: 118% !important; }
body.dst-font-xlarge { font-size: 136% !important; }

/* =========================================================
   SEARCH BAR — FIXED, tuż pod nagłówkiem, pełna szerokość
   ========================================================= */
#dst-search-bar {
  /* Zawsze fixed, pełna szerokość, tuż pod headerem */
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  /* top ustawiany przez JS na podstawie wysokości headera */
  top: var(--dst-header-height, 80px);
  z-index: 9990;

  background: #fff;
  border-bottom: 0px solid var(--dst-border);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);

  /* Zamknięty: max-height = 0, ukryty */
  max-height: 0;
  overflow: hidden;
  padding: 0;
  transition:
    max-height 0.32s cubic-bezier(0.16, 1, 0.3, 1),
    padding    0.32s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.32s ease;
}

#dst-search-bar.open {
  max-height: 80px;
  padding: 10px 0;
}

.dst-search-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.dst-search-inner form {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--dst-border);
  border-radius: var(--dst-radius);
  overflow: hidden;
  background: #fff;
  transition: border-color var(--dst-trans), box-shadow var(--dst-trans);
}
.dst-search-inner form:focus-within {
  border-color: var(--dst-blue);
  box-shadow: 0 0 0 3px rgba(26,111,181,.15);
}

.dst-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 15px 20px;
  font-size: 15px;
  font-family: inherit;
  color: var(--dst-text);
  background: transparent;
  min-width: 0;
}
.dst-search-input::placeholder { color: #9aa5b1; }

.dst-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-left: 1px solid var(--dst-border);
  padding: 10px 14px;
  cursor: pointer;
  color: #9aa5b1;
  transition: color var(--dst-trans), background var(--dst-trans);
  flex-shrink: 0;
}
.dst-search-submit:hover { color: var(--dst-blue); background: #f0f5fb; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 980px) {
  .dst-toolbar { gap: 0; }
  .dst-btn     { padding: 6px 6px; }
  .dst-sep     { margin: 0 2px; }
}
@media (max-width: 480px) {
  #dst-lang-current { display: none; }
  .dst-search-inner { padding: 0 12px; }
}

/* Linia widoczna TYLKO gdy pasek otwarty */
#dst-search-bar.open {
  border-bottom-width: 1px;
}
