/* ============================================================
   Componentes propios (fase F2)

   Objetivo: que el HTML nuevo no acumule utilidades. Estos
   componentes son duenos de su apariencia (fondo, borde, radio,
   sombra, hover y modo oscuro); en el HTML solo quedan las
   utilidades de layout (grid, gap, orden).

   Dependen solo de las variables del tema
   (assets/css/theme-cyberpunk.css), asi que cambiar la identidad
   no obliga a tocar el HTML.

   Se carga despues de cyberkit.css y de theme-cyberpunk.css.
   ============================================================ */

:root {
  --cy-radius: var(--radius-2xl, 10px);
  --cy-radius-sm: var(--radius-lg, 6px);
  --cy-radius-pill: 999px;
  --cy-border: var(--color-slate-200, #c6d7ea);
  --cy-surface: #fff;
  --cy-surface-2: var(--color-slate-50, #f1f6fc);
  --cy-ink: var(--color-slate-900, #0c1727);
  --cy-ink-2: var(--color-slate-600, #37506f);
  --cy-ink-3: var(--color-slate-500, #4e6a8f);
  --cy-brand: var(--color-brand-600, #008ba3);
  --cy-brand-strong: var(--color-brand-700, #066f84);
  --cy-shadow: 0 1px 2px rgb(5 10 19 / 0.06);
  --cy-shadow-lg: 0 18px 40px -18px rgb(5 10 19 / 0.35);
}

.dark {
  --cy-border: var(--color-slate-800, #16263c);
  --cy-surface: var(--color-slate-900, #0c1727);
  --cy-surface-2: var(--color-slate-950, #050a13);
  --cy-ink: #e2ecf7;
  --cy-ink-2: #9fb6d2;
  --cy-ink-3: #728fb4;
  --cy-shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  --cy-shadow-lg: 0 18px 40px -18px rgb(0 0 0 / 0.7);
}

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

.cy-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius);
  background: var(--cy-surface);
  box-shadow: var(--cy-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.cy-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-brand-300, #a5b4fc);
  box-shadow: var(--cy-shadow-lg);
}

.cy-card-media {
  display: block;
  overflow: hidden;
}

.cy-card-media img {
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cy-card:hover .cy-card-media img {
  transform: scale(1.05);
}

.cy-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem;
}

.cy-card-title {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--cy-ink);
}

.cy-card-title a {
  transition: color 0.15s ease;
}

.cy-card-title a:hover {
  color: var(--cy-brand);
}

.cy-card-text {
  margin-top: 0.5rem;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--cy-ink-2);
}

.cy-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cy-border);
  font-size: 0.75rem;
  color: var(--cy-ink-3);
}

.cy-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cy-ink-3);
}

.cy-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.cy-meta-top {
  margin-top: 0;
}

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

.cy-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.375rem;
  border-radius: var(--cy-radius-pill);
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--cy-surface-2);
  color: var(--cy-ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}

.cy-chip:hover {
  color: var(--cy-brand);
}

.cy-chip-accent {
  background: var(--color-brand-50, #e2fdff);
  color: var(--color-brand-700, #066f84);
}

.dark .cy-chip-accent {
  background: var(--color-brand-950, #03303d);
  color: var(--color-brand-300, #3fe3f2);
}

/* ----------------------------------------------------------- botones */

.cy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--cy-radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.cy-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cy-btn-primary {
  background: var(--cy-brand);
  color: #fff;
}

.cy-btn-primary:hover:not(:disabled) {
  background: var(--cy-brand-strong);
}

.cy-btn-outline {
  border-color: var(--cy-border);
  background: var(--cy-surface);
  color: var(--cy-ink-2);
}

.cy-btn-outline:hover:not(:disabled) {
  border-color: var(--color-brand-400, #14cee2);
  color: var(--cy-brand-strong);
}

.cy-btn-sm {
  height: 2.25rem;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
}

/* ------------------------------------------------------------ badge */

.cy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  border-radius: var(--cy-radius-pill);
  padding: 0.125rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--cy-surface-2);
  color: var(--cy-ink-2);
}

.cy-badge-brand {
  background: var(--color-brand-600, #008ba3);
  color: #fff;
}

/* ------------------------------------------------------- contenedores */

.cy-panel {
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius);
  background: var(--cy-surface);
  box-shadow: var(--cy-shadow);
}

.cy-panel-pad {
  padding: 1.5rem;
}

.cy-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.cy-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  color: var(--cy-ink);
}

.cy-section-title svg,
.cy-section-title i {
  color: var(--cy-brand);
}

.cy-empty {
  border: 1px dashed var(--cy-border);
  border-radius: var(--cy-radius);
  background: var(--cy-surface);
  padding: 5rem 1.5rem;
  text-align: center;
}

.cy-empty-title {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--cy-ink);
}

.cy-empty-text {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--cy-ink-3);
}

.cy-empty-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto;
  color: var(--color-slate-300, #9fb6d2);
}

/* -------------------------------------------------------------- hero */

.cy-hero-static {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 1.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .cy-hero-static {
    padding: 3.5rem 3rem;
  }
}

.cy-hero-glow {
  pointer-events: none;
  position: absolute;
  top: -6rem;
  left: 50%;
  height: 16rem;
  width: 36rem;
  transform: translateX(-50%);
  border-radius: var(--cy-radius-pill);
  background: color-mix(in srgb, var(--color-brand-500, #00aec4) 12%, transparent);
  filter: blur(64px);
}

.cy-hero-title {
  margin-top: 1.25rem;
  font-size: 2.25rem;
  line-height: 1.1;
  color: var(--cy-ink);
}

@media (min-width: 640px) {
  .cy-hero-title {
    font-size: 3rem;
  }
}

.cy-hero-text {
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 1rem;
  color: var(--cy-ink-2);
}

/* ------------------------------------------------------------ inputs */

.cy-input {
  height: 2.75rem;
  width: 100%;
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius-sm);
  background: var(--cy-surface);
  padding: 0 0.875rem;
  font-size: 0.875rem;
  color: var(--cy-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cy-input::placeholder {
  color: var(--cy-ink-3);
}

.cy-input:focus {
  border-color: var(--color-brand-400, #14cee2);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-brand-500, #00aec4) 12%, transparent);
}

.cy-textarea {
  height: auto;
  padding: 0.625rem 0.875rem;
  resize: vertical;
}

.cy-input-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.cy-metric {
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius-sm);
  background: var(--cy-surface-2);
  padding: 0.875rem 1rem;
}

.cy-metric-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cy-ink-3);
}

.cy-metric-value {
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cy-ink);
}

.cy-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius-sm);
  background: var(--cy-surface);
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.cy-list-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cy-ink);
}

