/* =========================
   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;
}

.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: 64px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  object-position: center;
  transform: translateY(3px);
}

.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);
}

.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; }

.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; }

/* ===== Mobil topbar: 2 sor, scrollbar elrejtve ===== */
@media (max-width: 768px){

  .topbar{
    background: rgba(53,120,229,0.92);
    backdrop-filter: blur(6px);
  }

  .topbar-inner{
    height: auto;
    max-width: 100%;
    padding: 8px 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand{
    order: 1;
    margin-right: 0;
    font-size: 24px;
    flex: 0 0 auto;
  }
  .brand.logo-link{
    padding: 0;
    gap: 0;
  }
  .brand-logo{
    height: 42px;
    max-width: 150px;
    transform: translateY(2px);
  }
  .brand-text{
    font-size: 20px;
  }
  .meteon-logo{
    font-family: 'Poppins', 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 26px;
    color: #ffffff;
    letter-spacing: 0.02em;
    text-shadow: none;
    -webkit-text-stroke: 1.8px #1d4ed8;
  }

  .top-search{
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
  }
  .top-search input{
    width: auto;
    flex: 1 1 auto;
    height: 34px;
    padding: 7px 10px;
    border-radius: 12px;
  }

  .icon-btn{ order: 3; width: 40px; height: 40px; }

  .main-nav{
    order: 4;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    gap: 12px;
    border-radius: 10px;

    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;

    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .main-nav::-webkit-scrollbar{ display:none; height:0; }

  .nav-link{ font-size: 15px; }

  /* Mobil dropdown: jobbra nyíljon */
  .nav-dropdown-menu{
    left: auto;
    right: 0;
    transform: translate(0, 8px);
    min-width: 170px;
  }
}

/* =========================
   FIX: Dropdown ne legyen levágva mobilon az overflow miatt
========================= */
@media (max-width: 768px){

  /* A dropdownot jelenleg levágja a .main-nav overflow-x: auto */
  .main-nav{
    overflow: visible !important;     /* ez a lényeg */
  }

  /* Ha mégis kell a menü “összenyomása”, hogy kiférjen */
  .main-nav{
    gap: 10px !important;
    padding: 8px 8px !important;
  }

  .nav-link{
    font-size: 14px !important;
  }
}

/* =========================
   MOBIL UX FIX – Topbar gombok ujjbarát méretre
========================= */
@media (max-width: 768px){

  /* A teljes menüsor legyen kicsit feljebb és magasabb */
  .main-nav{
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    gap: 16px !important;              /* nagyobb távolság a gombok közt */
  }

  /* Maga a gomb (link) */
  .nav-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;                  /* 👈 touch target */
    padding: 10px 8px;                 /* fel-le nagyobb tapp terület */
    font-size: 15px;                   /* maradhat olvasható */
    line-height: 1;
  }

  /* ARCHIVUM caret ne legyen túl közel */
  .nav-link-has-menu{
    gap: 8px;
  }

  /* Aktív aláhúzás lejjebb kerüljön, ne érjen az ujj alá */
  .nav-link.active::after{
    bottom: -6px;
  }
}


/* =========================
   MOBIL FINOMHANGOLÁS – nagyobb gombok + betűk
========================= */
@media (max-width: 768px){

  /* Menüsor maga */
  .main-nav{
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    gap: 18px !important;            /* kicsit nagyobb távolság */
  }

  /* Menü gombok */
  .nav-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;                /* 👈 nagyobb tapp terület */
    padding: 12px 10px;              /* fel-le + oldal */
    font-size: 16px;                 /* 👈 NAGYOBB BETŰ */
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1;
  }

  /* ARCHIVUM caret */
  .nav-link-has-menu{
    gap: 10px;
  }

  .nav-caret{
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 6px;
  }

  /* Aktív aláhúzás lejjebb */
  .nav-link.active::after{
    bottom: -8px;
    height: 3px;
    border-radius: 3px;
  }
}


@media (max-width: 768px){

  /* MENÜ SZÖVEG */
  .nav-link{
    font-size: 16px !important;   /* 👈 EZ A LÉNYEG */
    font-weight: 700;             /* kicsit vastagabb, jobban olvasható */
    letter-spacing: 0.6px;
  }

  /* ARCHIVUM caret arányos legyen */
  .nav-caret{
    border-left-width: 7px;
    border-right-width: 7px;
    border-top-width: 7px;
  }

  /* Ha nagyon szűk a hely, engedjünk picit oldalról */
  .main-nav{
    gap: 16px !important;
  }
}

@media (max-width: 768px){

  body{
    padding-top: 180px;  /* 👈 EZ A LÉNYEG */
  }
}


/* =========================
   MOBIL OVERRIDE: ne logjon ki a topbar, nav legyen gorgetheto
========================= */
@media (max-width: 768px){
  .topbar{
    width: 100%;
  }

  .topbar-inner{
    max-width: 100%;
    padding: 8px 10px;
  }

  .main-nav{
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 6px 8px;
    gap: 8px;
    overflow: visible !important; /* allow dropdown to overlay content */
    overflow-y: visible;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav::-webkit-scrollbar{
    height: 0;
    display: none;
  }

  .nav-link{
    min-height: 36px;
    padding: 8px 6px;
    font-size: 14px !important;
    letter-spacing: 0.3px;
  }

  .nav-caret{
    border-left-width: 6px;
    border-right-width: 6px;
    border-top-width: 6px;
  }

  .top-search{
    flex: 1 1 auto;
    min-width: 120px;
  }

  .top-search input{
    height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }

  body{
    padding-top: 155px;
  }
}
