/* =================================================================
   URBANCE — MOBILE NAV (header, drawer, bottom bar)
   Applies ONLY at ≤ 768px. Desktop is pixel-identical.
   ================================================================= */

/* ─── Desktop: hide mobile-only elements ───────────────────────── */
.mobile-header,
.mobile-drawer,
.mobile-drawer-backdrop,
.mobile-cta-bar {
  display: none;
}

/* ─── Desktop: keep existing floating header visible ───────────── */
@media (min-width: 769px) {
  .hero-nav { display: flex; }
}


/* ================================================================
   MOBILE ONLY  ≤ 768px
   ================================================================ */
@media (max-width: 768px) {

  /* Hide desktop floating header */
  .hero-nav {
    display: none !important;
  }

  /* ── MOBILE HEADER ──────────────────────────────────────────── */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-top));
    padding: 0 20px;
    padding-top: env(safe-area-inset-top);
    background: rgba(255,255,255,0.97);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #EAF2FF;
    z-index: 9999;
    gap: 12px;
  }

  .mobile-header__brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
  }

  .mobile-header__brand img {
    height: 28px;
    width: auto;
    display: block;
  }

  .mobile-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  /* Small Quote pill in header */
  .mobile-header__quote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 16px;
    background: #2F80ED;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 999px;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease;
    box-shadow: 0 2px 10px rgba(47,128,237,0.40);
  }

  .mobile-header__quote-btn:hover,
  .mobile-header__quote-btn:active {
    background: #1e6fd0;
  }

  /* Hamburger toggle */
  .mobile-header__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    gap: 5px;
    border-radius: 8px;
    transition: background 0.15s ease;
  }

  .mobile-header__hamburger:hover,
  .mobile-header__hamburger:active {
    background: #f1f5f9;
  }

  .mobile-header__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #111111;
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.28s ease, width 0.28s ease;
    transform-origin: center;
  }

  .mobile-header__hamburger[aria-expanded="true"] .mobile-header__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-header__hamburger[aria-expanded="true"] .mobile-header__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .mobile-header__hamburger[aria-expanded="true"] .mobile-header__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Compact user avatar in mobile header (when logged in) */
  .mobile-header__user-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border: 2px solid #EAF2FF;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: none; /* shown by JS when logged in */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow 0.18s ease;
  }

  .mobile-header__user-btn.is-visible {
    display: inline-flex;
  }

  .mobile-header__user-btn:hover {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  }

  /* ── DRAWER BACKDROP ────────────────────────────────────────── */
  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* ── DRAWER PANEL ───────────────────────────────────────────── */
  .mobile-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    z-index: 10001;
    background: #ffffff;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    overscroll-behavior: contain;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  }

  .mobile-drawer.is-open {
    transform: translateX(0);
  }

  /* Drawer top row: logo + close */
  .mobile-drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: calc(56px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
  }

  .mobile-drawer__logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
  }

  .mobile-drawer__logo img {
    height: 26px;
    width: auto;
    display: block;
  }

  .mobile-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    color: #475569;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
  }

  .mobile-drawer__close:hover,
  .mobile-drawer__close:active {
    background: #f1f5f9;
    color: #0f172a;
  }

  .mobile-drawer__close svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
  }

  /* Drawer scrollable body */
  .mobile-drawer__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* Drawer section label */
  .mobile-drawer__section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
    padding: 12px 8px 4px;
    margin: 0;
  }

  /* Drawer links */
  .mobile-drawer__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    font-size: 15px;
    font-weight: 500;
    color: #111111;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.14s ease, color 0.14s ease;
    line-height: 1.2;
    min-height: 44px;
  }

  .mobile-drawer__link:hover,
  .mobile-drawer__link:active {
    background: #f1f5f9;
    color: #2F80ED;
  }

  .mobile-drawer__link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #EAF2FF;
    border-radius: 8px;
    flex-shrink: 0;
    color: #2F80ED;
    transition: background 0.14s ease;
  }

  .mobile-drawer__link-icon svg {
    width: 16px;
    height: 16px;
    display: block;
  }

  .mobile-drawer__link:hover .mobile-drawer__link-icon,
  .mobile-drawer__link:active .mobile-drawer__link-icon {
    background: #2F80ED;
    color: #ffffff;
  }

  /* Thin divider */
  .mobile-drawer__divider {
    height: 1px;
    background: #f1f5f9;
    margin: 8px 0;
    flex-shrink: 0;
  }

  /* Drawer CTA block */
  .mobile-drawer__cta {
    padding: 16px;
    flex-shrink: 0;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .mobile-drawer__cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.18s ease, transform 0.15s ease;
    letter-spacing: 0.01em;
  }

  .mobile-drawer__cta-btn--primary {
    background: linear-gradient(135deg, #2F80ED 0%, #1e6fd0 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(47, 128, 237, 0.3);
  }

  .mobile-drawer__cta-btn--primary:hover,
  .mobile-drawer__cta-btn--primary:active {
    background: linear-gradient(135deg, #1e6fd0 0%, #1a5ab8 100%);
    transform: translateY(-1px);
  }

  .mobile-drawer__cta-btn--secondary {
    background: #F5F7FA;
    color: #111111;
    border: 1px solid #e2e8f0;
  }

  .mobile-drawer__cta-btn--secondary:hover,
  .mobile-drawer__cta-btn--secondary:active {
    background: #EAF2FF;
    color: #2F80ED;
  }

  /* ── Auth section — guest (logged out) ───────────────────── */
  .mobile-drawer__auth-guest {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0 12px;
  }

  .mobile-drawer__auth-login {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease;
    min-height: 48px;
    box-sizing: border-box;
  }

  .mobile-drawer__auth-login:hover,
  .mobile-drawer__auth-login:active {
    background: #f8fafc;
    border-color: #cbd5e1;
  }

  .mobile-drawer__auth-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #2F80ED 0%, #1e6fd0 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, transform 0.12s ease;
    min-height: 48px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(47, 128, 237, 0.30), inset 0 1px 0 rgba(255,255,255,0.15);
  }

  .mobile-drawer__auth-signup:hover,
  .mobile-drawer__auth-signup:active {
    background: linear-gradient(135deg, #1e6fd0 0%, #1a5ab8 100%);
    transform: translateY(-1px);
  }

  /* ── Auth section — user (logged in) ──────────────────────── */
  .mobile-drawer__auth-user {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0 12px;
  }

  /* User identity card */
  .mobile-drawer__auth-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #EBF4FF 0%, #f0f7ff 100%);
    border: 1px solid rgba(47, 128, 237, 0.14);
    text-decoration: none;
    color: #111111;
    min-height: 60px;
    box-sizing: border-box;
  }

  /* Avatar circle with initials */
  .mobile-drawer__auth-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2F80ED 0%, #1e6fd0 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(47, 128, 237, 0.35);
  }

  .mobile-drawer__auth-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }

  .mobile-drawer__auth-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .mobile-drawer__auth-sub {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  /* Dashboard + Logout row */
  .mobile-drawer__auth-actions {
    display: flex;
    gap: 10px;
  }

  /* Dashboard button — primary, fills most of the row */
  .mobile-drawer__dashboard-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2F80ED 0%, #1e6fd0 100%);
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, transform 0.12s ease;
    min-height: 46px;
    box-shadow: 0 3px 12px rgba(47, 128, 237, 0.30);
    box-sizing: border-box;
  }

  .mobile-drawer__dashboard-btn:hover,
  .mobile-drawer__dashboard-btn:active {
    background: linear-gradient(135deg, #1e6fd0 0%, #1a5ab8 100%);
    transform: translateY(-1px);
  }

  /* Logout button — ghost, compact */
  .mobile-drawer__signout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #dc2626;
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.14s ease;
    min-height: 46px;
    white-space: nowrap;
  }

  .mobile-drawer__signout:hover,
  .mobile-drawer__signout:active {
    background: #fee2e2;
    border-color: #fca5a5;
  }


  /* ── BOTTOM CTA BAR — hidden on mobile ─────────────────────── */
  .mobile-cta-bar {
    display: none !important;
  }

  .mobile-cta-bar__primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    background: linear-gradient(135deg, #2F80ED 0%, #1e6fd0 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    border-radius: 12px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(47, 128, 237, 0.28);
    transition: background 0.18s ease, transform 0.15s ease;
    white-space: nowrap;
  }

  .mobile-cta-bar__primary:hover,
  .mobile-cta-bar__primary:active {
    background: linear-gradient(135deg, #1e6fd0 0%, #1a5ab8 100%);
    transform: translateY(-1px);
  }

  .mobile-cta-bar__secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 16px;
    background: #F5F7FA;
    color: #111111;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .mobile-cta-bar__secondary:hover,
  .mobile-cta-bar__secondary:active {
    background: #EAF2FF;
    color: #2F80ED;
  }

  /* No bottom padding needed — CTA bar is removed */
  body {
    padding-bottom: 0;
  }

  /* Push page content below the fixed mobile header.
     The mobile-header itself is fixed so skip it and the drawer elements. */
  body {
    padding-top: calc(58px + env(safe-area-inset-top));
  }

  /* Homepage hero fills full bleed — header overlaps the hero image */
  body.page-home {
    padding-top: 0;
  }

} /* end @media (max-width: 768px) */
