/* =========================================================
   Phone / Mobile Layout
============================================================ */

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   HEADER
========================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: var(--nav-header-bg);
  display: flex;
  align-items: center;
  justify-content: flex-start; /* start from left */
  padding: 0 1rem;
  z-index: 1000;
  border-bottom: 2px solid var(--nav-divider);
}

/* Flex order for visual layout */
.site-header .logo {
  order: 1;
}

.site-header .account-nav {
  order: 2;
  margin-left: auto; /* push it to the right */
}

.site-header .nav-toggle {
  order: 3;
  margin-left: 0.5rem; /* small space after account icon */
}

/* Logo sizing */
.site-header .logo img {
  height: 24px;
  width: auto;
}

/* Center flex children vertically */
.site-header .logo,
.site-header .nav-toggle,
.site-header .account-nav {
  display: flex;
  align-items: center;
}

/* =========================
   HAMBURGER TOGGLE
========================= */
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 36px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  background: var(--nav-hamburger);
  height: 3px;
  width: 24px;
  border-radius: 2px;
  position: absolute;
  transition: all 0.3s ease;
}

.nav-toggle span::before {
  content: '';
  top: -8px;
}

.nav-toggle span::after {
  content: '';
  top: 8px;
}

.nav-toggle.active span {
  background: transparent;
}

.nav-toggle.active span::before {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span::after {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* =========================
   PRIMARY NAV (slide from left)
========================= */
.primary-nav {
  position: fixed;
  top: 50px;
  left: 0;
  width: 75%;
  height: calc(100vh - 50px);
  background: var(--nav-child-bg);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1050;
  padding: 1rem;
}

.primary-nav.open {
  transform: translateX(0);
}

.primary-nav ul {
  list-style: none;
}

.primary-nav li {
  margin-bottom: 0.25rem;
  position: relative;
}

.primary-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--nav-link);
  text-decoration: none;
  border-radius: 3px;
}

.primary-nav a:hover {
  background: var(--nav-hover);
  color: var(--nav-link-hover);
}

/* Dropdowns */
.has-children > a::after {
  content: '>';
  float: right;
  transition: transform 0.3s ease;
}

.has-children.open > a::after {
  transform: rotate(90deg);
}

.has-children ul {
  display: none;
  padding-left: 1rem;
  margin-top: 0.25rem;
}

.has-children.open ul {
  display: block;
}

/* =========================
   ACCOUNT NAV (RIGHT)
========================= */
.account-nav ul {
  list-style: none;
}

.account-nav li {
  position: relative;
}

.account-nav > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--nav-account-text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
}

.account-nav img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.account-nav li ul {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--nav-account-bg);
  min-width: 180px;
  list-style: none;
  display: none;
  border: 1px solid var(--nav-account-bg);
}

.account-nav li:hover ul {
  display: block;
}

.account-nav li ul a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--nav-account-link);
  text-decoration: none;
}

.account-nav li ul a:hover {
  background: var(--nav-account-hover);
  color: var(--nav-account-link-hover);
}

/* =========================
   Account Icon (Pure CSS)
========================= */
.account-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-block;
  cursor: pointer;
}

/* Head */
.account-head {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #e6e6e6;
  border-radius: 50%;
  transform: translateX(-50%);
}

/* Body / shoulders */
.account-body {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 18px;
  height: 12px;
  background: #e6e6e6;
  border-radius: 10px 10px 4px 4px;
  transform: translateX(-50%);
}

/* Hover effect */
.account-icon:hover .account-head,
.account-icon:hover .account-body {
  background: var(--accent-color);
}

/* Logged-in status dot */
.account-icon.logged-in::after {
  content: "";
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(122, 162, 255, 0.8);
}

/* =========================
   PAGE CONTENT
========================= */
.site-content {
  padding-top: 50px; /* below header */
}
