/* =========================================================
   FAST MARKET — CABECERA EN UNA FILA (partials/header.html)
   ---------------------------------------------------------
   Logo a la izquierda · menú en una cápsula al centro ·
   buscador, moneda, Discord, cuenta y carrito a la derecha.
   Se carga después de styles.css y halloween.css.
   En el celular (980 px o menos) manda el "modo iPhone" de
   siempre: aquí solo se esconde lo que no entra.
   ========================================================= */

@media (min-width: 981px) {
  :root {
    --header-h: 68px; /* antes 114 (dos filas): lo usan la barra fina y los avisos */
  }
}

.site-header {
  background: rgba(15, 16, 13, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
body.scrolled .site-header {
  background: rgba(15, 16, 13, 0.92);
  box-shadow: 0 12px 30px -20px rgba(0, 0, 0, 0.9);
}

/* tres columnas: el menú queda centrado de verdad aunque los lados midan distinto */
.header-row {
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
body.scrolled .header-row {
  height: 60px;
}
.header-row > .logo {
  justify-self: start;
}
.header-row .logo-text {
  white-space: nowrap;
}
.header-row > .header-actions {
  justify-self: end;
  margin-left: 0;
  gap: 8px;
}

/* ---------- menú en cápsula ---------- */
.header-row .header-nav {
  width: auto;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  overflow: visible;
}
.header-row .nav-pill {
  position: relative;
  padding: 8px 15px;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #b6c2ae;
  border: 0;
}
.header-row .nav-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  transform: none;
}
.header-row .nav-pill.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* puntito de color bajo la sección activa */
.header-row .nav-pill.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
}

/* ---------- buscador ---------- */
.hdr-buscar {
  position: relative;
  display: flex;
  align-items: center;
  width: 150px;
  height: 40px;
  padding: 0 8px 0 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, width 0.25s ease, background 0.2s ease;
}
.hdr-buscar:focus-within {
  width: 220px;
  border-color: var(--neon);
  background: rgba(255, 255, 255, 0.06);
}
.hdr-buscar > i {
  position: absolute;
  left: 13px;
  color: #9aa691;
  font-size: 0.82rem;
  pointer-events: none;
}
.hdr-buscar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  outline: none;
}
.hdr-buscar input::placeholder {
  color: #8d849a;
}
.hdr-buscar input::-webkit-search-cancel-button {
  display: none;
}
.hdr-buscar kbd {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #9aa691;
  font: 600 0.7rem/1 inherit;
}
.hdr-buscar:focus-within kbd {
  display: none;
}

/* ---------- moneda (bandera + código) ---------- */
.header-actions .cur-dd-trigger {
  height: 40px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  box-shadow: none;
}
.header-actions .cur-dd-trigger:hover,
.header-actions .cur-dd.open .cur-dd-trigger {
  border-color: rgba(221, 255, 40, 0.55);
  box-shadow: none;
}

/* ---------- botones redondos: Discord, cuenta, carrito ---------- */
.hdr-ico {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #e8f0e3;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.hdr-ico:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #fff;
}
.hdr-ico.header-discord {
  color: #aab3ff;
}
.hdr-ico.header-discord:hover {
  border-color: rgba(88, 101, 242, 0.7);
  background: rgba(88, 101, 242, 0.18);
  color: #fff;
}
/* el nombre de la cuenta no entra en una fila: queda para lectores de pantalla */
.hdr-ico.account-btn span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* con sesión iniciada: puntito verde */
.hdr-ico.account-btn.logged {
  color: #fff;
  border-color: rgba(59, 165, 93, 0.6);
}
.hdr-ico.account-btn.logged::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ba55d;
  border: 2px solid #161713;
}
.hdr-ico .cart-badge {
  top: -4px;
  right: -4px;
}

/* ---------- pantallas medianas: se achica de a poco ---------- */
@media (max-width: 1240px) {
  .header-row .nav-pill {
    padding: 8px 11px;
  }
  .hdr-buscar {
    width: 130px;
  }
  .hdr-buscar kbd {
    display: none;
  }
}
@media (max-width: 1100px) {
  .hdr-buscar {
    display: none;
  }
  .logo-text {
    font-size: 1.05rem;
  }
}
/* celular / tablet: el menú vive en la barra de abajo (modo iPhone) o en ☰ */
@media (max-width: 980px) {
  .header-row {
    display: flex;
    height: 60px;
  }
  .header-row .header-nav {
    display: none;
  }
  .header-row > .header-actions {
    margin-left: auto;
  }
}

/* en "Mi cuenta" (setActiveNav le pone .active por su data-page) */
.hdr-ico.account-btn.active {
  border-color: var(--neon);
  background: rgba(221, 255, 40, 0.12);
  color: #fff;
}

/* =========================================================
   FOTO DE PERFIL (auth.js: pintarAvatar). Va acá porque el
   botón de cuenta del encabezado está en todas las páginas;
   Mi cuenta (cuenta.css) la usa en grande.
   ========================================================= */
/* ---------- avatar (Mi cuenta, editor y encabezado) ---------- */
.pf-av {
  --pf1: #dcff47;
  --pf2: #e9ff2b;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pf1), var(--pf2));
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  line-height: 1;
}
.pf-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pf-av .pf-av-img {
  width: 76%;
  height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
.pf-av-ini {
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- botón Cuenta del encabezado: la foto ---------- */
/* el texto "Cuenta" se esconde con ".hdr-ico.account-btn span" (arriba):
   la foto también es un <span>, así que se deshace ese escondite */
.hdr-ico.account-btn .hdr-av,
.hdr-ico.account-btn .hdr-av span {
  position: static;
  clip: auto;
  white-space: normal;
}
.hdr-ico.account-btn .hdr-av {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 15px;
}
.hdr-ico.account-btn .hdr-av span {
  width: auto;
  height: auto;
  overflow: visible;
}
/* y en pantallas chicas styles.css esconde todos los <span> del botón
   (".account-btn span { display: none }"): la foto y su inicial se ven igual */
.hdr-ico.account-btn .hdr-av {
  display: grid;
}
.hdr-ico.account-btn .hdr-av span {
  display: inline-block;
}
.hdr-ico.account-btn:has(.hdr-av) {
  overflow: visible;
  border-color: rgba(255, 255, 255, 0.22);
}


/* barra de abajo del celular: la pestaña "Cuenta" lleva la foto (script.js: copiarCuenta) */
html.ios-modo .ios-av {
  width: 24px;
  height: 24px;
  font-size: 11px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55);
}

/* Panel de admin en celulares chicos (es la única página sin la barra de abajo):
   los botones de la cabecera no entraban en 320 px y el ☰ quedaba cortado. */
@media (max-width: 380px) {
  html:not(.ios-modo) .header-row .logo-text {
    display: none;
  }
  html:not(.ios-modo) .header-row .hdr-ico {
    width: 36px;
    height: 36px;
  }
  html:not(.ios-modo) .header-row > .header-actions {
    gap: 6px;
  }
}
