@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

:root {
  color-scheme: dark;
  --bg: #06070d;
  --bg-glow-1: #7c3aed;
  --bg-glow-2: #06b6d4;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --texto: #eef0ff;
  --texto-tenue: #9aa0c3;
  --acento-a: #8b5cf6;
  --acento-b: #22d3ee;
  --gradiente: linear-gradient(135deg, var(--acento-a), var(--acento-b));
  --peligro: #f87171;
  --ok: #34d399;
  --radio: 16px;
  --fuente-artistica: 'Audiowide', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background: var(--bg-glow-1);
  top: -20%;
  left: -15%;
}

body::after {
  background: var(--bg-glow-2);
  bottom: -20%;
  right: -15%;
}

.contenedor, nav.nav {
  position: relative;
  z-index: 1;
}

a { color: var(--acento-b); }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Nav --- */

nav.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 19px;
  background: rgba(10, 11, 20, 0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 10;
  overflow-x: auto;
  overflow-y: visible;
  white-space: nowrap;
}

nav.nav .marca {
  font-family: var(--fuente-artistica);
  font-size: 0.95rem;
  margin-right: 4px;
  background: var(--gradiente);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.45));
  flex-shrink: 0;
}

nav.nav a {
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

/* --- Pastillas de navegación principal (tratamiento neón) --- */

.nav-pildoras {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.nav-pildora {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  color: var(--texto-tenue);
  font-family: var(--fuente-artistica);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 11, 20, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.22);
  flex-shrink: 0;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.nav-pildora .icono { font-size: 0.95rem; font-family: initial; }

.nav-pildora:hover {
  color: var(--texto);
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

.nav-pildora.activo {
  color: var(--texto);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid var(--acento-a);
  box-shadow:
    0 0 8px rgba(139, 92, 246, 0.6),
    0 0 24px rgba(139, 92, 246, 0.32),
    inset 0 0 12px rgba(139, 92, 246, 0.15);
  animation: nav-pulso-neon 2.4s ease-in-out infinite;
}

@keyframes nav-pulso-neon {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(139, 92, 246, 0.6),
      0 0 24px rgba(139, 92, 246, 0.32),
      inset 0 0 12px rgba(139, 92, 246, 0.15);
  }
  50% {
    box-shadow:
      0 0 10px rgba(34, 211, 238, 0.65),
      0 0 30px rgba(34, 211, 238, 0.35),
      inset 0 0 14px rgba(34, 211, 238, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-pildora.activo { animation: none; }
}

.nav-pildora.activo::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -12px;
  height: 3px;
  border-radius: 2px;
  background: var(--gradiente);
}

/* --- Menús de la derecha (más opciones / cuenta) --- */

.nav-derecha {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

.nav-menu {
  position: relative;
}

.nav-icon-btn,
.nav-perfil-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--texto);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1;
  box-shadow: none;
}

.nav-icon-btn:hover,
.nav-perfil-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: none;
  box-shadow: none;
}

.nav-perfil-icono { font-size: 1.05rem; }
.nav-chevron { font-size: 0.65rem; color: var(--texto-tenue); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  background: rgba(15, 16, 26, 0.98);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 60;
}

.nav-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--texto-tenue);
  font-size: 0.88rem;
  font-weight: 600;
}

.nav-dropdown a:hover { background: rgba(255, 255, 255, 0.06); color: var(--texto); }
.nav-dropdown a.activo { background: rgba(139, 92, 246, 0.18); color: var(--texto); }
.nav-dropdown a.salir { color: var(--peligro); }

/* --- Layout --- */

.pagina {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.pagina.ancho {
  max-width: 1080px;
}

.contenedor {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radio);
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.contenedor.ancho {
  max-width: 100%;
}

h1 {
  margin-top: 0;
  font-size: 1.35rem;
  font-family: var(--fuente-artistica);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(139, 92, 246, 0.35);
}

.subtitulo {
  color: var(--texto-tenue);
  line-height: 1.5;
}

/* --- Forms --- */

form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--texto-tenue);
}

.requerido { color: var(--acento-b); }

.formato-opciones {
  display: flex;
  gap: 0.7rem;
}

.formato-opcion {
  flex: 1;
  flex-direction: row !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem !important;
  padding: 0.8rem;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-weight: 700;
  color: var(--texto);
  transition: border-color 0.15s, background 0.15s;
}

.formato-opcion input {
  accent-color: var(--acento-a);
  width: 16px;
  height: 16px;
}

.formato-opcion small {
  display: block;
  font-weight: 500;
  color: var(--texto-tenue);
  font-size: 0.75rem;
}

