/**
 * Artsupp Top Header - Desktop Navigation & User Profile Menu
 * Design System Coerente: Dark Glassmorphism, Deep Navy (#011019 / #031c26), Teal Accent (#01D8C0), Blue (#2677A7)
 */

/* ── CONTENITORE HEADER SUPERIORE FISSO ─────────────────── */
.as-top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 68px;
  background: rgba(1, 16, 25, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  z-index: 1050;
  display: flex;
  align-items: center;
  font-family: 'Inter', var(--font-ui, system-ui, sans-serif);
}

.as-top-header .as-header-container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ── SX: LOGO ────────────────────────────────────────────── */
.as-top-header .as-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.as-top-header .as-header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.as-top-header .as-header-logo:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.as-top-header .as-header-logo img {
  height: 28px;
  width: auto;
  display: block;
}

/* ── CENTRO: CERCA AI (Nelle pagine interne) ─────────────── */
.as-top-header .as-header-center {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.as-top-header .as-header-search-form {
  width: 100%;
  margin: 0;
}

.as-top-header .as-header-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 5px 12px;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.as-top-header .as-header-search-box:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.as-top-header .as-header-search-box:focus-within {
  background: rgba(3, 28, 42, 0.96);
  border-color: rgba(1, 216, 192, 0.65);
  box-shadow: 0 0 0 3px rgba(1, 216, 192, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.as-top-header .as-header-search-ico {
  color: #01d8c0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.as-top-header .as-header-search-box:focus-within .as-header-search-ico {
  opacity: 1;
}

.as-top-header .as-header-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.4;
  padding: 2px 0;
  min-width: 0;
}

.as-top-header .as-header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.as-top-header .as-header-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(1, 216, 192, 0.2), rgba(38, 119, 167, 0.3));
  border: 1px solid rgba(1, 216, 192, 0.4);
  color: #01d8c0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.as-top-header .as-header-ai-badge:hover {
  background: #01d8c0;
  border-color: #01d8c0;
  color: #011019;
  box-shadow: 0 0 12px rgba(1, 216, 192, 0.4);
  transform: translateY(-0.5px);
}

/* ── DX: ESPLORA / ACCEDI / PROFILO / LINGUA ────────────── */
.as-top-header .as-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Pulsante ESPLORA (Capsule Pill Blu con icona bussola) */
.as-btn-esplora {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2677A7;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 16px 6px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(38, 119, 167, 0.35);
}

.as-btn-esplora:hover {
  background: #2f8ec5;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(38, 119, 167, 0.55);
  transform: translateY(-1px);
  color: #ffffff !important;
}

.as-btn-esplora-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.as-btn-esplora-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.as-btn-esplora-text {
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

/* Login button (se non loggato) */
.as-nav-btn-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  background: rgba(38, 119, 167, 0.25);
  border: 1px solid rgba(38, 119, 167, 0.5);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.as-nav-btn-login:hover {
  background: #2677A7;
  border-color: #2677A7;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(38, 119, 167, 0.35);
  transform: translateY(-1px);
}

/* ── SELETTORE LINGUA DARK CAPSULE (Universale Header & Footer) ── */
.as-header-lang {
  position: relative;
  display: flex;
  align-items: center;
}

.as-lang-pill-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 14px;
  color: #ffffff;
  font-family: 'Inter', var(--font-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.as-lang-pill-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.as-lang-chevron {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease;
}

.as-header-lang.active .as-lang-chevron {
  transform: rotate(180deg);
}

.as-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #031c26;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 5px;
  min-width: 80px;
  z-index: 1200;
  flex-direction: column;
  gap: 2px;
}

.as-lang-dropdown.as-lang-dropdown-up {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.8) !important;
}

.as-header-lang.active .as-lang-dropdown {
  display: flex;
}

.as-lang-option {
  padding: 7px 12px;
  border-radius: 8px;
  font-family: 'Inter', var(--font-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

.as-lang-option:hover {
  background: rgba(1, 216, 192, 0.15);
  color: #01d8c0;
}

/* ── TRIGGER AVATAR UTENTE (HEADER) ──────────────────────── */
.as-user-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.as-avatar-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
  transition: opacity 0.2s ease;
}

.as-avatar-trigger:hover {
  opacity: 0.9;
}

.as-avatar-trigger .as-header-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(1, 216, 192, 0.6);
  object-fit: cover;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.as-avatar-trigger:hover .as-header-avatar-img {
  border-color: #01d8c0;
  box-shadow: 0 0 12px rgba(1, 216, 192, 0.35);
  transform: scale(1.04);
}

.as-avatar-chevron {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.6);
  transition: transform 0.2s ease;
}

