/* ===========================
   MOBILE MENU
=========================== */

/* --- Overlay --- */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}

body.mobile-nav-open .mobile-nav-overlay {
  opacity: 1;
  visibility: visible;
}

/* --- Panel --- */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 85vw;
  max-width: 380px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

body.mobile-nav-open .mobile-nav {
  transform: translateX(0);
}

/* Prevent scroll when open */
body.mobile-nav-open {
  overflow: hidden;
}

/* Hide sticky phone CTA when menu is open */
body.mobile-nav-open .sticky-phone-cta {
  display: none;
}

/* --- Header (close button) --- */
.mobile-nav__header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 8px;
  flex-shrink: 0;
}

.mobile-nav__close {
  background: none;
  border: none;
  font-size: 22px;
  color: #333;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.mobile-nav__close:hover {
  color: var(--primary);
}

/* --- Body (scrollable menu) --- */
.mobile-nav__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 20px;
}

/* --- Menu reset --- */
.mobile-nav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav__submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.mobile-nav__submenu.is-open {
  max-height: 1000px;
}

/* --- Menu items --- */
.mobile-nav__item {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-nav__submenu .mobile-nav__item {
  border-bottom: 1px solid #f5f5f5;
}

.mobile-nav__submenu .mobile-nav__item:last-child {
  border-bottom: none;
}

/* --- Link row (link + chevron toggle) --- */
.mobile-nav__link-row {
  display: flex;
  align-items: center;
}

.mobile-nav__link-row .mobile-nav__link {
  flex: 1;
}

/* --- Links --- */
.mobile-nav__link {
  display: block;
  padding: 14px 20px;
  color: #333;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-nav__link:hover {
  background: #f8f8f8;
  color: var(--primary);
}

/* Level 1 children (indented) */
.mobile-nav__submenu--level-1 .mobile-nav__link {
  padding-left: 36px;
  font-weight: 400;
  font-size: 15px;
  color: #555;
}

/* Level 2 grandchildren (more indent) */
.mobile-nav__submenu--level-2 .mobile-nav__link {
  padding-left: 52px;
  font-weight: 400;
  font-size: 14px;
  color: #666;
}

/* Level 1 submenu background */
.mobile-nav__submenu--level-1 {
  background: #fafafa;
}

/* Level 2 submenu background */
.mobile-nav__submenu--level-2 {
  background: #f5f5f5;
}

/* --- Chevron toggle --- */
.mobile-nav__toggle {
  background: none;
  border: none;
  border-left: 1px solid #f0f0f0;
  padding: 14px 18px;
  cursor: pointer;
  color: #999;
  font-size: 13px;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.mobile-nav__toggle:hover {
  color: var(--primary);
}

.mobile-nav__toggle i {
  transition: transform 0.3s ease;
  display: block;
}

.mobile-nav__toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

/* --- Footer (CTAs) --- */
.mobile-nav__footer {
  flex-shrink: 0;
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav__phone {
  display: block;
  text-align: center;
  color: var(--primary);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  padding: 8px 0;
}

.mobile-nav__phone i {
  margin-right: 6px;
}

.mobile-nav__cta {
  display: block;
  text-align: center;
  padding: 12px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mobile-nav__cta:hover {
  opacity: 0.85;
}

.mobile-nav__cta--outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.mobile-nav__cta--filled {
  background: var(--secondary);
  color: #fff;
  border: 2px solid var(--secondary);
}

/* --- Hamburger button --- */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  position: relative;
}

.hamburger__line {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

/* Animate to X */
body.mobile-nav-open .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.mobile-nav-open .hamburger__line:nth-child(2) {
  opacity: 0;
}

body.mobile-nav-open .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hide mobile nav on desktop */
@media (min-width: 1276px) {
  .mobile-nav,
  .mobile-nav-overlay {
    display: none !important;
  }
}
