/* =====================================================================
   WormShop · Capa de IDENTIDAD (ws-identity.css)
   ---------------------------------------------------------------------
   1. Sistema de iconos propio (.ws-ico) que sustituye emojis genéricos
   2. Chips / badges / pills con identidad neón (negro + rojo)
   3. Jerarquía visual, superficies con profundidad y foco accesible
   4. Microinteracciones baratas (transform / opacity)
   Se carga DESPUÉS de ws-polish.css. No modifica lógica ni IDs.
   ===================================================================== */

/* ---------- 1. Iconografía propia --------------------------------- */
.ws-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.08em;
  height: 1.08em;
  flex: 0 0 auto;
  vertical-align: -0.16em;
  line-height: 0;
  font-style: normal;
  color: var(--ws-brand-strong, #c084fc);
  transition: transform 0.18s ease, color 0.18s ease;
}
.ws-ico > svg { width: 100%; height: 100%; display: block; overflow: visible; }

.ws-ico--brand  { color: var(--ws-brand-strong, #c084fc); }
.ws-ico--ok     { color: var(--ws-success, #10b981); }
.ws-ico--warn   { color: var(--ws-warning, #f59e0b); }
.ws-ico--danger { color: var(--ws-danger, #ef4444); }
.ws-ico--info   { color: var(--ws-info, #3b82f6); }
.ws-ico--muted  { color: var(--ws-muted, #a1a1aa); }

/* Los iconos dentro de un elemento interactivo acompañan el hover */
a:hover > .ws-ico,
button:hover > .ws-ico,
.btn:hover .ws-ico { transform: translateY(-1px); }

/* Icono como marca de estado dentro de pills/badges */
.badge .ws-ico,
.pill .ws-ico,
.chip .ws-ico,
.status .ws-ico { width: 1em; height: 1em; margin-right: 0.35em; }

/* Icono destacado en cabeceras: cápsula con halo rojo muy contenido */
h1 > .ws-ico:first-child,
h2 > .ws-ico:first-child,
h3 > .ws-ico:first-child {
  width: 1.5em;
  height: 1.5em;
  padding: 0.28em;
  margin-right: 0.45em;
  border-radius: 0.55em;
  background: linear-gradient(160deg, rgba(var(--ws-brand-rgb, 168, 85, 247), 0.22), rgba(var(--ws-brand-rgb, 168, 85, 247), 0.04));
  border: 1px solid rgba(var(--ws-brand-rgb, 168, 85, 247), 0.35);
  box-shadow: 0 6px 18px -12px rgba(var(--ws-brand-rgb, 168, 85, 247), 0.9);
  vertical-align: -0.35em;
}

/* Estados semánticos: el contenedor tiñe su icono automáticamente */
[data-state="success"] .ws-ico,
.is-ok .ws-ico,
.status-approved .ws-ico { color: var(--ws-success, #10b981); }
[data-state="rejected"] .ws-ico,
.is-fail .ws-ico { color: var(--ws-danger, #ef4444); }
[data-state="pending"] .ws-ico,
.is-partial .ws-ico { color: var(--ws-warning, #f59e0b); }

/* Punto de estado con pulso sobrio (sólo transform/opacity) */
.ws-ico--danger[data-ws-ico="dot"]::after,
.ws-ico--ok[data-ws-ico="dot"]::after {
  content: "";
  position: absolute;
  width: 0.7em;
  height: 0.7em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: ws-ico-pulse 2.4s ease-out infinite;
}
.ws-ico[data-ws-ico="dot"] { position: relative; }
@keyframes ws-ico-pulse {
  0%   { transform: scale(0.6); opacity: 0.45; }
  70%  { transform: scale(2.1); opacity: 0; }
  100% { transform: scale(2.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-ico::after { animation: none; }
  .ws-ico { transition: none; }
}

/* ---------- 2. Jerarquía y superficies ---------------------------- */
:root {
  --ws-ring: 0 0 0 3px rgba(var(--ws-brand-rgb, 168, 85, 247), 0.28);
  --ws-edge: 1px solid rgba(255, 255, 255, 0.06);

  /* Escala de elevación (niveles nombrados, no valores sueltos por
     componente). Referencia: sistemas de dark UI maduros (Sentry,
     Linear) — cada superficie sube un nivel a la vez, sin saltos.
     Uso: box-shadow: var(--ws-elev-2);  ó  var(--ws-elev-glow) para el
     halo rojo de marca en CTAs/cards destacadas sobre fondo oscuro. */
  --ws-elev-0: none;
  --ws-elev-1: 0 2px 8px rgba(0, 0, 0, 0.28);
  --ws-elev-2: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --ws-elev-3: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
  --ws-elev-4: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  --ws-elev-glow: 0 0 0 1px rgba(var(--ws-brand-rgb, 168, 85, 247), 0.25),
                  0 12px 32px -14px rgba(var(--ws-brand-rgb, 168, 85, 247), 0.55);
}

/* Foco visible y consistente en toda la web (accesibilidad) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ws-ring);
  border-radius: 10px;
}

/* Títulos de sección con acento rojo: identidad, no decoración */
.section-title,
.dash-section > h2,
.panel-box > h3 {
  letter-spacing: -0.01em;
}
.section-title::after,
.dash-section > h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 0.5rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ws-brand, #a855f7), rgba(var(--ws-brand-rgb, 168, 85, 247), 0));
}

/* Superficies con profundidad real, sin blur costoso */
.panel-box,
.dash-section,
.card,
.ws-card {
  border: var(--ws-edge);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%);
}

/* Elementos clicables: se nota que lo son */
[role="button"],
.clickable,
.product-card,
.ws-product-card {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.product-card:hover,
.ws-product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--ws-brand-rgb, 168, 85, 247), 0.45);
  box-shadow: 0 18px 40px -26px rgba(var(--ws-brand-rgb, 168, 85, 247), 0.85);
}
.product-card:active,
.ws-product-card:active { transform: translateY(-1px); }

/* Estado deshabilitado y de carga, legibles y sin ambigüedad */
button[disabled],
.btn[disabled],
.btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.is-loading { position: relative; color: transparent !important; }
.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.05em;
  height: 1.05em;
  margin: -0.52em 0 0 -0.52em;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--ws-brand-strong, #c084fc);
  animation: ws-spin 0.7s linear infinite;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }

/* Estado vacío: nunca una caja en blanco */
.empty-state,
.ws-empty {
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding: 2.25rem 1.25rem;
  text-align: center;
  color: var(--ws-muted, #a1a1aa);
  border: 1px dashed rgba(var(--ws-brand-rgb, 168, 85, 247), 0.28);
  border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(var(--ws-brand-rgb, 168, 85, 247), 0.07), transparent 70%);
}
.empty-state .ws-ico,
.ws-empty .ws-ico { width: 1.9em; height: 1.9em; opacity: 0.85; }

/* Precios: la cifra manda */
.price,
.product-price,
.ws-price {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--ws-brand-strong, #c084fc);
}