/* ── POPUP MENU UTENTE (CARD DARK GLASSMORPHISM) ────────── */
#MenuMuseum,
.as-user-menu-card,
.MenuMuseum {
  display: none;
  position: absolute !important;
  top: calc(100% + 12px) !important;
  right: 0 !important;
  left: auto !important;
  bottom: auto !important;
  width: 275px !important;
  min-width: 275px !important;
  max-width: 275px !important;
  background: #031c26 !important;
  background: linear-gradient(165deg, rgba(4, 30, 44, 0.98), rgba(2, 16, 24, 0.98)) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(1, 216, 192, 0.1) !important;
  padding: 18px 14px 14px 14px !important;
  z-index: 1200 !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  box-sizing: border-box !important;
}

/* Reset per tutti gli elementi del popup */
#MenuMuseum *,
.as-user-menu-card * {
  box-sizing: border-box !important;
}

/* Sezioni interne */
.as-user-menu-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.as-user-menu-title,
#MenuMuseum h3 {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin: 0 0 6px 4px !important;
  padding: 0 !important;
  line-height: normal !important;
}

/* Righe interattive (Profilo Utente & Musei Gestiti) */
.as-user-profile-row,
.as-user-partner-row,
#MenuMuseum .line-profile,
#MenuMuseum .managed_list a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  text-decoration: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.as-user-profile-row:hover,
.as-user-partner-row:hover,
#MenuMuseum .line-profile:hover,
#MenuMuseum .managed_list a:hover {
  background: rgba(1, 216, 192, 0.12) !important;
  border-color: rgba(1, 216, 192, 0.45) !important;
  box-shadow: 0 2px 10px rgba(1, 216, 192, 0.12) !important;
}

/* Contenitore singolo avatar circolare */
.as-user-row-avatar {
  flex-shrink: 0 !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

.as-user-row-avatar .user_avater,
#MenuMuseum .managed_list img,
#MenuMuseum .managed_list .user_avater {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  border-radius: 50% !important;
  border: 1.5px solid rgba(1, 216, 192, 0.6) !important;
  object-fit: cover !important;
  background: #031c26 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  display: block !important;
  box-sizing: border-box !important;
}

.as-user-row-info {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  overflow: hidden !important;
  text-align: left !important;
}

.as-user-name,
#MenuMuseum .line-profile span,
#MenuMuseum .managed_list span {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
  text-align: left !important;
  display: block !important;
  width: 100% !important;
}

.as-user-sub {
  font-size: 11px !important;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.45) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.as-user-row-arrow {
  color: rgba(255, 255, 255, 0.35) !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}

.as-user-profile-row:hover .as-user-row-arrow,
.as-user-admin-row:hover .as-user-row-arrow,
.as-user-partner-row:hover .as-user-row-arrow {
  color: #01d8c0 !important;
  transform: translateX(2px) !important;
}

/* ── SEZIONE I MIEI MUSEI / GESTIONE PARTNER ─────────────── */
.as-user-section-mgmt {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

#MenuMuseum .managed_list,
.as-user-menu-card .managed_list {
  width: 100% !important;
  max-width: 100% !important;
  max-height: 180px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 2px 1px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Scrollbar dark discreta a capsula */
#MenuMuseum .managed_list::-webkit-scrollbar,
.as-user-menu-card .managed_list::-webkit-scrollbar {
  width: 4px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: none !important;
  border-radius: 999px !important;
}

#MenuMuseum .managed_list::-webkit-scrollbar-thumb,
.as-user-menu-card .managed_list::-webkit-scrollbar-thumb {
  background: rgba(1, 216, 192, 0.35) !important;
  border-radius: 999px !important;
}

#MenuMuseum .managed_list::-webkit-scrollbar-thumb:hover,
.as-user-menu-card .managed_list::-webkit-scrollbar-thumb:hover {
  background: #01d8c0 !important;
}

/* Sezione Admin / Backend */
.as-user-admin-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 10px !important;
  border-radius: 12px !important;
  background: rgba(38, 119, 167, 0.12) !important;
  border: 1px solid rgba(38, 119, 167, 0.25) !important;
  text-decoration: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

.as-user-admin-row:hover {
  background: rgba(38, 119, 167, 0.25) !important;
  border-color: rgba(38, 119, 167, 0.5) !important;
}

.as-admin-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(38, 119, 167, 0.3) !important;
  color: #5bc0de !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.as-admin-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #e6edf3 !important;
  line-height: 1.3 !important;
}

.as-admin-sub {
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.45) !important;
  line-height: 1.2 !important;
}

