/* Barra de productos de MythTech. Es el marco común de todas las páginas:
   siempre lleva los colores de MythTech (Mármol u Ónice), nunca los del producto. */
.rail {
  --r-surface: #EAE4D8;
  --r-ink: #15130F;
  --r-muted: #5E574B;
  --r-border: #D9D1C2;
  --r-tip-bg: #15130F;
  --r-tip-ink: #F2EDE3;
  --rail-w: 84px;
  position: fixed; inset: 0 auto 0 0; z-index: 10;
  width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 22px 0;
  background: var(--r-surface);
  border-right: 1px solid var(--r-border);
  font-family: "Inter", system-ui, sans-serif;
}
.rail[data-theme="dark"] {
  --r-surface: #0F0E0C;
  --r-ink: #F2EDE3;
  --r-muted: #A39B8E;
  --r-border: #2A2826;
  --r-tip-bg: #F2EDE3;
  --r-tip-ink: #15130F;
}
@media (prefers-color-scheme: dark) {
  .rail[data-theme="auto"] {
    --r-surface: #0F0E0C; --r-ink: #F2EDE3; --r-muted: #A39B8E; --r-border: #2A2826;
    --r-tip-bg: #F2EDE3; --r-tip-ink: #15130F;
  }
}
.rail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.rail hr { width: 32px; border: 0; border-top: 1px solid var(--r-border); margin: 2px 0; }

.rail a {
  position: relative; display: grid; place-items: center;
  width: 52px; height: 52px; color: var(--r-ink); text-decoration: none;
}
.rail a:focus-visible { outline: 2px solid var(--r-ink); outline-offset: 3px; }

/* Indicador del producto abierto: una losa en el borde */
.rail a::before {
  content: ""; position: absolute; left: -16px; top: 50%;
  width: 4px; height: 0; background: var(--r-ink);
  transform: translateY(-50%); transition: height .2s ease;
}
.rail a:hover::before { height: 14px; }
.rail a[aria-current="page"]::before { height: 32px; }

.rail .home svg { width: 40px; height: auto; fill: currentColor; }
.rail .tile {
  display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--r-border);
}
.rail .tile img { width: 100%; height: 100%; display: block; }

/* Nombre al pasar el ratón o con el teclado */
.rail .tip {
  position: absolute; left: calc(100% + 18px); top: 50%;
  transform: translate(-4px, -50%); opacity: 0; pointer-events: none;
  white-space: nowrap; font-size: .8125rem; font-weight: 500;
  padding: 6px 10px; border-radius: 2px;
  background: var(--r-tip-bg); color: var(--r-tip-ink);
  transition: opacity .15s, transform .15s;
}
.rail a:hover .tip, .rail a:focus-visible .tip { opacity: 1; transform: translate(0, -50%); }

.with-rail { padding-left: var(--rail-w, 84px); }

/* Móvil: la barra pasa arriba */
@media (max-width: 719px) {
  .rail {
    position: sticky; inset: 0 0 auto 0; width: auto; height: 64px;
    flex-direction: row; padding: 0 16px; gap: 12px;
    border-right: 0; border-bottom: 1px solid var(--rail-b, var(--r-border));
  }
  .rail ul { flex-direction: row; gap: 12px; }
  .rail hr { width: 0; height: 28px; border-top: 0; border-left: 1px solid var(--r-border); margin: 0 2px; }
  .rail a { width: 42px; height: 42px; }
  .rail .home svg { width: 32px; }
  .rail .tile { border-radius: 11px; }
  .rail a::before { left: 50%; top: auto; bottom: -11px; width: 0; height: 3px; transform: translateX(-50%); transition: width .2s ease; }
  .rail a:hover::before { width: 12px; height: 3px; }
  .rail a[aria-current="page"]::before { width: 26px; height: 3px; }
  .rail .tip { display: none; }
  .with-rail { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rail a::before, .rail .tip { transition: none; }
}
