:root {
  /* --- CORES --- */
  --rm-bg: rgba(0,0,0,0.5);
  --rm-text: #1a1a1a;
  --rm-accent: #007aff; 
  --rm-border: #eeeeee;
  
  /* Visual dos Sub-itens (Mobile) */
  --rm-sub-bg: rgba(0,0,0,0.5);       /* Fundo cinza claro para destacar */
  --rm-sub-border: #e0e0e0;   /* Borda sutil */
  --rm-sub-indent: 20px;      /* Quanto o texto entra */
  
  /* --- HAMBURGER --- */
  --rm-bar-width: 26px;
  --rm-bar-height: 2px;
  --rm-bar-gap: 5px;
  
  /* --- ANIMAÇÃO --- */
  --rm-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --rm-speed: 0.3s;
  
  --rm-mobile-breakpoint: 1024px;
}

/* =========================================
   1. BASE
   ========================================= */
.rm-navbar {
  position: relative;
  background: var(--rm-bg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-family: system-ui, -apple-system, sans-serif;
  z-index: 500;
}

.rm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

.rm-link {
  text-decoration: none;
  color: var(--rm-text);
  font-weight: 500;
  display: block;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.rm-link:hover, .rm-link.is-active {
  color: var(--rm-accent);
}

/* =========================================
   2. HAMBURGER
   ========================================= */
.rm-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 15px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--rm-bar-gap);
  z-index: 502;
}

.rm-icon-bar {
  display: block;
  width: var(--rm-bar-width);
  height: var(--rm-bar-height);
  background-color: var(--rm-text);
  border-radius: 2px;
  transition: all var(--rm-speed) var(--rm-ease);
}

/* Hamburger -> X */
.rm-toggle[aria-expanded="true"] .rm-icon-bar:nth-child(1) {
  transform: translateY(calc(var(--rm-bar-height) + var(--rm-bar-gap))) rotate(45deg);
}
.rm-toggle[aria-expanded="true"] .rm-icon-bar:nth-child(2) {
  opacity: 0;
}
.rm-toggle[aria-expanded="true"] .rm-icon-bar:nth-child(3) {
  transform: translateY(calc((var(--rm-bar-height) + var(--rm-bar-gap)) * -1)) rotate(-45deg);
}

/* =========================================
   3. MOBILE (Simplificado: Tudo Aberto)
   ========================================= */
@media (max-width: 1024px) {
  .rm-toggle { display: flex; }

  /* Drawer Principal */
  .rm-menu-container {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--rm-bg);
    border-top: 1px solid var(--rm-border);
    
    /* Animação Slide Down */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--rm-speed) var(--rm-ease);
    
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    max-height: 80vh;
    overflow-y: auto; /* Scroll se o menu for grande */
  }

  .rm-menu-container.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .rm-list { flex-direction: column; }

  .rm-item { border-bottom: 1px solid var(--rm-border); }
  .rm-item:last-child { border-bottom: none; }

  /* Link Principal (Nível 1) */
  .rm-link {
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
  }

  /* --- HIERARQUIA VISUAL --- */
  
  /* Esconde os botões de toggle (setinhas) pois tudo estará aberto */
  .rm-submenu-toggle { display: none !important; }

  /* Container do Submenu (Sempre visível) */
  .rm-submenu {
    display: block !important; /* Força visibilidade */
    position: static;
    box-shadow: none;
    background-color: var(--rm-sub-bg); /* Fundo diferenciado */
    border-top: 1px solid var(--rm-sub-border);
  }
  
  /* Reseta layout do submenu para lista simples */
  .rm-submenu .rm-list {
    display: flex;
    flex-direction: column;
  }

  /* Links Nível 2 (Filhos) */
  .rm-submenu .rm-link {
    padding: 12px 20px 12px 40px; /* Mais recuo à esquerda */
    font-size: 15px;
    font-weight: 400; /* Fonte normal */
    color: #444; /* Cor levemente mais suave */
  }
  
  /* Links Nível 3 (Netos) - Caso existam */
  .rm-submenu .rm-submenu .rm-link {
    padding-left: 60px; /* Recuo duplo */
    background-color: #f0f0f0; /* Fundo levemente mais escuro */
  }
}

/* =========================================
   4. DESKTOP
   ========================================= */
@media (min-width: 1024px) {
  .rm-navbar {
    display: flex;
    /* justify-content: flex-end; */
    justify-content: space-between;
    padding: 0 20px;
  }
  
  .rm-link { padding: 20px 15px; }
  .rm-item { position: relative; }
  
  /* Toggle button sumiu */
  .rm-submenu-toggle { display: none; }

  /* Submenu Dropdown */
  .rm-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: var(--rm-bg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 0 0 6px 6px;
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 100;
  }
  
  .rm-submenu .rm-list { flex-direction: column; }
  
  .rm-item:hover > .rm-submenu,
  .rm-item:focus-within > .rm-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .rm-submenu .rm-link { padding: 12px 20px; font-size: 14px; }
  .rm-submenu .rm-link:hover { background-color: var(--rm-sub-bg); }
}