/* ===========================================================
   SELECTOR DE SECCIÓN (compartido)
   -----------------------------------------------------------
   Las secciones (/diseno-web, /placas-nfc, /tarjetas) tienen su
   propio nav de anclas internas, así que sin esto no hay forma
   de volver al hub. Se carga DESPUÉS del bundle de cada sección
   (web/nfc/tarjetas) y reutiliza sus tokens: --fg, --line, --gold…
   =========================================================== */

/* Vive dentro de .nav__links, como un enlace más: hereda su
   tipografía y su subrayado dorado al pasar por encima. Lo único
   que lo distingue es la hairline que lo separa del resto. */
.switch {
  position: relative;
  flex: 0 0 auto;
  padding-right: 30px;
  margin-right: -6px;
}
.switch::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 13px;
  background: var(--line-2, rgba(28, 18, 8, .13));
}

.switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  color: inherit;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: color .25s var(--ease, ease);
}
.switch__btn::-webkit-details-marker { display: none; }
.switch__btn:hover { color: var(--fg, #1C1814); }
.switch__btn:focus-visible {
  outline: 2px solid var(--gold, #8C6020);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Mismo subrayado que .nav__links a, que no aplica a <summary>. */
.switch__btn > span { position: relative; }
.switch__btn > span::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 1px;
  background: var(--gold, #8C6020);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease, ease);
}
.switch__btn:hover > span::after,
.switch[open] .switch__btn > span::after { transform: scaleX(1); }

.switch__chev {
  width: 9px;
  height: 9px;
  flex: none;
  opacity: .5;
  transition: transform .3s var(--ease, ease), opacity .25s var(--ease, ease);
}
.switch__btn:hover .switch__chev { opacity: 1; }
.switch[open] .switch__chev { transform: rotate(180deg); opacity: 1; }

.switch__panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  min-width: 268px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line-2, rgba(28, 18, 8, .13));
  background: var(--panel, #fff);
  box-shadow: 0 24px 60px -20px rgba(28, 18, 8, .35);
  animation: switch-in .22s var(--ease, ease) both;
  /* el panel cuelga del nav, que va en versalitas: aquí no. */
  font-size: 16px;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}
@keyframes switch-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.switch__item {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--fg, #1C1814);
  transition: background .2s var(--ease, ease);
}
.switch__item:hover { background: rgba(28, 18, 8, .05); }
.switch__item b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
}
.switch__item small {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--fg-3, #7A7068);
  letter-spacing: 0;
  text-transform: none;
}

/* Sección actual: no navega a ningún sitio, solo se marca. */
.switch__item[aria-current="page"] b { color: var(--gold, #8C6020); }
.switch__item[aria-current="page"] b::after {
  content: "·  aquí estás";
  margin-left: 8px;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-4, #B5ADA4);
}

.switch__sep {
  height: 1px;
  margin: 6px 10px;
  background: var(--line, rgba(28, 18, 8, .07));
}

/* Por debajo de 980px .nav__links desaparece y con él el selector:
   a partir de ahí manda el bloque del menú hamburguesa. */

/* ---- Bloque "resto del ecosistema" dentro del menú móvil ---- */
.mobile-menu__eco {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line, rgba(28, 18, 8, .07));
}
.mobile-menu__eco-label {
  display: block;
  padding: 0 12px 6px;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-4, #B5ADA4);
}
.mobile-menu__eco .mobile-menu__link { padding: 12px; }

/* El menú móvil tenía una altura máxima justa para su lista original. */
.mobile-menu.active { max-height: 1000px; }

@media (prefers-reduced-motion: reduce) {
  .switch__panel { animation: none; }
  .switch__chev { transition: none; }
}