.formato-opcion:has(input:checked) {
  border-color: var(--acento-a);
  background: rgba(139, 92, 246, 0.14);
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea {
  font: inherit;
  padding: 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--texto);
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* El botón nativo "Elegir archivos" viene sin estilo del navegador (gris
   sobre gris) y se pierde en el fondo oscuro — se lo fuerza a verse como
   cualquier otro botón de la app, para que sea obvio que es clickeable. */
input[type="file"] {
  padding: 0.6rem;
}

input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  font: inherit;
  font-weight: 700;
  padding: 0.6rem 1rem;
  margin-right: 0.75rem;
  border: none;
  border-radius: 8px;
  background: var(--gradiente);
  color: #06070d;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  filter: brightness(1.08);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--acento-a);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

textarea { resize: vertical; }

button, .btn {
  font: inherit;
  font-weight: 700;
  padding: 0.85rem 1.2rem;
  border: none;
  border-radius: 10px;
  background: var(--gradiente);
  color: #06070d;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25);
  transition: transform 0.12s, box-shadow 0.12s;
}

button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.btn-secundario {
  background: rgba(255, 255, 255, 0.06);
  color: var(--texto);
  border: 1px solid var(--card-border);
  box-shadow: none;
}

.error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.mensaje-ok {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.cargando {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
  color: var(--texto-tenue);
}

.oculto { display: none; }

.orbe-carga {
  position: relative;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.orbe-carga::before,
.orbe-carga::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.orbe-carga::before {
  border-top-color: var(--acento-b);
  border-right-color: var(--acento-b);
  filter: drop-shadow(0 0 4px var(--acento-b));
  animation: orbe-girar 1s cubic-bezier(0.5, 0.05, 0.5, 0.95) infinite;
}

.orbe-carga::after {
  inset: 6px;
  border-width: 2px;
  border-bottom-color: var(--acento-a);
  border-left-color: var(--acento-a);
  filter: drop-shadow(0 0 4px var(--acento-a));
  animation: orbe-girar-inverso 0.75s linear infinite;
}

.orbe-carga-nucleo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--gradiente);
  box-shadow: 0 0 8px 2px rgba(34, 211, 238, 0.75), 0 0 14px 3px rgba(139, 92, 246, 0.55);
  animation: orbe-pulso 1.3s ease-in-out infinite;
}

.orbe-carga--grande {
  width: 64px;
  height: 64px;
}

.orbe-carga--grande::after { inset: 13px; border-width: 3px; }

.orbe-carga--grande .orbe-carga-nucleo {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  box-shadow: 0 0 16px 4px rgba(34, 211, 238, 0.8), 0 0 28px 6px rgba(139, 92, 246, 0.6);
}

@keyframes orbe-girar { to { transform: rotate(360deg); } }
@keyframes orbe-girar-inverso { to { transform: rotate(-360deg); } }
@keyframes orbe-pulso {
  0%, 100% { transform: scale(0.75); opacity: 0.55; }
  50% { transform: scale(1.3); opacity: 1; }
}

.form-eliminar-historial {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  margin: 0;
}

.btn-eliminar-tarjeta {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-eliminar-tarjeta:hover {
  background: rgba(248, 113, 113, 0.85);
  transform: none;
  box-shadow: none;
}

.form-favorito-historial {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  margin: 0;
  z-index: 2;
}

.btn-favorito-tarjeta {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--texto-tenue);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: none;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-favorito-tarjeta:hover {
  background: rgba(250, 204, 21, 0.2);
  color: #facc15;
  transform: none;
  box-shadow: none;
}

.btn-favorito-tarjeta.activo {
  color: #facc15;
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.5);
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.7);
}

.espera-pantalla {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
  padding: 3rem 1rem;
}

.volver {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--acento-b);
  text-decoration: none;
  font-weight: 600;
}

/* --- Grids / tarjetas --- */

.grilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.tarjeta {
  background: #0a0b14;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 14px;
  padding: 0.8rem;
  text-align: center;
  box-shadow: 0 0 1px rgba(34, 211, 238, 0.4), 0 0 22px -10px rgba(139, 92, 246, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tarjeta:hover {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 1px rgba(34, 211, 238, 0.6), 0 0 30px -6px rgba(139, 92, 246, 0.55);
  transform: translateY(-2px);
}

.tarjeta img {
  width: 100%;
  border-radius: 8px;
  display: block;
  margin-bottom: 0.6rem;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
}

/* --- Menú principal (3 tarjetas grandes) --- */

.menu-grilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.menu-tarjeta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--texto);
  background: #0a0b14;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  padding: 2.2rem 1.8rem;
  min-height: 220px;
  box-shadow: 0 0 1px rgba(139, 92, 246, 0.4), 0 0 30px -12px rgba(139, 92, 246, 0.4);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.menu-tarjeta:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 1px rgba(34, 211, 238, 0.6), 0 0 44px -10px rgba(34, 211, 238, 0.5);
}

