/* =====================================================================
   INTERRUPTOR SOL / LUNA — lo usan la web y el panel «Mi cuenta».
   Lógica en js/core/theme.js. Se carga en las dos páginas.
   ===================================================================== */
.theme-sw {
  position: relative; flex: none; width: 58px; height: 32px; padding: 0; border: 0; border-radius: 99px; cursor: pointer;
  background: linear-gradient(135deg, #1c1c22, #070709);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08);
  transition: background .5s;
}
.theme-sw__knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #2a2a31; box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  transform: translateX(26px); transition: transform .5s cubic-bezier(.34,1.56,.64,1), background .5s;
}
.theme-sw__knob svg { position: absolute; width: 16px; height: 16px; transition: transform .6s cubic-bezier(.34,1.56,.64,1), opacity .3s; }
.theme-sw .sun { color: #f59e0b; opacity: 0; transform: rotate(90deg) scale(.5); }
.theme-sw .moon { color: #f4f4f6; }
.theme-sw__stars { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; transition: opacity .5s; }
.theme-sw__stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #fff; }
.theme-sw__stars i:nth-child(1) { left: 11px; top: 9px; }
.theme-sw__stars i:nth-child(2) { left: 19px; top: 19px; width: 1.5px; height: 1.5px; }
.theme-sw__stars i:nth-child(3) { left: 8px; top: 21px; width: 1px; height: 1px; }
[data-theme=light] .theme-sw { background: linear-gradient(135deg, #bfe3ff, #ffe7a8); box-shadow: inset 0 1px 3px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.05); }
[data-theme=light] .theme-sw__knob { transform: none; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
[data-theme=light] .theme-sw .sun { opacity: 1; transform: none; }
[data-theme=light] .theme-sw .moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme=light] .theme-sw__stars { opacity: 0; }
.theme-sw:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* cambio de tema con un círculo que se expande desde el interruptor (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* transición suave de colores al cambiar de tema (si el navegador no tiene View Transitions) */
html.theme-anim, html.theme-anim * { transition: background-color .35s, color .35s, border-color .35s, box-shadow .35s !important; }

