/* DAVR desktop: permanent centered search and outlined city/language selectors.
 * The underlying controlled React catalog input remains mounted invisibly.
 * Only desktop shell >=1024px is changed; mobile/Telegram layouts are intact.
 */
@media (min-width: 1024px) {
  html.davr-desktop-browser-layout #root header {
    min-height: 64px !important;
    gap: 12px !important;
  }
  html.davr-desktop-browser-layout #root header > .davr-desktop-search-toggle {
    display: none !important;
  }
  html.davr-desktop-browser-layout.davr-global-search-ready
    .catalog-discovery:not(.shop-discovery-mode) form.search {
    display: none !important;
  }
  html.davr-desktop-browser-layout.davr-global-search-ready.davr-desktop-search-open body::before {
    display: none !important;
  }
  html.davr-desktop-browser-layout #root header > .davr-header-search {
    position: absolute;
    z-index: 42;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 11px;
    width: var(--davr-header-search-width, 540px);
    max-width: 590px;
    min-width: 0;
    height: 46px;
    padding: 4px 5px 4px 14px;
    margin: 0;
    box-sizing: border-box;
    border: 1px solid #d5e7df;
    border-radius: 14px;
    background: #f8fbf9;
    box-shadow: 0 4px 14px rgba(14, 76, 53, .055);
    transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
  }
  html.davr-desktop-browser-layout #root header > .davr-header-search:hover {
    border-color: #b2d7c6;
  }
  html.davr-desktop-browser-layout #root header > .davr-header-search:focus-within {
    background: #fff;
    border-color: #0b9a79;
    box-shadow: 0 0 0 3px rgba(18, 161, 124, .12), 0 6px 17px rgba(15, 76, 50, .07);
  }
  html.davr-desktop-browser-layout .davr-header-search > svg {
    color: #078a6e;
    flex: 0 0 21px;
  }
  html.davr-desktop-browser-layout .davr-header-search input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 35px;
    padding: 6px 0;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    color: #223a30;
    font: inherit;
    font-size: 14px;
    line-height: 1.3;
    box-shadow: none !important;
    appearance: none;
  }
  html.davr-desktop-browser-layout .davr-header-search input::placeholder {
    color: #8b9c93;
    opacity: 1;
  }
  html.davr-desktop-browser-layout .davr-header-search input::-webkit-search-cancel-button {
    cursor: pointer;
  }
  html.davr-desktop-browser-layout .davr-header-search-submit {
    flex: 0 0 auto;
    min-width: 78px;
    min-height: 36px;
    padding: 8px 15px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(130deg, #0e9b7a, #078467);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 780;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(11, 133, 98, .13);
  }
  html.davr-desktop-browser-layout .davr-header-search-submit:hover {
    background: linear-gradient(130deg, #098b6e, #08745d);
  }
  html.davr-desktop-browser-layout .davr-header-search-submit:focus-visible {
    outline: 3px solid #8cd7bd;
    outline-offset: 2px;
  }

  /* The original Radix select triggers retain their handlers; only the frames
     become consistently styled like the other DAVR action buttons. */
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker,
  html.davr-desktop-browser-layout #root header .header-actions > .picker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px !important;
    box-sizing: border-box;
    border: 1px solid #d6e8df !important;
    border-radius: 12px !important;
    background: #f8fcfa !important;
    color: #285348;
    box-shadow: 0 3px 10px rgba(19, 76, 54, .035);
    transition: background-color .16s ease, border-color .16s ease;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker {
    gap: 5px;
    padding: 0 7px 0 12px;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker > svg {
    flex: 0 0 auto;
    color: #07886c;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker .picker {
    min-height: 39px !important;
    padding: 0 5px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 670;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .picker {
    min-width: 75px;
    padding: 0 11px !important;
    font-weight: 720;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker:hover,
  html.davr-desktop-browser-layout #root header .header-actions > .picker:hover {
    border-color: #a5d2bd !important;
    background: #edf8f2 !important;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker:focus-within,
  html.davr-desktop-browser-layout #root header .header-actions > .picker:focus-visible {
    border-color: #0a956e !important;
    outline: 3px solid rgba(16, 157, 117, .19);
    outline-offset: 1px;
  }
}
@media (min-width: 1024px) and (max-width: 1360px) {
  html.davr-desktop-browser-layout #root header {
    display: grid !important;
    grid-template-columns: max-content minmax(190px, 1fr) max-content;
    align-items: center;
    column-gap: 14px !important;
  }
  html.davr-desktop-browser-layout #root header > .brand {
    margin: 0 !important;
  }
  html.davr-desktop-browser-layout #root header > .davr-header-search {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    grid-column: 2;
    width: min(100%, 590px);
    max-width: none;
    justify-self: center;
  }
  html.davr-desktop-browser-layout #root header > .header-actions {
    grid-column: 3;
    margin-left: 0 !important;
  }
}
@media (min-width: 1024px) and (max-width: 1110px) {
  html.davr-desktop-browser-layout #root header > .davr-header-search {
    gap: 7px;
    padding-left: 10px;
  }
  html.davr-desktop-browser-layout .davr-header-search-submit {
    min-width: 63px;
    padding-inline: 9px;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .city-picker {
    padding-inline: 8px 3px;
  }
  html.davr-desktop-browser-layout #root header .header-actions > .picker {
    min-width: 61px;
    padding-inline: 7px !important;
  }
}
@media (max-width: 1023px) {
  .davr-header-search { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .davr-header-search,
  .davr-header-search-submit,
  .header-actions > .city-picker,
  .header-actions > .picker {
    transition: none !important;
  }
}