.menu-tarjeta-icono {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.6));
}

.menu-tarjeta-titulo {
  font-family: var(--fuente-artistica);
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-shadow: 0 0 14px rgba(139, 92, 246, 0.4);
}

.menu-tarjeta-desc {
  color: var(--texto-tenue);
  font-size: 0.88rem;
  line-height: 1.5;
}

.menu-tarjeta--rapida:hover { border-color: rgba(250, 204, 21, 0.55); box-shadow: 0 0 1px rgba(250, 204, 21, 0.6), 0 0 44px -10px rgba(250, 204, 21, 0.5); }
.menu-tarjeta--aplicada { opacity: 0.6; }
.menu-tarjeta--aplicada:hover { transform: none; border-color: rgba(139, 92, 246, 0.25); box-shadow: 0 0 1px rgba(139, 92, 246, 0.4), 0 0 30px -12px rgba(139, 92, 246, 0.4); }

/* --- Lightbox (vista previa completa, sin recortar) --- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 10, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 3rem 1.5rem;
  cursor: zoom-out;
}

/* Misma especificidad que ".oculto" (0,0,1,0 cada una) — sin esto, gana
   la que aparece último en el archivo, que es ésta, y el overlay nunca
   se ocultaría ni siquiera al arrancar la página. Selector combinado =
   más específico, así siempre gana sin importar el orden en el archivo. */
.lightbox-overlay.oculto {
  display: none;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  cursor: default;
  /* La caja de la imagen (por el centrado flex) ocupa mucho más espacio
     que el dibujo visible dentro de ella — sin esto, esa caja "invisible"
     queda arriba en la pila de eventos y le tapa el toque al botón ✕,
     que va después en el HTML. Con esto, los clics/toques la atraviesan
     y llegan directo al fondo (que cierra) o al botón. */
  pointer-events: none;
}

.lightbox-cerrar {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 1001;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.lightbox-cerrar:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: none;
  box-shadow: none;
}

.tarjeta p {
  margin: 0.2rem 0;
  text-transform: capitalize;
  font-weight: 600;
}

.tarjeta a { color: var(--acento-b); font-size: 0.9rem; }

.packshot { max-width: 280px; }

/* --- Selector de estilo visual --- */

.estilos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.7rem;
}

.estilo-tarjeta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.estilo-tarjeta input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.estilo-tarjeta:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.4);
}

.estilo-tarjeta:has(input:checked) {
  border-color: var(--acento-a);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

.estilo-tarjeta:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gradiente);
  color: #06070d;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.estilo-imagen {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}

.estilo-imagen-libre {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--gradiente);
  opacity: 0.35;
}

.estilo-info {
  padding: 0.45rem 0.55rem;
  text-align: left;
}

.estilo-numero {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--acento-b);
  letter-spacing: 0.06em;
}

.estilo-nombre {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.25;
}

@media (max-width: 480px) {
  .estilos-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Reusar fotos de producto ya subidas --- */

.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
}

.producto-tarjeta {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.producto-tarjeta input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.producto-tarjeta img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
}

.producto-tarjeta:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 92, 246, 0.4);
}

.producto-tarjeta:has(input:checked) {
  border-color: var(--acento-a);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

.producto-tarjeta:has(input:checked)::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradiente);
  color: #06070d;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fondo-cuadros {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: rgba(0,0,0,0.3);
}

.copy-grilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.copy-bloque {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1rem;
}

.copy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.copy-header h3 { margin: 0; }

.btn-copiar {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.copy-bloque textarea {
  width: 100%;
  font-family: inherit;
}

/* --- Badges / chips --- */

.badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: 0 0 8px -2px rgba(34, 211, 238, 0.5);
}

.badge-precio {
  background: rgba(139, 92, 246, 0.16);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 8px -2px rgba(139, 92, 246, 0.6);
}

.historial-titulo {
  margin: 0.2rem 0 0.5rem;
  font-weight: 700;
  text-transform: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  line-height: 1.3;
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
}

.historial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* --- Fechas importantes --- */

.fechas-lista {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1.2rem 0;
}

.fecha-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0.7rem 1rem;
}

.fecha-item .fecha-info { flex: 1; min-width: 0; }

.fecha-item .fecha-nombre {
  font-weight: 700;
  font-size: 0.92rem;
}

.fecha-item .fecha-sugerencia {
  color: var(--texto-tenue);
  font-size: 0.82rem;
  margin-top: 2px;
}

.fecha-item .fecha-cuando {
  color: var(--acento-b);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.fecha-item button {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* --- Historial / packshots vacío --- */

.vacio {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--texto-tenue);
}

@media (max-width: 480px) {
  .pagina { padding: 16px 12px 50px; }
  .contenedor { padding: 20px; }
}
