/* Reset & Core Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button, input, select, textarea, summary {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

/* The page scrolls as a document: the footer flows after the content and is
   only reached at the end. `overflow-x: clip` contains horizontal overflow
   without turning html/body into a scroll container, which would break the
   sticky topbar. */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

/* Header Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 32px;
  background-color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  color: var(--text-main);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 28px;
}

.nav-dropdown-chevron {
  width: 13px !important;
  height: 13px !important;
  margin-left: -3px;
  transition: transform 160ms ease;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 130;
  display: grid;
  width: max-content;
  min-width: 220px;
  padding: 7px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .16);
  backdrop-filter: blur(14px);
}

.nav-dropdown-menu::before {
  position: absolute;
  top: -5px;
  left: 24px;
  width: 9px;
  height: 9px;
  content: "";
  border-top: 1px solid rgba(203, 213, 225, .9);
  border-left: 1px solid rgba(203, 213, 225, .9);
  background: white;
  transform: rotate(45deg);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible {
  color: var(--text-main);
  background: #f1f5f9;
  outline: none;
}

.nav-dropdown-item.is-active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-dropdown-item svg {
  width: 16px;
  height: 16px;
}

.prompt-language-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  background: #f8fafc;
  font-size: 14px;
  font-weight: 600;
}

.prompt-language-value svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  height: 44px;
}

.brand-logo-frame {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 88px;
  height: 42px;
  overflow: hidden;
  flex: 0 0 88px;
}

.brand-logo {
  width: 88px;
  height: 42px;
  max-width: 88px;
  max-height: 42px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  border-left: 1px solid var(--border-color);
  padding-left: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  height: 20px;
  text-transform: uppercase;
}

/* En la portada no se muestra la etiqueta de sección («Web»): el resto de
   superficies (analizador, editor, API…) sí la conservan para ubicarse. */
.landing-topbar .brand-text {
  display: none;
}

/* Compact desktop header before reaching the mobile icon-only layout. */
@media (max-width: 1550px) {
  .topbar { padding-inline: 16px; gap: 10px; }
  .topbar-left { min-width: 0; gap: 8px; }
  .brand-text { display: none; }
  .topbar-nav { gap: 3px; margin-left: 10px; }
}

@media (max-width: 1180px) {
  .topbar-nav .nav-link { padding: 6px 8px; }
  .topbar-nav .nav-dropdown-menu span { display: inline; }
  .topbar-nav .nav-dropdown-chevron { display: none; }
}

/* En pantallas estrechas el logotipo se mantiene entero y la navegación se
   desplaza dentro de su carril, en vez de invadir el selector de idioma. */
@media (max-width: 860px) {
  .topbar-left { min-width: 0; }
  .brand { flex: 0 0 auto; }
  .topbar-nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .topbar-nav::-webkit-scrollbar { display: none; }
}

