/* =========================
   TOPBAR – KÖZÖS (minden oldalon ugyanaz)
========================= */

:root{
  --topbar-fg: #fff;
  --topbar-accent: #3578e5;
}

/* Topbar alap */
.topbar{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  background: var(--topbar-accent);
  box-shadow: 0 4px 12px rgba(15,23,42,0.2);
}

.topbar-inner{
  height: 68px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  z-index: 7000;
}
/* a keresőt jobbra tolja, a logó+menü balra marad */
.top-search{ margin-left: auto; }

.brand{
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .3px;
  color: #f7fbff;
  font-size: 26px;
  font-family: 'Poppins', 'Montserrat', sans-serif;
  text-transform: capitalize;
  text-shadow:
    0 1px 0 rgba(0,0,0,0.25),
    0 3px 8px rgba(0,0,0,0.25);
  margin-right: 6px;
}

.brand.logo-link{
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
}

.brand-logo{
  display: block;
  height: 78px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  object-position: center;
  transform: translateY(3px);
  margin-right: -10px;
}

.brand-text{

  font-family: 'Poppins', 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 2px rgba(0,0,0,0.25),
    0 3px 8px rgba(0,0,0,0.16);
  margin-left: 2px;
}

.meteon-logo{
  font-family: 'Poppins', 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow: none;
  -webkit-text-stroke: 2px #1d4ed8; /* vékonyabb kontúr, több fehér */
}

.main-nav{
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  padding: 6px 54px;
  margin: 0 12px;
  border-radius: 8px;
  position: relative;
  z-index: 7001;
}

.nav-link{
  position: relative;
  padding: 6px 2px;
  text-decoration: none;
  color: var(--topbar-fg);
  font-weight: 600;
  letter-spacing: .3px;
  font-size: 20px;
  text-shadow: 1px 1px 3px rgba(15,23,42,0.18);
}
.nav-link:hover{ color: #d6e6ff; }

.nav-link.active{ color: #fff; }
.nav-link.active::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Dropdown */
.nav-dropdown{
  position: relative;
  display: flex;
  align-items: center;
}
.nav-link-has-menu{
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-caret{
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid rgba(255,255,255,0.9);
  transition: transform 0.16s ease, border-top-color 0.16s ease;
}

.nav-dropdown-menu{
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 10px;
  background: #f8fbff;
  color: #111827;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 9500;
}

/* Csak .open osztállyal (JS kattintásra) nyíljon */
.nav-dropdown.open .nav-dropdown-menu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 4px);
}

.dropdown-link{
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: #111827;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: .2px;
}
.dropdown-link:hover{
  background: rgba(53, 120, 229, 0.1);
  color: #3578e5;
}
.dropdown-link.active{
  background: rgba(53, 120, 229, 0.16);
  color: #3578e5;
}

.nav-dropdown.open .nav-caret{
  transform: translateY(1px) rotate(180deg);
  border-top-color: #dbeafe;
}

/* Mobil/JS: ha rárakod az .open class-t */
.nav-dropdown.open .nav-dropdown-menu{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 4px);
}
.nav-dropdown.open .nav-caret{
  transform: translateY(1px) rotate(180deg);
  border-top-color: #dbeafe;
}

