/* Barra de susuerte.com para las landings: copia de barra-nueva.css de WordPress.
   Usa la Montserrat del estilos.css de cada landing; el menú va aparte (menu.css y menu.js). */

/* Las imágenes (logo y Lucky) también están en /recursos-compartidos/; ver plantilla-barra.html */

.cabecera {
  --su-amarillo: #ffff00;
  --su-azul: #003296;
  --su-azul-noche: #001e6e;
  --su-cian: #00a0ff;
  --su-degradado: linear-gradient(90deg, #003296 0%, #00a0ff 100%);
  --su-texto: #1a1a1a;
  /* La Montserrat de la landing; si no la trae, la del menú (menu.css) */
  --su-fuente: 'Montserrat', 'su-menu-montserrat', "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* =======================================================================
 * BARRA
 * ==================================================================== */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 40;
  /* Una landing puede cambiar solo el fondo con --barra-fondo en su :root (Su Rifa usa el azul oscuro) */
  background: var(--barra-fondo, var(--su-degradado));
  font-family: var(--su-fuente);
  transition: box-shadow 0.2s ease;
}

/* Sombra al bajar (la clase la pone barra-landings.js) */
.cabecera.es-compacta {
  box-shadow: 0 6px 18px rgba(0, 20, 70, 0.25);
}

/* Tres columnas: las de los lados del mismo ancho, así el logo queda en el centro exacto */
.cabecera__in {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 64px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- Menú: tres rayas ---- */

.su-barra__menu {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-left: -9px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.su-barra__menu:focus {
  outline: none;
}

.su-barra__menu:focus-visible {
  outline: 2px solid var(--su-amarillo);
  outline-offset: 2px;
}

/* En SVG: las tres rayas salen iguales en cualquier densidad de pantalla */
.su-barra__rayas {
  display: block;
  width: 28px;
  height: 24px;
  overflow: visible;
  transition: transform 0.2s ease;
}

/* stroke: none porque las landings le ponen trazo a todo svg */
.su-barra__rayas rect {
  stroke: none;
}

.su-barra__blanco rect {
  fill: #fff;
}

/* Copia amarilla encima: crece de izquierda a derecha, una raya tras otra */
.su-barra__amarillo rect {
  fill: var(--su-amarillo);
  transform: scaleX(0);
  transform-box: fill-box;
  transform-origin: left center;
  transition: transform 0.3s ease;
}

.su-barra__amarillo rect:nth-child(2) {
  transition-delay: 0.06s;
}

.su-barra__amarillo rect:nth-child(3) {
  transition-delay: 0.12s;
}

.su-barra__menu:focus-visible .su-barra__rayas {
  transform: scale(1.12);
}

/* es-activo: el menú está abierto (menu.js) */
.su-barra__menu:focus-visible .su-barra__amarillo rect,
.su-barra__menu.es-activo .su-barra__amarillo rect {
  transform: scaleX(1);
}

/* Solo con mouse: en celular el hover se queda pegado después de tocar */
@media (hover: hover) {
  .su-barra__menu:hover .su-barra__rayas {
    transform: scale(1.12);
  }

  .su-barra__menu:hover .su-barra__amarillo rect {
    transform: scaleX(1);
  }
}

/* ---- Logo ---- */

.cabecera__logo {
  grid-column: 2;
  grid-row: 1;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.cabecera__logo:focus {
  outline: none;
}

.cabecera__logo:focus-visible img {
  outline: 2px solid var(--su-amarillo);
  outline-offset: 4px;
}

.cabecera__logo img {
  display: block;
  width: auto;
  max-width: none;
  height: 44px;
  transition: transform 0.2s ease;
}

.cabecera__logo:hover img {
  transform: scale(1.06);
}

/* ---- Acceso: botones en escritorio ---- */

/* Los dos del mismo ancho, del tamaño del más largo */
.su-nav__acciones {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

a.su-nav__ingresar,
a.su-nav__registro {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 18px;
  border: 2px solid var(--su-amarillo);
  border-radius: 999px;
  background-color: var(--su-amarillo);
  color: var(--su-azul-noche);
  font-family: var(--su-fuente);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

a.su-nav__registro {
  border-color: #fff;
  background-color: #fff;
}

a.su-nav__ingresar:hover,
a.su-nav__ingresar:focus-visible,
a.su-nav__registro:hover,
a.su-nav__registro:focus-visible {
  transform: scale(1.05);
}

a.su-nav__ingresar:focus-visible,
a.su-nav__registro:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---- Celular y tablet: foto de Lucky y flecha que despliegan los botones ---- */

.su-nav__invitado {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: none;
  position: relative;
}

.su-nav__invitado-boton {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  color: #fff;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.su-nav__invitado-boton::-webkit-details-marker {
  display: none;
}

.su-nav__invitado-boton:focus {
  outline: none;
}

.su-nav__invitado-boton:focus-visible {
  outline: 2px solid var(--su-amarillo);
  outline-offset: 2px;
}

.su-nav__invitado-avatar {
  display: flex;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #fff;
  transition: transform 0.2s ease;
}

.su-nav__invitado-boton:hover .su-nav__invitado-avatar {
  transform: scale(1.06);
}

.su-nav__invitado-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.su-nav__invitado-flecha {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.su-nav__invitado[open] .su-nav__invitado-flecha {
  transform: rotate(180deg);
}

/* Con el degradado de la barra, para que se vea salir de ella */
.su-nav__invitado-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 10px;
  min-width: 210px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  background: var(--su-degradado);
  background-origin: border-box;
  box-shadow: 0 12px 30px rgba(0, 30, 110, 0.35);
}

.su-nav__invitado-menu a.su-nav__ingresar,
.su-nav__invitado-menu a.su-nav__registro {
  padding: 9px 18px;
}

/* =======================================================================
 * TAMAÑOS
 * ==================================================================== */

/* Tablet y celular: Lucky en vez de los botones */
@media (max-width: 991px) {
  .su-nav__acciones {
    display: none;
  }

  .su-nav__invitado {
    display: block;
  }
}

/* Tablet: 56 px */
@media (min-width: 768px) and (max-width: 1199px) {
  .cabecera__in {
    height: 56px;
  }

  .cabecera__logo img {
    height: 40px;
  }

  .su-barra__rayas {
    width: 26px;
    height: auto;
  }
}

/* Celular: 50 px */
@media (max-width: 767px) {
  .cabecera__in {
    gap: 10px;
    height: 50px;
    padding: 0 14px;
  }

  .cabecera__logo img {
    height: 34px;
  }

  .su-barra__menu {
    width: 46px;
    height: 46px;
    margin-left: -7px;
  }

  .su-barra__rayas {
    width: 24px;
    height: auto;
  }

  .su-nav__invitado-avatar {
    width: 36px;
    height: 36px;
  }

  .su-nav__invitado-flecha {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cabecera * {
    transition: none !important;
  }
}