/* Footer Menu / Logout */
.as-user-menu-footer {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.as-user-logout-btn,
#MenuMuseum .logoutForm button {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #ff6b6b !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.as-user-logout-btn:hover,
#MenuMuseum .logoutForm button:hover {
  background: rgba(255, 107, 107, 0.1) !important;
  border-color: rgba(255, 107, 107, 0.25) !important;
  color: #ff8585 !important;
}

/* ── RESPONSIVE RULES & DESKTOP SWITCH ──────────────────── */
@media (min-width: 992px) {
  body {
    padding-top: 68px !important;
  }
  
  .as-top-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1050 !important;
  }

  /* Nascondi la vecchia barra laterale e la vecchia topbar mobile */
  .sideNav {
    display: none !important;
  }
  .sideMenu {
    display: none !important;
  }
  .topbar {
    display: none !important;
  }

  /* Nascondi bottom navigation su desktop */
  .as-mobile-bottom-nav {
    display: none !important;
  }
  
  /* Reset offset laterali 80px */
  .offset-md-1 {
    margin-left: 0 !important;
  }
  .w-card-artisti {
    padding-left: 0 !important;
  }
  .carosello, .carosello-bello {
    padding-left: 0 !important;
  }
  .account-main-content {
    margin-left: 0 !important;
  }
}

/* ── MOBILE BEHAVIOR (< 992px) ──────────────────────────── */
.as-mobile-bottom-nav {
  display: none;
}

