/* ================== ARSVISIO · navbar.css ================== */

/**
 * Barra de navegación principal
 * - Topbar con logo (visible solo arriba)
 * - Navbar sticky al hacer scroll con logo integrado
 * - Menú móvil a pantalla completa
 */

/* ================== Header contenedor ================== */
header {
  position: relative;
  z-index: 1000;
}

/* ================== Topbar (logo grande) ================== */
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  transition: all 0.25s ease;
  overflow: hidden;
}

.topbar a {
  display: inline-block;
}

/* ================== Logo principal ================== */
.logo {
  height: 100px;
  width: auto;
  display: block;
  transition: transform 0.5s ease;
}

.logo:hover {
  transform: rotate(360deg) scale(1.05);
}

/* ================== Logo en navbar (pequeño) ================== */
.navbar-logo-link {
  display: none;
  align-items: center;
  margin-right: 1rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar-logo {
  height: 36px;
  width: auto;
  display: block;
  filter: brightness(0);
  transition: transform 0.15s ease;
}

.navbar-logo:hover {
  transform: scale(1.1) !important;
}

/* ================== Navbar Desktop ================== */
.navbar {
  background-color: var(--c-deep);
  position: relative;
  z-index: 100;
  transition: all 0.25s ease;
}

.navbar > ul {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  list-style: none;
  transition: all 0.25s ease;
}

.navbar > ul > li {
  position: relative;
  flex: 1 1 0;
  min-width: 180px;
  text-align: center;
  transition: all 0.25s ease;
}

.navbar > ul > li > a {
  display: inline-block;
  background-color: var(--c-cyan);
  color: #000;
  font-weight: bold;
  font-size: 1rem;
  padding: 0.7rem 1.2rem;
  text-decoration: none;
  border-radius: 4px 4px 0 0;
  margin: 0.3rem 0;
  transition: all 0.15s ease;
  transform: translateY(0);
}

.navbar > ul > li > a:hover {
  background-color: var(--c-cyan-dark);
  color: var(--c-text);
  transform: translateY(-2px);
}

/* ================== Submenú ================== */
.submenu {
  display: none !important;
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  top: calc(100% - 3px);
  width: 180px;
  background: var(--c-cyan);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 200;
  padding: 0;
  padding-top: 3px;
  margin: 0;
  list-style: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Zona de hover extendida */
.navbar > ul > li::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  width: 180px;
  height: 15px;
  background: transparent;
}

.navbar > ul > li:hover > .submenu {
  display: flex !important;
  flex-direction: column;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.submenu li {
  width: 100%;
}

.submenu li a {
  display: block;
  background: var(--c-cyan);
  color: #000;
  padding: 0.7rem 1rem;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: all 0.1s ease;
}

.submenu li a:hover {
  background: var(--c-cyan-dark);
  color: #fff;
  padding-left: 1.3rem;
}

.submenu li:last-child a {
  border-radius: 0 0 8px 8px;
}

/* ================== NAVBAR STICKY (al hacer scroll) ================== */

/* Placeholder fijo para evitar salto de contenido */
.navbar-placeholder {
  display: none;
  height: 0;
}

header.scrolled .navbar-placeholder {
  display: block;
  height: 46px;
}

header.scrolled .topbar {
  max-height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

header.scrolled .navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  padding: 0.25rem 1rem;
}

header.scrolled .navbar > ul {
  justify-content: center;
  flex: 1;
}

header.scrolled .navbar > ul > li {
  flex: 0 0 auto;
  min-width: auto;
}

header.scrolled .navbar > ul > li > a {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  margin: 0.15rem 0.05rem;
  border-radius: 4px;
}

/* Logo en navbar cuando está en scroll */
header.scrolled .navbar-logo-link {
  display: flex;
  opacity: 1;
  transform: translateX(0);
}

/* ================== Botón hamburguesa (móvil) ================== */
.menu-toggle {
  display: none;
  background: var(--c-cyan);
  color: #000;
  font-weight: 700;
  padding: 0 1.25rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  min-height: 56px;
}

.menu-toggle:hover {
  background: var(--c-cyan-dark);
  color: var(--c-text);
}

.menu-toggle:active {
  transform: scale(0.98);
}

/* ================== Estilos móviles ================== */
@media (max-width: 768px) {
  .topbar {
    display: none;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    letter-spacing: 0.08em;
  }

  .navbar {
    display: none !important;
  }

  .navbar-placeholder {
    display: block;
    height: 56px;
  }

  header.scrolled .navbar-placeholder {
    height: 56px;
  }
}

/* ================== Menú móvil (overlay) ================== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  color: var(--c-text);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-menu.open {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--c-deep);
}

.mobile-menu-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.mobile-menu-close {
  background: var(--c-cyan);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-menu-close:hover {
  background: var(--c-cyan-dark);
  color: var(--c-text);
  transform: scale(1.05);
}

.mobile-menu-content {
  padding: 1rem 1rem 3rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.mobile-menu section {
  margin: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.8rem;
}

.mobile-menu h3 {
  margin: 0.2rem 0 0.6rem;
  color: var(--c-cyan);
  font-size: 1.1rem;
}

.mobile-menu a {
  display: block;
  color: var(--c-text);
  text-decoration: none;
  padding: 0.9rem 0;
  padding-left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
  transition: all 0.15s ease;
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.04);
  padding-left: 0.5rem;
  color: var(--c-cyan);
}

/* Esconde elementos móviles en desktop */
@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }
}
