/* assets/css/header.css
   Desktop rules preserved; mobile and tablet overrides below.
*/

/* ---------- Desktop / Global header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-color, #fff);
  border-bottom: 1px solid #e5e5e5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  z-index: 1000;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 16px;
}

/* Logo */
.logo a { display:flex; align-items:center; }
.site-logo { height:50px; display:block; }

/* Desktop nav - keep exact look */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  margin: 0;
  padding: 0;
}
.main-nav ul li a {
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  color: var(--text-color, #1f3c2f);
  transition: 0.3s;
  padding: 8px 6px;
}

/* Right side controls */
.nav-controls { display:flex; align-items:center; gap:12px; }
.icon-link { display:inline-flex; align-items:center; justify-content:center; position:relative; text-decoration:none; color:inherit; }
.nav-icon i { font-size: 20px; color:#214d35; }

/* Count badge */
.count-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #e6b95c;
  color: #0b2b22;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height:1;
}
.count-badge:empty { display:none; }

/* Mobile hamburger button (hidden on desktop via media query) */
.mobile-menu-icon,
.mobile-menu-icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  font-size: 26px;
  color: #123322;
}

/* ---------------- Mobile nav (slide-in right) ---------------- */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 1400;
}

/* Mobile nav itself */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 340px;
  max-width: 86%;
  height: 100vh;
  background: #fff;
  box-shadow: -12px 0 30px rgba(16,34,27,0.12);
  transition: right .36s cubic-bezier(.2,.9,.2,1);
  z-index: 1500;
  display: flex;
  flex-direction: column;
}

/* inner padding and layout */
.mobile-nav-inner {
  display:flex;
  flex-direction:column;
  height:100%;
  padding: 14px 18px;
}

/* header row inside mobile nav */
.mobile-nav-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom:8px;
  border-bottom: 1px solid #f0f0f0;
}
.site-logo-mobile { height:38px; }

/* close button */
.mobile-close {
  background:transparent;
  border:none;
  font-size:20px;
  padding:8px;
  cursor:pointer;
  color:#123322;
}

/* menu list */
.mobile-menu-list {
  list-style:none;
  padding: 14px 0;
  margin: 0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.mobile-menu-list li a {
  display:block;
  padding: 12px 6px;
  font-size:16px;
  font-weight:600;
  color:#123322;
  text-decoration:none;
}

/* footer quick links */
.mobile-nav-footer {
  margin-top:auto;
  padding-top:12px;
  border-top:1px solid #f0f0f0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.mobile-footer-link {
  text-decoration:none;
  font-weight:600;
  padding:10px 6px;
  display:flex;
  align-items:center;
  gap:10px;
  color:#123322;
}
.badge-inline {
  background:#e6b95c;
  color:#082418;
  padding:2px 8px;
  border-radius:999px;
  font-weight:700;
  margin-left:auto;
  font-size:13px;
}

/* logout notice */
.logout-notice {
  background:#e7f5e6;
  color:#226b22;
  text-align:center;
  padding:10px;
  border-radius:8px;
  margin:15px auto;
  max-width:500px;
  transition:opacity .4s ease;
}

/* ACTIVE state: show overlay + slide nav in */
body.mobile-open .nav-overlay {
  display:block;
  opacity:1;
  pointer-events: auto;
}
body.mobile-open .mobile-nav {
  right: 0;
}

/* small helpers */
.welcome-desktop { margin-left:8px; }

/* ---------------- RESPONSIVE OVERRIDES ---------------- */
@media (max-width: 1024px) {
  /* keep desktop nav visible on larger tablets but tweak spacing */
  .header-container { height: 68px; padding: 0 12px; }
}

@media (max-width: 768px) {
  /* Compact header on mobile */
  .header-container { height: 60px; padding: 0 12px; }

  /* Logo reduced (L1) */
  .site-logo { height: 38px; }

  /* Hide desktop nav on mobile */
  .main-nav { display: none !important; }

  /* Show nav-controls and hamburger */
  .nav-controls { display:flex; align-items:center; gap:8px; margin-left:auto; }

  /* Icon touch sizes */
  .nav-controls .nav-icon, .mobile-menu-icon {
    width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center;
    border-radius:8px;
  }
  .nav-controls .nav-icon i { font-size:18px; }

  /* badges reposition */
  .count-badge { top:-6px; right:-6px; font-size:12px; padding:3px 6px; }

  /* Mobile nav width smaller on small phones */
  .mobile-nav { width: 86%; max-width: 320px; }

  /* Improve readability */
  .mobile-menu-list li a { font-size:16px; padding:12px 6px; border-radius:8px; }
}

/* ensure no horizontal scroll */
html, body { overflow-x: hidden; width:100%; }

/* Hide mobile drawer & overlay on desktop */
@media (min-width: 1025px) {
    .mobile-nav,
    .nav-overlay,
    .mobile-menu-icon {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}
/* Remove iOS Safari blue outline inside mobile nav */

@media (max-width: 768px) {
  *:focus {
    outline: none !important;
    box-shadow: none !important;
  }
}
/* ============================
   FIX: MOBILE NAV FOOTER VISIBILITY
   ============================ */
.mobile-nav-footer {
    margin-top: 25px;
    padding: 14px 18px;
    border-top: 1px solid #e2e2e2;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mobile-footer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 14px;
    border: 1.5px solid #dcd9d0;
    border-radius: 10px;
    background: #faf9f3;
    color: #1f3c2f;
    text-decoration: none;
}

.mobile-footer-link i {
    font-size: 18px;
    margin-right: 10px;
}

.badge-inline {
    background: #1f3c2f;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    min-width: 20px;
    text-align: center;
}

/* FIX: prevent footer content from being cut off */
.mobile-nav-inner {
    padding-bottom: 40px !important;
    overflow-y: auto;
    max-height: 100vh;
}

