import{j as e}from"./ui-vendor-8uIfD_JC.js";import"./react-vendor-28t7dxFl.js";import{a as p,c as o}from"./index-BagLllOy.js";import{S as u,d as f,e as g,f as h,h as j,N as S}from"./user-preferences-Bp23os94.js";import{S as z}from"./search-C9cjY_J1.js";import{X as v}from"./header-B8URyXEE.js";function X({countries:N,cities:n,selectedCountryId:s,selectedCityId:t,onCountryChange:x,onCityChange:i,openNow:a,onOpenNowChange:m,searchQuery:l,onSearchQueryChange:d,onDetectLocation:c,isDetectingLocation:b=!1,isLoadingCountries:k=!1,isLoadingCities:w=!1}){return e.jsxs("div",{className:"border-b border-border/60 bg-card/60 backdrop-blur-sm sticky top-16 z-40",children:[e.jsx("div",{className:"mx-auto max-w-[1200px] px-6 py-3",children:e.jsxs("div",{className:"flex items-center gap-2.5 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-background border border-border rounded-[10px] px-3.5 h-10 flex-1 min-w-[180px] max-w-[320px] focus-within:border-primary transition-colors",children:[e.jsx(z,{className:"size-[15px] text-muted-foreground shrink-0"}),e.jsx("input",{value:l,onChange:r=>d(r.target.value),placeholder:"Поиск по названию или адресу...",className:"flex-1 bg-transparent text-[13px] outline-none placeholder:text-muted-foreground min-w-0"}),l&&e.jsx("button",{onClick:()=>d(""),className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":"Очистить",children:e.jsx(v,{className:"size-3.5"})})]}),k?e.jsx(p,{className:"h-10 w-[140px] rounded-[10px]"}):e.jsxs(u,{value:s,onValueChange:x,children:[e.jsx(f,{className:"h-10 w-[140px] rounded-[10px] text-[13px] border-border bg-background",children:e.jsx(g,{placeholder:"Страна"})}),e.jsx(h,{children:N.map(r=>e.jsx(j,{value:r.id,className:"text-[13px]",children:r.name},r.id))})]}),w?e.jsx(p,{className:"h-10 w-[150px] rounded-[10px]"}):e.jsxs(u,{value:t,onValueChange:i,disabled:!s||n.length===0,children:[e.jsx(f,{className:o("h-10 w-[160px] rounded-[10px] text-[13px] bg-background transition-all",s?t?"border-primary text-foreground":"border-border":"border-border/40 opacity-50 cursor-not-allowed"),children:e.jsx(g,{placeholder:s?"🏙️ Город":"Сначала страну"})}),e.jsx(h,{children:n.map(r=>e.jsx(j,{value:r.id,className:"text-[13px]",children:r.name},r.id))})]}),e.jsxs("button",{onClick:()=>m(!a),className:o("h-10 flex items-center gap-2 px-4 rounded-[10px] text-[13px] font-medium border transition-all",a?"bg-[rgba(34,197,94,0.12)] text-[#22c55e] border-[rgba(34,197,94,0.25)]":"bg-background text-muted-foreground border-border hover:text-foreground"),children:[e.jsx("span",{className:o("w-2 h-2 rounded-full transition-colors",a?"bg-[#22c55e]":"bg-muted-foreground/40"),style:{animation:a?"pulse-dot 1.5s ease-in-out infinite":"none"}}),"Открыто сейчас"]}),(s||t||l||a)&&e.jsxs("button",{onClick:()=>{x(""),i(""),d(""),m(!1)},className:"h-10 flex items-center gap-1.5 px-3.5 rounded-[10px] text-[12px] font-semibold border border-border/60 text-muted-foreground hover:text-foreground hover:border-border bg-background transition-all",children:[e.jsx(v,{className:"size-3.5"}),"Сбросить"]}),c&&e.jsx("button",{onClick:c,disabled:b,title:"Определить моё местоположение",className:"h-10 w-10 flex items-center justify-center rounded-[10px] bg-background border border-border text-muted-foreground hover:text-foreground hover:border-primary transition-all disabled:opacity-50",children:e.jsx(S,{className:o("size-[15px]",b&&"animate-pulse")})})]})}),e.jsx("style",{children:`
        @keyframes pulse-dot {
          0%,100% { transform: scale(1); opacity: 1; }
          50%      { transform: scale(1.5); opacity: 0.7; }
        }
      `})]})}export{X as L};