@media (max-width: 991.98px) {
  /* Default per pagine ordinarie non ancora migrate */
  body:not(.is-homepage-view):not(.has-new-mobile-header) .as-top-header {
    display: none !important;
  }
  body:not(.is-homepage-view):not(.has-new-mobile-header) .as-mobile-bottom-nav {
    display: none !important;
  }

  /* ── NUOVA NAVIGAZIONE MOBILE (Homepage e rollout futuro) ── */
  body.is-homepage-view,
  body.has-new-mobile-header {
    padding-top: 60px !important;
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Disattiva la vecchia topbar e la vecchia bottom bar sideNav su mobile */
  body.is-homepage-view .topbar,
  body.has-new-mobile-header .topbar {
    display: none !important;
  }
  body.is-homepage-view .sideNav,
  body.has-new-mobile-header .sideNav {
    display: none !important;
  }
  body.is-homepage-view .sideMenu,
  body.has-new-mobile-header .sideMenu {
    display: none !important;
  }

  /* 1. TOP HEADER MOBILE: Sfondo Deep Navy (#011218), Logo a SX, Utente a DX */
  body.is-homepage-view .as-top-header,
  body.has-new-mobile-header .as-top-header {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: #011218 !important;
    background: rgba(1, 18, 24, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45) !important;
    z-index: 1050 !important;
    padding: 0 !important;
  }

  body.is-homepage-view .as-top-header .as-header-container,
  body.has-new-mobile-header .as-top-header .as-header-container {
    position: relative !important;
    padding: 0 16px !important;
    gap: 12px !important;
    justify-content: flex-end !important;
    height: 100% !important;
    width: 100% !important;
  }

  /* Logo Artsupp centrato su mobile */
  body.is-homepage-view .as-top-header .as-header-left,
  body.has-new-mobile-header .as-top-header .as-header-left {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1 !important;
    pointer-events: auto !important;
  }

  body.is-homepage-view .as-top-header .as-header-logo img,
  body.has-new-mobile-header .as-top-header .as-header-logo img {
    height: 24px !important;
    width: auto !important;
    display: block !important;
  }

  /* In mobile top bar nascondiamo Esplora e Lingua (Esplora è nella bottom bar) */
  body.is-homepage-view .as-top-header .as-btn-esplora,
  body.has-new-mobile-header .as-top-header .as-btn-esplora {
    display: none !important;
  }

  /* In mobile la ricerca è sempre nella bottom bar, mai nel top header */
  body.is-homepage-view .as-top-header .as-header-center,
  body.has-new-mobile-header .as-top-header .as-header-center {
    display: none !important;
  }

  body.is-homepage-view .as-top-header .as-header-lang,
  body.has-new-mobile-header .as-top-header .as-header-lang {
    display: none !important;
  }

  body.is-homepage-view .as-top-header .as-header-right,
  body.has-new-mobile-header .as-top-header .as-header-right {
    margin-left: auto !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    z-index: 2 !important;
  }

  /* Pulsante Accedi compatto per mobile se non loggato */
  body.is-homepage-view .as-nav-btn-login,
  body.has-new-mobile-header .as-nav-btn-login {
    padding: 5px 12px !important;
    font-size: 12px !important;
    gap: 5px !important;
  }

  /* Popup profilo utente (#MenuMuseum) su mobile */
  body.is-homepage-view #MenuMuseum,
  body.is-homepage-view .as-user-menu-card,
  body.is-homepage-view .MenuMuseum,
  body.has-new-mobile-header #MenuMuseum,
  body.has-new-mobile-header .as-user-menu-card,
  body.has-new-mobile-header .MenuMuseum {
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    width: min(290px, calc(100vw - 24px)) !important;
    max-width: min(290px, calc(100vw - 24px)) !important;
  }

  /* 2. BOTTOM NAVIGATION BAR MOBILE: 3 sezioni bilanciate (Home, Esplora, Cerca) */
  body.is-homepage-view .as-mobile-bottom-nav,
  body.has-new-mobile-header .as-mobile-bottom-nav {
    display: block !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: #011218 !important;
    background: rgba(1, 18, 24, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45) !important;
    z-index: 1050 !important;
    font-family: 'Inter', var(--font-ui, system-ui, sans-serif) !important;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
  }

  /* Estensione protettiva sfondo sotto la barra per assorbire lo scroll di toolbar native (es. Chrome iOS) */
  body.is-homepage-view .as-mobile-bottom-nav::after,
  body.has-new-mobile-header .as-mobile-bottom-nav::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 120px;
    background: #011218;
    pointer-events: none;
  }

  .as-mobile-bottom-nav .as-bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 62px;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 8px;
  }

  .as-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.60) !important;
    transition: color 0.15s ease, transform 0.15s ease;
    padding: 6px 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .as-bottom-nav-item:active {
    transform: scale(0.93);
  }

  .as-bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: currentColor;
    transition: color 0.15s ease;
  }

  .as-bottom-nav-icon svg {
    width: 22px;
    height: 22px;
    display: block;
  }

  .as-bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    color: currentColor;
  }

  /* Icone a contorno coerenti, selezione e hover/tocco tutti verdi (icona + scritta), senza bagliore,
     senza icona piena e senza pillola; il selezionato ha la scritta in grassetto (richiesta jmagrini #58, 2026-10-27) */
  .as-bottom-nav-item { gap: 3px; padding: 6px 0 4px; }
  .as-bottom-nav-icon svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: none; }
  /* neutralizza la regola globale che forza bianche le icone SVG */
  .as-bottom-nav-icon svg, .as-bottom-nav-icon svg * { color: inherit !important; stroke: currentColor !important; fill: none !important; }
  .as-bottom-nav-label { font-family: 'Fira Sans', system-ui, sans-serif; font-size: 10.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
  .as-bottom-nav-item.active,
  .as-bottom-nav-item:hover:not(.active),
  .as-bottom-nav-item:active:not(.active) { color: #01D8C0 !important; }
  .as-bottom-nav-item.active .as-bottom-nav-label,
  .as-bottom-nav-item:hover:not(.active) .as-bottom-nav-label,
  .as-bottom-nav-item:active:not(.active) .as-bottom-nav-label { color: #01D8C0 !important; }
  .as-bottom-nav-item.active .as-bottom-nav-label { font-weight: 700; }
  .as-bottom-nav-item.active .as-bottom-nav-icon svg { filter: none; }
}


/* Menu avatar: intestazione con nome/email e righe Messaggi / Impostazioni (richiesta jmagrini #80) */
.as-user-menu-head {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 16px; text-decoration: none;
}
.as-user-menu-head .as-user-sub { font-size: 12px !important; color: rgba(255, 255, 255, 0.6) !important; }
.as-user-menu-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 10px;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 14px; font-weight: 500;
  color: rgba(255, 255, 255, 0.85); text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.as-user-menu-link:hover { background: var(--surface-2, rgba(255,255,255,.06)); color: #fff; }
.as-user-menu-link svg { flex: 0 0 18px; opacity: .8; }
