/* @section: HEADER — rx-header (desktop + mobil) */

/* =====================================================
   REXON HEADER + FOOTER (rx-*) — birebir PDF tasarımı
   ===================================================== */

/* ---------- HEADER (desktop) ---------- */
.rx-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 28px);
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.rx-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 100%;
}
.rx-brand-compass {
  height: 72px;
  width: auto;
  object-fit: contain;
  position: relative;
  z-index: 1;
}
.rx-brand-word {
  height: 46px;
  width: auto;
  object-fit: contain;
}
.rx-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.rx-ico {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}
/* İletişim butonları: İletişim / E-Posta / WhatsApp */
.rx-contact { display: inline-flex; align-items: center; gap: 8px; }
.rx-cwrap { position: relative; }
.rx-cbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.rx-cbtn:hover { border-color: var(--red); color: var(--red); }
.rx-cbtn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.rx-phonepop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  z-index: 60;
  min-width: 175px;
}
.rx-phonepop[hidden] { display: none; }
.rx-phonepop a { color: var(--ink); font-weight: 700; font-size: 14px; white-space: nowrap; }
.rx-phonepop a:hover { color: var(--red); }

/* Mobil sabit alt bar — masaüstünde gizli */
.rx-mobile-contact { display: none; }

/* TR daire */
.rx-lang {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rx-lang-active { display: block; }
.rx-lang-list {
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  min-width: 56px;
}
.rx-lang.open .rx-lang-list { display: flex; }
.rx-lang-list span {
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.rx-lang-list span:hover { background: var(--soft); }

/* Kilit + kullanıcı-onay kutusu */
.rx-secure-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
}
.rx-secure-login .rx-ico { width: 18px; height: 18px; }
.rx-secure-login:hover { background: var(--soft); }

/* Giriş yapılmış durumu — yeşil */
.rx-secure-login.is-logged,
.rx-mobile-userbtn.is-logged {
  position: relative;
  background: #e8f7ec !important;
  border-color: #2e9b3e !important;
  color: #2e9b3e !important;
}
.rx-secure-login.is-logged .rx-ico,
.rx-mobile-userbtn.is-logged svg { color: #2e9b3e; fill: #2e9b3e; }
.rx-secure-login.is-logged:hover { background: #d6f0dc !important; }
.rx-login-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2e9b3e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(46,155,62,.25);
  animation: rx-login-pulse 2s ease-in-out infinite;
}
@keyframes rx-login-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(46,155,62,.25); }
  50%      { box-shadow: 0 0 0 4px rgba(46,155,62,.10); }
}

/* ---------- Kullanıcı menü dropdown ---------- */
.rx-user-menu { position: relative; display: inline-block; }
.rx-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(0,0,0,.16);
  padding: 6px;
  z-index: 80;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.rx-user-dropdown[hidden] { display: none; }
.rx-user-menu.is-open .rx-user-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.rx-user-greet {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.rx-user-greet strong { display: block; font-size: 14px; color: var(--ink); }
.rx-user-greet span {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #2e9b3e;
  background: #e8f7ec;
  padding: 2px 8px;
  border-radius: 999px;
}
.rx-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  transition: background .15s;
}
.rx-user-item:hover { background: var(--soft); }
.rx-user-item svg {
  width: 16px;
  height: 16px;
  fill: var(--muted);
  flex-shrink: 0;
}
.rx-user-item-out {
  color: var(--red);
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 12px;
}
.rx-user-item-out:hover { background: #fbeaea; }
.rx-user-item-out svg { fill: var(--red); }

/* Kırmızı yuvarlak hamburger */
.rx-burger {
  display: inline-grid;
  align-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  cursor: pointer;
  flex-shrink: 0;
}
.rx-burger span {
  display: block;
  width: 22px;
  height: 3px;
  margin: 2.5px auto;
  background: #fff;
  border-radius: 2px;
}

/* Mobil header'a özel butonlar — desktopta gizle */
.rx-mobile-userbtn,
.rx-mobile-loginbtn { display: none; }

/* Menü paneli (hem mobil hem desktop ortak) */
.menu-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 60;
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 38px rgba(0,0,0,.16);
  border-radius: 10px;
}
.menu-panel.open { display: flex; }
.menu-panel a {
  padding: 12px 14px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.menu-panel a:last-child { border-bottom: 0; }
.menu-panel a:hover { color: var(--red); }
.menu-panel .m-phone { display: none; }

/* ---------- HEADER (mobile <= 768px) ---------- */
@media (max-width: 768px) {
  .rx-header {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }
  .rx-brand-compass { height: 56px; }
  .rx-brand-word { height: 36px; }
  .rx-mobile-userbtn svg { width: 24px; height: 24px; }

  /* Mobilde masaüstü iletişim + TR + kilit/user-check butonu gizli */
  .rx-contact,
  .rx-lang,
  .rx-secure-login { display: none; }

  /* Mobil sabit alt iletişim barı — ekranın en altına yapışık */
  .rx-mobile-contact {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    gap: 8px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  }
  .rx-mobile-contact .rx-cwrap { flex: 1; display: flex; position: static; }
  .rx-mobile-contact .rx-cbtn { flex: 1; justify-content: center; padding: 10px 6px; }
  /* Numara kutusu: barın üstünde tam genişlikte, ortalı — taşmasın */
  .rx-mobile-contact .rx-phonepop {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    top: auto;
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 24px;
    text-align: center;
  }
  /* Sabit bar içeriği örtmesin (güvenli alan dahil) */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* Mobilde göster: user silüet butonu + "Giriş yap" çerçeveli buton */
  .rx-mobile-userbtn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--ink);
    padding: 0;
  }
  .rx-mobile-userbtn svg { width: 28px; height: 28px; fill: currentColor; }
  /* "Giriş yap" butonu mobilde kaldırıldı — sadece profil ikonu kalsın */
  .rx-mobile-loginbtn { display: none !important; }
  /* Mobil hamburger sade — kırmızı daire YOK */
  .rx-burger {
    width: 36px;
    height: 36px;
    background: transparent;
    border-radius: 0;
  }
  .rx-burger span {
    width: 26px;
    height: 3px;
    background: var(--ink);
  }

  .menu-panel { top: 62px; right: 12px; }
  .menu-panel .m-phone {
    display: block;
    color: var(--red);
    font-weight: 800;
  }
}
@media (max-width: 420px) {
  .rx-brand-compass { height: 48px; }
  .rx-brand-word { height: 32px; }
  /* mobile loginbtn 768'de zaten gizli */
  /* Dar ekranda buton yazıları tek satırda sığsın */
  .rx-mobile-contact { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .rx-mobile-contact .rx-cbtn { gap: 5px; padding: 10px 2px; font-size: 12px; }
  .rx-mobile-contact .rx-cbtn svg { width: 16px; height: 16px; }
}
