/* Colección de cerveza — lenguaje visual "Verde botella".
 *
 * Paleta, tipografía y escala vienen del prototipo de Claude Design; los
 * valores concretos están en el README § "Sistema de diseño".
 * Mobile-first: las reglas base son las del móvil y los @media añaden lo de
 * pantalla grande, no al revés.
 */

:root {
  /* Color */
  --fondo:        #F3EEDF;
  --panel:        #FBF7EA;
  --verde:        #163527;
  --dorado:       #C3993F;
  --tinta:        #211D16;
  --crema:        #F5EFDC;

  --tinta-suave:  #6B6455;
  --borde:        rgba(22, 53, 39, .14);
  --borde-fuerte: rgba(22, 53, 39, .26);
  --sombra:       0 1px 2px rgba(22, 53, 39, .05), 0 10px 30px rgba(22, 53, 39, .07);
  --sombra-alta:  0 2px 6px rgba(22, 53, 39, .08), 0 18px 44px rgba(22, 53, 39, .13);

  /* Tipografía */
  --titulo: "Lora", Georgia, "Times New Roman", serif;
  --texto:  "Work Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Forma y espacio (base de 4 px) */
  --r-s:   8px;
  --r-m:   12px;
  --r-l:   14px;
  --r-pil: 100px;
  --ancho-max: 1320px;
  --lateral:   clamp(20px, 6vw, 64px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: var(--titulo);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 12px;
}

a { color: inherit; }
img { max-width: 100%; }

.oculto { display: none !important; }
.oculto-visual {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Etiqueta pequeña en mayúsculas que encabeza secciones y sale en las insignias */
.eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; color: var(--dorado);
  margin: 0 0 12px;
}

:focus-visible { outline: 2px solid var(--dorado); outline-offset: 3px; }

/* ── Cabecera ─────────────────────────────────────────────── */
.cabecera {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--lateral);
  background: var(--verde);
  color: var(--crema);
  border-bottom: 1px solid rgba(245, 239, 220, .12);
}
.marca {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  text-decoration: none; color: var(--crema);
  font-family: var(--titulo); font-weight: 700; font-size: 18px;
  letter-spacing: -.01em;
}
.marca-icono { display: block; width: 22px; height: 22px; flex: none; }
.salir { margin-left: auto; display: flex; }