.cy-list-row-meta {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--cy-ink-3);
}

.cy-pill-warn {
  border-radius: var(--cy-radius-pill);
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--color-rose-500, #f43f5e) 18%, transparent);
  color: var(--color-rose-600, #e11d48);
}

.cy-pill-ok {
  border-radius: var(--cy-radius-pill);
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--color-emerald-500, #10b981) 18%, transparent);
  color: var(--color-emerald-600, #059669);
}

/* --------------------------------------------------------- utilitarios */

.cy-clamp-2,
.cy-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cy-clamp-2 {
  -webkit-line-clamp: 2;
}

.cy-clamp-3 {
  -webkit-line-clamp: 3;
}

.cy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.75rem;
}

.cy-tag {
  border-radius: var(--cy-radius-sm);
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--cy-surface-2);
  color: var(--cy-ink-3);
}

/* Portada de tarjeta */
.cy-card-media img {
  height: 11rem;
}

.cy-badges {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}

.cy-badge-cover,
.cy-badge-off,
.cy-badge-out {
  border-radius: var(--cy-radius-pill);
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}

.cy-badge-cover {
  background: rgb(5 10 19 / 0.7);
  backdrop-filter: blur(4px);
}

.cy-badge-off {
  background: var(--color-rose-500, #f43f5e);
}

.cy-badge-out {
  background: var(--color-slate-700, #263a55);
}

.cy-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cy-ink);
}

.cy-price-compare {
  font-size: 0.75rem;
  color: var(--cy-ink-3);
  text-decoration: line-through;
}

.cy-rating {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--cy-ink-3);
}

.cy-stars {
  color: var(--color-amber-500, #f59e0b);
}

.cy-cover-empty {
  display: flex;
  height: 11rem;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-brand-500, #00aec4), var(--color-brand-700, #066f84), var(--color-slate-950, #050a13));
  color: rgb(255 255 255 / 0.8);
}

.cy-cover-empty svg,
.cy-cover-empty i {
  width: 2.5rem;
  height: 2.5rem;
}

.cy-card-cover-lg .cy-card-media img,
.cy-card-cover-lg .cy-cover-empty {
  height: 12rem;
}

/* Animacion de entrada de las tarjetas */
@keyframes cy-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cy-card {
  animation: cy-fade-up 0.5s ease-out both;
}