/* Kereső */
.top-search{
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-search input{
  width: 200px;
  height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(15,23,42,0.16);
  border-radius: 10px;
  background: rgba(248,251,255,0.95);
  color: #111827;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(15,23,42,0.12);
}
.top-search input::placeholder{ color: #8fa0b5; }

/* Városnév-automatikus kiegészítés (autocomplete) */
.top-search{ position: relative; }
.ac-list{
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  max-width: 82vw;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.14);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15,23,42,0.22);
  overflow: hidden;
  z-index: 1200;
  display: none;
}
.ac-list.open{ display: block; }
.ac-item{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 13px;
  border: 0;
  border-bottom: 1px solid rgba(15,23,42,0.06);
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #111827;
}
.ac-item:last-child{ border-bottom: 0; }
.ac-item:hover,
.ac-item.is-active{ background: #eef4ff; }
.ac-name{ font-weight: 600; }
.ac-megye{ font-size: 12px; color: #6b7280; white-space: nowrap; }

.icon-btn{
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, #2f8bff, #1d73eb);
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 10px 20px rgba(18, 89, 180, 0.32),
    0 2px 6px rgba(18, 89, 180, 0.28);
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.icon-btn:hover{
  background: linear-gradient(135deg, #3494ff, #2680f0);
  transform: translateY(-1px);
}
.icon-btn svg{ display:block; }

/* =========================
   HAMBURGER + DRAWER komponens (alap: rejtve, desktopon nem látszik)
========================= */
.nav-toggle{ display: none; }
.mobile-drawer, .mobile-drawer-overlay{ display: none; }

/* =========================
   MOBIL TOPBAR (≤768px) – EGY soros fejléc + hamburger menü
   logó+név · kereső · ≡   (a menü becsúszó panelben)
========================= */
@media (max-width: 768px){
  .topbar{
    background: rgba(53,120,229,0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 18px rgba(15,23,42,0.22);
  }

  .topbar-inner{
    height: auto;
    max-width: 100%;
    padding: 9px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  /* Logó + név */
  .brand{ order: 1; margin: 0; flex: 0 0 auto; font-size: 22px; }
  .brand.logo-link{ padding: 0; gap: 0; }
  .brand-logo{ height: 42px; max-width: 140px; transform: none; margin-right: -6px; }
  .brand-text{ font-size: 20px; margin-left: 2px; }

  /* Kereső – kitölti a maradék helyet a logó és a ≡ között */
  .top-search{ order: 2; flex: 1 1 120px; min-width: 0; margin-left: 6px; }
  .top-search input{ width: 100%; height: 40px; padding: 9px 14px; font-size: 15px; border-radius: 12px; }
  .ac-list{ left: 0; right: 0; width: auto; max-width: none; }

  /* Hamburger gomb (JS rakja be) */
  .has-hamburger .nav-toggle{
    order: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    cursor: pointer;
    flex: 0 0 auto;
  }
  .nav-toggle span{
    display: block; height: 3px; width: 100%;
    background: #fff; border-radius: 3px;
    transition: transform .22s ease, opacity .18s ease;
  }
  .nav-toggle.open span:nth-child(1){ transform: translateY(8px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2){ opacity: 0; }
  .nav-toggle.open span:nth-child(3){ transform: translateY(-8px) rotate(-45deg); }

  /* JS bekapcsolva: a beágyazott menüsor rejtve (a drawer veszi át) */
  .has-hamburger .main-nav{ display: none !important; }
  body.has-hamburger{ padding-top: calc(64px + env(safe-area-inset-top, 0px)); }

  /* --- NO-JS fallback: görgethető chip-menüsor --- */
  .main-nav{
    order: 4; width: 100%; margin: 4px 0 0; padding: 2px 0;
    background: none; border-radius: 0;
    display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center;
    gap: 8px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none;
  }
  .main-nav::-webkit-scrollbar{ display: none; height: 0; }
  .main-nav .nav-link{
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    min-height: 38px; padding: 8px 15px; font-size: 14.5px; font-weight: 600;
    color: #fff; background: rgba(255,255,255,0.16); border-radius: 999px;
    text-shadow: none; white-space: nowrap;
  }

  /* =========================
     A BECSÚSZÓ MENÜ (drawer)
  ========================= */
  body.drawer-lock{ overflow: hidden; }

  .has-hamburger .mobile-drawer-overlay{
    display: block; position: fixed; inset: 0;
    background: rgba(15,23,42,0.45);
    z-index: 9600; opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .has-hamburger .mobile-drawer-overlay.open{ opacity: 1; pointer-events: auto; }

  .has-hamburger .mobile-drawer{
    display: block; position: fixed; top: 0; right: 0; bottom: 0;
    width: min(84vw, 320px);
    background: #ffffff; z-index: 9700;
    box-shadow: -14px 0 44px rgba(15,23,42,0.30);
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .has-hamburger .mobile-drawer.open{ transform: translateX(0); }

  .mobile-drawer-head{
    padding: 18px 20px 14px;
    font-weight: 800; font-size: 18px; color: #0d1b2a;
    border-bottom: 1px solid #eef1f5;
  }

  .mobile-drawer-nav{
    display: flex; flex-direction: column;
    padding: 4px 0 24px; margin: 0; background: none; border-radius: 0; overflow: visible;
  }
  .mobile-drawer-nav .nav-link{
    display: block; width: 100%;
    padding: 15px 20px; min-height: 0;
    color: #1f2937; background: none; border-radius: 0;
    font-size: 16px; font-weight: 600; letter-spacing: 0; line-height: 1.2;
    text-shadow: none; white-space: normal;
    border-bottom: 1px solid #f1f4f8;
  }
  .mobile-drawer-nav .nav-link:active{ background: #f4f8ff; }
  .mobile-drawer-nav .nav-link.active{ background: #eef4ff; color: #1d4ed8; }
  .mobile-drawer-nav .nav-link.active::after{ display: none; }

  .mobile-drawer-nav .nav-dropdown{ display: block; flex: none; }
  .mobile-drawer-nav .nav-link-has-menu{ display: flex; justify-content: space-between; align-items: center; }
  .mobile-drawer-nav .nav-caret{ display: none; }

  /* a legördülő tartalma a drawerben mindig nyitva, behúzva */
  .mobile-drawer-nav .nav-dropdown-menu{
    position: static; opacity: 1; visibility: visible; pointer-events: auto;
    transform: none; display: flex; flex-direction: column;
    min-width: 0; width: auto; padding: 0; margin: 0;
    background: #f7f9fc; box-shadow: none; border-radius: 0;
  }
  .mobile-drawer-nav .dropdown-link{
    padding: 13px 20px 13px 34px; font-size: 15px; color: #374151;
    border-bottom: 1px solid #eef1f5; border-radius: 0; font-weight: 600;
  }
  .mobile-drawer-nav .dropdown-link.active{ color: #1d4ed8; background: #eaf1ff; }
}

/* =========================
   TOPBAR V2 – emeltebb, márka-központú megjelenés
========================= */
.topbar{
  overflow: visible;
  background:linear-gradient(105deg,#246bd7 0%,#347ee6 55%,#3d86ed 100%);
  border-bottom:1px solid rgba(13,78,174,.18);
  box-shadow:0 6px 18px rgba(20,72,145,.2),inset 0 1px 0 rgba(255,255,255,.12);
}
.topbar::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.6;
  background:linear-gradient(100deg,transparent 15%,rgba(255,255,255,.09) 48%,transparent 75%);
}
.topbar-inner{
  height:72px;
  max-width:1140px;
  padding:0 20px;
  gap:20px;
}
.brand.logo-link{
  position:relative;
  gap:1px;
  margin-right:0;
  border-radius:14px;
  transition:background .2s ease, transform .2s ease;
}
.brand.logo-link:hover{
  background:rgba(255,255,255,.08);
  transform:translateY(-1px);
}
.brand-logo{
  height:44px;
  max-width:64px;
  margin-right:0;
  transform:none;
  filter:drop-shadow(0 3px 7px rgba(5,39,104,.24));
}
.brand-text{
  font-size:30px;
  letter-spacing:-.025em;
  text-shadow:0 2px 8px rgba(5,39,104,.3);
}
.main-nav{
  gap:3px;
  min-height:44px;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.nav-link{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:10px 12px;
  border-radius:10px;
  color:rgba(255,255,255,.92);
  font-size:16px;
  font-weight:700;
  letter-spacing:0;
  line-height:1;
  text-shadow:none;
  transition:color .18s ease, background .18s ease, transform .18s ease;
}
.nav-link:hover{
  color:#fff;
  background:rgba(255,255,255,.1);
  transform:translateY(-1px);
}
.nav-link.active{
  color:#fff;
  background:rgba(17,82,180,.22);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.11);
}
.nav-link.active::after{
  right:12px;
  bottom:3px;
  left:12px;
  height:3px;
  background:#fff;
  box-shadow:none;
}
.nav-link-has-menu{ gap:4px; }
.nav-caret{
  margin-left:2px;
  border-width:4px 4px 0;
  border-top-color:rgba(255,255,255,.76);
}
.nav-dropdown-menu{
  top:calc(100% + 8px);
  min-width:172px;
  padding:7px;
  border:1px solid rgba(159,193,239,.55);
  border-radius:14px;
  background:rgba(251,254,255,.96);
  box-shadow:0 18px 38px rgba(15,48,101,.24), inset 0 1px 0 #fff;
  backdrop-filter:blur(12px);
}
.nav-dropdown.open .nav-dropdown-menu{ transform:translate(-50%, 0); }
.dropdown-link{ padding:9px 11px; font-size:14px; }
.dropdown-link:hover{ background:#e9f3ff; color:#1265dc; }
.top-search{ margin-left:auto; }
.top-search::before{
  content:"";
  position:absolute;
  z-index:1;
  left:13px;
  top:12px;
  width:14px;
  height:14px;
  border:2px solid #7190b7;
  border-radius:50%;
  pointer-events:none;
}
.top-search::after{
  content:"";
  position:absolute;
  z-index:1;
  left:27px;
  top:25px;
  width:6px;
  height:2px;
  border-radius:2px;
  background:#7190b7;
  transform:rotate(45deg);
  pointer-events:none;
}
.top-search input{
  width:200px;
  height:42px;
  padding:10px 14px 10px 37px;
  border:1px solid rgba(255,255,255,.42);
  border-radius:13px;
  background:rgba(255,255,255,.94);
  box-shadow:0 7px 18px rgba(8,51,124,.16), inset 0 1px 0 #fff;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.top-search input:hover{ background:#fff; }
.top-search input:focus{
  outline:0;
  border-color:#aeeeff;
  background:#fff;
  box-shadow:0 0 0 3px rgba(168,239,255,.25), 0 7px 18px rgba(8,51,124,.2);
}

@media (max-width:1120px) and (min-width:769px){
  .topbar-inner{ padding:0 16px; gap:10px; }
  .brand-logo{ height:40px; max-width:58px; }
  .brand-text{ font-size:26px; }
  .nav-link{ padding:9px 8px; font-size:14px; }
  .top-search input{ width:168px; }
}
@media (max-width:768px){
  .topbar{
    background:linear-gradient(110deg,#155dcc 0%,#287bf0 100%);
    box-shadow:0 7px 22px rgba(17,67,141,.25);
  }
  .has-hamburger .topbar-inner{
    min-height:64px;
    height:auto;
    padding:9px 12px;
    gap:8px;
    flex-wrap:nowrap;
  }
  .brand.logo-link:hover{ background:transparent; transform:none; }
  .brand-logo{ height:44px; margin-right:-6px; transform:none; }
  .brand-text{ font-size:20px; }
  .has-hamburger .top-search{
    flex:1 1 0;
    min-width:0;
    margin-left:0;
  }
  .top-search::before{ top:12px; left:12px; width:13px; height:13px; }
  .top-search::after{ left:25px; top:24px; }
  .has-hamburger .top-search input{
    width:100%;
    min-width:0;
    height:40px;
    padding-left:35px;
    border-radius:12px;
    box-shadow:0 4px 12px rgba(8,51,124,.16);
  }
  .has-hamburger .nav-toggle{
    border:1px solid rgba(255,255,255,.18);
    background:rgba(255,255,255,.13);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
  }
  .mobile-drawer{
    background:linear-gradient(180deg,#fff 0%,#f5f9ff 100%);
  }
  .mobile-drawer-head{
    color:#123462;
    background:linear-gradient(100deg,#eef7ff,#fff);
  }
}
@media (max-width:360px){
  .has-hamburger .brand-text{ display:none; }
  .has-hamburger .brand-logo{ margin-right:0; }
}
@media (prefers-reduced-motion:reduce){
  .brand.logo-link,.nav-link,.top-search input{ transition:none; }
}

/* ===== Nyelvvalto (topbar jobb szele) =====
   Ket allapot: az aktualis nyelv kiemelve, a masik kattinthato link.
   Sima <a>, nem JS - a Google is latja a nyelvi kapcsolatot. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}
.lang-switch-current,
.lang-switch-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}
.lang-switch-current {
  background: #ffffff;
  color: #1d73eb;
}
.lang-switch-alt {
  color: #eaf2ff;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}
.lang-switch-alt:hover,
.lang-switch-alt:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  text-decoration: none;
}
@media (max-width: 768px) {
  .lang-switch { margin-left: 6px; }
  .lang-switch-current,
  .lang-switch-alt { min-width: 30px; padding: 0 6px; font-size: 11px; }
}

/* ===== Mobil topbar V3 =====
   Az elso sorban csak a fo vezerlok maradnak, a kereso pedig egy teljes,
   jol hasznalhato masodik sort kap. */
@media (max-width: 768px) {
  .has-hamburger .topbar-inner {
    min-height: 0;
    padding: 8px 12px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand language menu"
      "search search search";
    align-items: center;
    row-gap: 8px;
    column-gap: 4px;
  }

  .has-hamburger .lang-switch {
    grid-area: language;
    justify-self: end;
    margin: 0;
    min-height: 38px;
    padding: 3px;
  }

  .has-hamburger .lang-switch-current,
  .has-hamburger .lang-switch-alt {
    min-width: 35px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .has-hamburger .brand.logo-link {
    grid-area: brand;
    justify-self: start;
    min-width: 0;
    gap: 4px;
  }

  .has-hamburger .brand-logo {
    width: auto;
    height: 38px;
    max-width: 55px;
    margin: 0;
    filter: drop-shadow(0 3px 6px rgba(5,39,104,.28));
  }

  .has-hamburger .brand-text {
    display: inline;
    margin: 0;
    font-size: 22px;
    line-height: 1;
  }

  .has-hamburger .nav-toggle {
    grid-area: menu;
    justify-self: end;
    width: 48px;
    height: 44px;
    margin: 0;
    padding: 0 11px;
    border-radius: 13px;
  }

  .has-hamburger .top-search {
    grid-area: search;
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .has-hamburger .top-search::before {
    top: 14px;
    left: 15px;
    width: 14px;
    height: 14px;
  }

  .has-hamburger .top-search::after {
    top: 27px;
    left: 29px;
  }

  .has-hamburger .top-search input {
    width: 100%;
    height: 46px;
    padding: 10px 16px 10px 42px;
    border-radius: 14px;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(8,51,124,.2), inset 0 1px 0 #fff;
  }

  .has-hamburger .ac-list {
    top: calc(100% + 5px);
  }

  body.has-hamburger {
    padding-top: calc(116px + env(safe-area-inset-top, 0px));
  }
}

@media (max-width: 360px) {
  .has-hamburger .brand-text {
    display: inline;
    font-size: 19px;
  }

  .has-hamburger .brand-logo {
    height: 35px;
    max-width: 51px;
  }

  .has-hamburger .lang-switch-current,
  .has-hamburger .lang-switch-alt {
    min-width: 30px;
    padding: 0 6px;
  }
}