.pestanas { display: flex; gap: 4px; min-width: 0; }
.pestana {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--texto); font-size: 14px; font-weight: 500;
  color: rgba(245, 239, 220, .68);
  padding: 8px 16px; border-radius: var(--r-pil);
  white-space: nowrap; transition: background .18s ease, color .18s ease;
}
.pestana:hover { color: var(--crema); background: rgba(245, 239, 220, .08); }
.pestana.activa { background: var(--dorado); color: #1A1408; font-weight: 600; }

/* ── Botones ──────────────────────────────────────────────── */
.boton-principal, .boton-secundario, .boton-fantasma, .boton-texto {
  font-family: var(--texto); font-size: 14px; font-weight: 600;
  cursor: pointer; border-radius: var(--r-pil);
  padding: 12px 24px; border: 1px solid transparent;
  text-decoration: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .08s ease;
}
.boton-principal { background: var(--dorado); color: #1A1408; }
.boton-principal:hover { background: #B08832; }

.boton-secundario {
  background: var(--panel); color: var(--tinta); border-color: var(--borde-fuerte);
  padding: 10px 20px; white-space: nowrap;
}
.boton-secundario:hover { border-color: var(--dorado); color: var(--verde); }

/* Sobre fondo verde (hero) */
.boton-fantasma {
  background: transparent; color: var(--crema);
  border-color: rgba(245, 239, 220, .38);
}
.boton-fantasma:hover { border-color: var(--crema); background: rgba(245, 239, 220, .1); }

.boton-texto {
  background: transparent; color: rgba(245, 239, 220, .72);
  padding: 8px 12px; font-weight: 500;
}
.boton-texto:hover { color: var(--crema); }

.boton-principal:active, .boton-secundario:active, .boton-fantasma:active { transform: scale(.98); }

/* ── Contenedores ─────────────────────────────────────────── */
.contenido { padding-bottom: 96px; }
.limite {
  max-width: var(--ancho-max);
  margin: 0 auto;
  padding-left: var(--lateral);
  padding-right: var(--lateral);
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--verde);
  color: var(--crema);
  overflow: hidden;
}
/* La foto de portada va detrás, atenuada: es textura, no protagonista. */
.hero-fondo {
  position: absolute; inset: 0;
  background-image: url("../img/portada.svg");
  background-size: cover; background-position: center;
  opacity: .35;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, var(--verde) 18%, rgba(22, 53, 39, .72) 100%);
}
/* Va dentro de .limite: el ancho y el margen lateral los pone el contenedor, y
   así el borde izquierdo del hero cae en la misma línea que el del resto de la
   página. Este bloque solo limita la medida del texto. */
.hero .limite { position: relative; z-index: 1; }
.hero-texto {
  padding-top: 64px; padding-bottom: 64px;
  max-width: 680px;
}
.hero h1 {
  font-size: clamp(34px, 7vw, 52px); font-weight: 700; line-height: 1.1;
  color: var(--crema); margin-bottom: 20px;
}
.hero p {
  font-size: 16px; line-height: 1.7; color: rgba(245, 239, 220, .82);
  margin: 0 0 32px;
}
.hero-botones { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 760px) {
  .hero-texto { padding-top: 96px; padding-bottom: 96px; }
  .hero p { font-size: 17px; }
}

/* ── Estadísticas ─────────────────────────────────────────── */
.estadisticas {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--borde);
  border: 1px solid var(--borde); border-radius: var(--r-l);
  overflow: hidden; margin-top: 40px;
}
@media (min-width: 620px) { .estadisticas { grid-template-columns: repeat(4, 1fr); } }
.estadistica { background: var(--panel); padding: 24px 20px; text-align: center; }
.estadistica-num {
  display: block; font-family: var(--titulo); font-weight: 700;
  font-size: clamp(28px, 5vw, 40px); line-height: 1.1; color: var(--verde);
}
.estadistica-etq {
  display: block; margin-top: 6px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; color: var(--tinta-suave);
}

/* ── Títulos de sección ───────────────────────────────────── */
.fila-titulo {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin: 64px 0 24px;
}
.fila-titulo h2 { font-size: clamp(26px, 4vw, 34px); margin: 0; }
.fila-titulo .eyebrow { margin-bottom: 8px; }

