.public-layout {
  background-color: #ffffff;
  color: var(--text-secondary);
  font-family: var(--font-sans);
}

/* ==========================================================================
   --- Main Header (Mobile-First) ---
   ========================================================================== */
.main-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  height: 65px;
  display: flex;
  align-items: center;
  z-index: 1000;
}

.header-container {
  width: 100%;
  max-width: var(--max-width-grid);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand a {
  text-decoration: none;
  color: var(--brand-navy);
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  align-items: center;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  z-index: 1010;
}

.logo span.azul {
  color: var(--brand);
}

.logo-icon,
.logo-dorado {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.badge-platform {
  display: none; /* Ocultamos el badge en móvil para limpiar el diseño */
}

/* PANEL DEL MENÚ DESPLEGABLE (CORTINA MÓVIL) */
.main-nav {
  position: fixed;
  top: 0;
  right: -100%; /* Escondido a la derecha por defecto */
  width: 280px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 1020;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* Apertura mediante :target */
.main-nav:target {
  right: 0;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 60px 24px 24px 24px;
  display: flex;
  flex-direction: column; /* Columna en móvil */
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
}

.main-nav li {
  width: 100%;
}

.nav-link,
.btn-login-navbar,
.btn-register-navbar {
  text-decoration: none;
  display: block;
  width: 100%;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: #334155;
  transition: color 0.2s;
}

.btn-login-navbar {
  border: 1px solid var(--brand);
  padding: 10px 16px;
  border-radius: 6px;
  color: var(--brand);
  text-align: center;
  font-weight: 600;
  margin-top: 15px;
}

.btn-register-navbar {
  background-color: var(--brand-blue-hover);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

/* BOTONES HAMBURGUESA */
.menu-burger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  z-index: 1030;
}

.menu-burger span {
  width: 25px;
  height: 3px;
  background-color: var(--brand-navy);
  border-radius: 3px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.burger-close {
  display: none;
}

/* Control con :has() usando el id correcto de tu menú */
.main-header:has(.main-nav:target) .burger-open {
  display: none;
}

.main-header:has(.main-nav:target) .burger-close {
  display: flex;
}

.burger-close span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger-close span:nth-child(2) {
  opacity: 0;
}
.burger-close span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   VISTA DE ESCRITORIO: A partir de 768px
   ========================================================================== */
@media (min-width: 768px) {
  .main-header {
    height: auto;
  }

  .header-container {
    padding: 1.25rem 2rem;
  }

  .brand h1 {
    font-size: 1.4rem; /* Recupera su tamaño original en escritorio */
  }

  .menu-burger {
    display: none !important;
  }

  .logo-dorado {
    width: 40px; /* Recupera el tamaño original */
  }

  .badge-platform {
    display: inline-block; /* Reaparece de forma limpia al lado del título */
    font-size: 0.75rem;
    background-color: #ebf8ff;
    color: #2b6cb0;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #bee3f8;
  }

  /* Restauración de barra horizontal estable */
  .main-nav {
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
    overflow-y: visible;
  }

  .main-nav ul {
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: 1.75rem;
  }

  .main-nav li {
    width: auto;
  }

  .nav-link {
    color: var(--text-gray-links);
    font-size: 14px;
    padding: 0;
  }

  .nav-link:hover {
    color: var(--brand-blue-hover);
  }

  .btn-login-navbar {
    border: none;
    padding: 0;
    color: var(--text-gray-links);
    width: auto;
    margin-top: 0;
  }

  .btn-register-navbar {
    background-color: var(--brand-blue-hover);
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    width: auto;
  }
}

/* --- Main Footer --- */
.main-footer {
  background-color: #111827;
  color: #9ca3af;
  padding: 5rem 2rem 2rem 2rem;
  margin-top: 6rem;
  border-top: 1px solid #1f2937;
}

.footer-container {
  max-width: var(--max-width-grid);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid #1f2937;
}

.footer-brand-column {
  max-width: 360px;
  flex: 1 1 300px;
}

.footer-logo {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
}

.footer-tagline {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #9ca3af;
}

.footer-links-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 160px;
}

.footer-links-column h4 {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.footer-links-column nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-link {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  width: fit-content;
}

.footer-link:hover {
  color: #3b82f6;
}

.footer-bottom {
  max-width: var(--max-width-grid);
  margin: 2rem auto 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
}