/* Tira horizontal: se desplaza con el dedo dentro de su propio carril. */
.tira {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74%;
  gap: 20px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.tira > * { scroll-snap-align: start; }
@media (min-width: 560px) { .tira { grid-auto-columns: 250px; gap: 26px; } }

/* ── Pestañas de tipo ─────────────────────────────────────── */
.tipos {
  display: flex; gap: 4px; margin: 40px 0 24px;
  border-bottom: 1px solid var(--borde);
  overflow-x: auto; scrollbar-width: none;
}
.tipos::-webkit-scrollbar { display: none; }
.tipo {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 18px; cursor: pointer; white-space: nowrap;
  font-family: var(--texto); font-size: 15px; font-weight: 500;
  color: var(--tinta-suave); background: transparent;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .18s ease, border-color .18s ease;
}
.tipo:hover { color: var(--verde); }
.tipo.activa { color: var(--verde); font-weight: 600; border-bottom-color: var(--dorado); }
.tipo-total {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  background: rgba(22, 53, 39, .08); color: var(--tinta-suave);
  padding: 2px 8px; border-radius: var(--r-pil);
}
.tipo.activa .tipo-total { background: var(--dorado); color: #1A1408; }

/* ── Filtros ──────────────────────────────────────────────── */
.filtros { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
@media (min-width: 700px) {
  .filtros { grid-template-columns: 2fr 1fr 1fr 1fr auto; align-items: center; }
  .buscador { grid-column: 1 / -1; }
}
@media (min-width: 1060px) {
  .filtros { grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr auto; }
  .buscador { grid-column: auto; }
}

input[type="search"], select {
  width: 100%; font-family: var(--texto); font-size: 14px; color: var(--tinta);
  background: var(--panel); border: 1px solid var(--borde-fuerte);
  border-radius: var(--r-pil); padding: 12px 20px;
  min-height: 46px; /* objetivo táctil cómodo */
  transition: border-color .18s ease;
}
input[type="search"]::placeholder { color: var(--tinta-suave); }
input[type="search"]:focus, select:focus { border-color: var(--dorado); }
select {
  appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236B6455' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 12px;
}

.barra-resultados {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 24px;
}
.barra-resultados p {
  margin: 0; font-size: 13px; color: var(--tinta-suave);
  letter-spacing: .02em;
}

/* ── Rejilla y tarjetas ───────────────────────────────────── */
.rejilla {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
@media (max-width: 440px) {
  /* Dos por fila en móvil: con minmax(210px) se quedaría en una sola columna. */
  .rejilla { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

.tarjeta {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--r-l); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tarjeta:hover {
  transform: translateY(-3px); box-shadow: var(--sombra-alta);
  border-color: var(--borde-fuerte);
}
.tarjeta-medio { position: relative; aspect-ratio: 1 / 1; background: var(--panel); }
.tarjeta-img {
  width: 100%; height: 100%; object-fit: contain; display: block; padding: 12px;
}
.tarjeta-sinimg {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: rgba(22, 53, 39, .04); color: var(--borde-fuerte);
}
.tarjeta-sinimg svg { width: 44px; height: 44px; }

/* Insignia de tipo, esquina superior izquierda */
.insignia {
  position: absolute; top: 10px; left: 10px;
  background: rgba(22, 53, 39, .82); color: var(--crema);
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; padding: 5px 10px; border-radius: var(--r-pil);
  backdrop-filter: blur(4px);
}
/* Aviso de que aún no hay Ficha de Colección: esquina opuesta, en dorado, para
   que no se confunda con la insignia de tipo. */
.insignia-pendiente {
  position: absolute; top: 10px; right: 10px;
  background: var(--dorado); color: #1A1408;
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; padding: 5px 10px; border-radius: var(--r-pil);
}

.tarjeta-cuerpo {
  padding: 16px; border-top: 1px solid var(--borde);
  display: grid; gap: 4px;
}
.tarjeta-marca {
  font-family: var(--titulo); font-weight: 600; font-size: 17px; line-height: 1.25;
  color: var(--tinta);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tarjeta-meta {
  font-size: 13px; color: var(--tinta-suave); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tarjeta-codigo {
  margin-top: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--dorado);
}

/* ── Estado de carga ──────────────────────────────────────── */
.centinela { height: 1px; }
.estado-carga {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 40px; margin-top: 40px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; color: var(--tinta-suave);
}
.puntos { display: inline-flex; gap: 6px; }
.puntos i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--dorado);
  animation: latido 1.2s ease-in-out infinite;
}
.puntos i:nth-child(2) { animation-delay: .18s; }
.puntos i:nth-child(3) { animation-delay: .36s; }
@keyframes latido {
  0%, 80%, 100% { opacity: .25; transform: scale(.8); }
  40%           { opacity: 1;   transform: scale(1); }
}
/* Fin de lista: un filete a cada lado del texto */
.fin-lista { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 420px; }
.fin-lista::before, .fin-lista::after {
  content: ""; flex: 1; height: 1px; background: var(--borde);
}

/* ── Estados vacíos ───────────────────────────────────────── */
.vacio {
  grid-column: 1 / -1; text-align: center; color: var(--tinta-suave);
  padding: 80px 20px;
}
.vacio.grande { padding: 120px 20px; }
.vacio h1, .vacio h2 { color: var(--tinta); font-size: 28px; }
.vacio p { margin: 0 auto 24px; max-width: 420px; }
.vacio-icono { color: var(--borde-fuerte); margin-bottom: 16px; }
.vacio-icono svg { width: 56px; height: 56px; }

/* ── Vista de ítem ────────────────────────────────────────── */
.pagina-item { background: var(--verde); }
.pagina-item .contenido { padding-top: 40px; padding-bottom: 64px; }
.ficha { display: grid; place-items: center; }
.ficha-img {
  width: 100%; height: auto; max-width: 720px;
  border-radius: var(--r-l); box-shadow: var(--sombra-alta);
  background: var(--panel);
}

/* Repuesto cuando el ítem aún no tiene Ficha de Colección generada */
.ficha-pendiente {
  width: 100%; max-width: 560px;
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--r-l); overflow: hidden; box-shadow: var(--sombra-alta);
}
.ficha-pendiente-img {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  object-fit: contain; background: var(--panel); padding: 20px;
}
.ficha-pendiente-cuerpo { padding: 32px; border-top: 1px solid var(--borde); }
.ficha-pendiente-cuerpo h1 {
  font-size: clamp(28px, 6vw, 40px); font-weight: 700; margin-bottom: 8px;
}
.ficha-pendiente-meta { margin: 0 0 20px; color: var(--tinta-suave); font-size: 15px; }
.aviso {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(195, 153, 63, .12); border: 1px solid rgba(195, 153, 63, .38);
  border-radius: var(--r-m); padding: 16px 20px;
  font-size: 14px; line-height: 1.6; color: var(--tinta);
}
.aviso svg { width: 20px; height: 20px; flex: none; color: var(--dorado); margin-top: 2px; }
.ficha-vacia { background: var(--panel); border-radius: var(--r-l); max-width: 560px; }

/* ── Login ────────────────────────────────────────────────── */
.pagina-login { background: var(--verde); }
.pagina-login .contenido {
  display: grid; place-items: center; min-height: 100vh;
  padding: 40px var(--lateral);
}
.caja-login {
  width: min(400px, 100%); text-align: center;
  background: var(--panel); border-radius: var(--r-l);
  padding: 48px 32px; box-shadow: var(--sombra-alta);
}
.login-icono { color: var(--dorado); margin-bottom: 20px; }
.login-icono svg { width: 40px; height: 40px; }
.caja-login h1 { font-size: 30px; font-weight: 700; margin-bottom: 4px; }
.login-sub { color: var(--tinta-suave); margin: 0 0 32px; font-size: 15px; }
.caja-login form { display: grid; gap: 12px; }
.caja-login input[type="password"] {
  width: 100%; font-family: var(--texto); font-size: 15px; color: var(--tinta);
  background: var(--fondo); border: 1px solid var(--borde-fuerte);
  border-radius: var(--r-pil); padding: 13px 20px;
  min-height: 48px; text-align: center;
}
.caja-login input[type="password"]:focus { border-color: var(--dorado); }
.login-error {
  background: rgba(158, 58, 44, .1); border: 1px solid rgba(158, 58, 44, .34);
  color: #8E3223; border-radius: var(--r-m); padding: 12px 16px;
  font-size: 14px; margin: 0 0 20px;
}

/* ── Cabecera estrecha ────────────────────────────────────── */
/* Logo + dos pestañas + salir no caben en una línea por debajo de ~520 px:
   se recorta el texto del logo antes que permitir scroll horizontal. */
@media (max-width: 520px) {
  .marca-texto { display: none; }
  .pestana { padding: 8px 12px; font-size: 13px; }
  .boton-texto { padding: 8px 6px; font-size: 13px; }
  .cabecera { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .tarjeta:hover { transform: none; }
}
