/* =============================================================================
   Soft Imperio — Tarjeta de licencia digital
   Reemplaza la "caja física" 3D. Representa una LICENCIA: imagen del software,
   clave (estilo llave), estado "disponible" y activación inmediata. Se despliega
   al pasar el cursor: brillo holográfico que barre, la clave se ilumina, sube una
   cinta de entrega y el logo flota en leve 3D. Tokens del sistema, negro + verde.
   ============================================================================= */

.product-card.lic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  transition: transform .34s var(--ease-out), translate .6s var(--ease-out),
              opacity .6s var(--ease-out), box-shadow .4s var(--ease-out), border-color .4s var(--ease-out);
}
.lic-card:hover {
  transform: translateY(-6px);
  border-color: oklch(0.7 0.16 156 / 0.55);
  box-shadow:
    0 24px 54px oklch(0 0 0 / 0.5),
    0 0 0 1px oklch(0.72 0.16 156 / 0.22),
    0 18px 44px oklch(0.55 0.15 156 / 0.2);
}

/* --- Media: imagen del software sobre grid técnico + brillo holográfico --- */
.lic-card__media {
  position: relative;
  display: grid;
  place-items: center;
  height: 152px;
  overflow: hidden;
  text-decoration: none;
  background:
    radial-gradient(78% 72% at 50% 4%, oklch(0.32 0.07 156 / 0.55), transparent 70%),
    linear-gradient(165deg, oklch(0.17 0.018 156), oklch(0.10 0.012 156));
  border-bottom: 1px solid var(--border);
}
.lic-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(oklch(1 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(72% 72% at 50% 38%, #000, transparent 76%);
          mask-image: radial-gradient(72% 72% at 50% 38%, #000, transparent 76%);
  opacity: 0.55;
}
.lic-card__art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  transition: transform .5s var(--ease-out);
}
.lic-card:hover .lic-card__art { transform: translateY(-5px) scale(1.07) rotate(-2deg); }
.lic-card__glyph { line-height: 0; transition: opacity .3s; }
.lic-card__glyph .brand-glyph { box-shadow: 0 14px 30px oklch(0 0 0 / 0.55), 0 0 0 1px oklch(1 0 0 / 0.12); }
.lic-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.lic-card__img.is-on { opacity: 1; }
.lic-card__img.is-on ~ .lic-card__glyph { opacity: 0; }

/* Barrido holográfico (se dispara al pasar el cursor) */
.lic-card__shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, oklch(1 0 0 / 0.16) 46%, oklch(0.85 0.14 156 / 0.08) 54%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .8s var(--ease-out);
}
.lic-card:hover .lic-card__shine { transform: translateX(130%); }

/* Estado disponible / agotado (arriba a la derecha del media) */
.lic-card__flag {
  position: absolute;
  top: .7rem;
  right: .7rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .68rem;
  font-weight: 700;
  padding: .28rem .55rem;
  border-radius: var(--r-pill);
  background: oklch(0.12 0.01 156 / 0.7);
  color: oklch(0.88 0.14 156);
  border: 1px solid oklch(0.7 0.16 156 / 0.3);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}
.lic-card__flag--out { color: var(--ink-muted); border-color: var(--border-strong); }
.lic-card__live {
  width: .45rem; height: .45rem; border-radius: 50%; background: #1ed47e;
  box-shadow: 0 0 0 0 oklch(0.78 0.18 156 / 0.6);
  animation: lic-pulse 2.2s var(--ease-out) infinite;
}

/* Cinta que se despliega hacia arriba al pasar el cursor */
.lic-card__hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .75rem;
  font-size: .74rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(0deg, oklch(0 0 0 / 0.82), transparent);
  transform: translateY(105%);
  transition: transform .42s var(--ease-out);
}
.lic-card:hover .lic-card__hint { transform: translateY(0); }
.lic-card__hint svg { width: .95rem; height: .95rem; color: oklch(0.82 0.16 156); flex: none; }

/* --- Cuerpo --- */
.lic-card__body { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.05rem 1.1rem; }
.lic-card__cat { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); }
.lic-card__name { font-family: var(--font-display); font-size: 1.12rem; letter-spacing: -.015em; line-height: 1.18; color: var(--ink); }
.lic-card__name a { transition: color var(--t); }
.lic-card__name a:hover { color: var(--brand-ink); }
.lic-card .rating { font-size: .82rem; }

/* Rasgos de la licencia: fila de píldoras (Nuevo · Digital · Activación inmediata) */
.lic-card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .1rem; }
.lic-tag {
  display: inline-flex; align-items: center; gap: .32rem;
  font-size: .72rem; font-weight: 600; line-height: 1;
  padding: .32rem .62rem; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-muted);
}
.lic-tag svg { width: .88rem; height: .88rem; color: var(--brand-ink); flex: none; }
.lic-tag--accent {
  color: var(--brand-ink);
  border-color: oklch(0.7 0.16 156 / 0.35);
  background: oklch(0.7 0.16 156 / 0.1);
}

/* Ícono de copiar dentro de la clave (decorativo, como en la referencia) */
.lic-card__copy { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--r-xs); color: var(--ink-faint); flex: none; }
.lic-card__copy svg { width: .95rem; height: .95rem; }

/* Botón "agregar al carrito" estilo contorno + badge "+" que indica que suma al carrito */
.lic-card__add { position: relative; overflow: visible; background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink-body); }
.lic-card__add:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand-ink); }
.add-btn__plus {
  position: absolute; top: -.32rem; right: -.32rem;
  width: 1.1rem; height: 1.1rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-strong); color: #fff;
  font-size: .82rem; font-weight: 800; line-height: 1;
  border: 2px solid var(--surface);
}

/* Clave de licencia (el toque "digital / llaves") */
.lic-card__key {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .15rem;
  padding: .5rem .6rem;
  border-radius: var(--r-sm);
  background: oklch(0 0 0 / 0.32);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--t);
}
.lic-card:hover .lic-card__key { border-color: oklch(0.7 0.16 156 / 0.4); }
.lic-card__key svg { width: 1rem; height: 1rem; color: oklch(0.82 0.16 156); flex: none; }
.lic-card__key code {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .05em;
  color: var(--ink-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t);
}
.lic-card:hover .lic-card__key code { color: var(--ink-strong); }
.lic-card__keydot {
  width: .5rem; height: .5rem; border-radius: 50%; flex: none; background: #1ed47e;
  box-shadow: 0 0 0 0 oklch(0.78 0.18 156 / 0.6);
  animation: lic-pulse 2.2s var(--ease-out) infinite;
}

.lic-card__foot { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; margin-top: .5rem; }
.lic-card__foot .price { flex-direction: row; align-items: baseline; gap: .45rem; }
.lic-card__foot .price__now { display: inline-block; transform-origin: left center; transition: transform .3s var(--ease-out), color .3s var(--ease-out); }
.lic-card__foot:has(.lic-card__actions :hover) .price__now { transform: scale(1.16); color: var(--brand-ink); }

.lic-card__actions { display: flex; align-items: center; gap: .45rem; width: 100%; }
.lic-card__buy { flex: 1; justify-content: center; gap: .35rem; }
.lic-card__actions .add-btn { flex: none; }
.lic-card__buy svg { width: 1em; height: 1em; transition: transform var(--t); }
.lic-card__buy:hover svg { transform: translateX(3px); }

.lic-card.is-out { opacity: .72; }
.lic-card.is-out .lic-card__art { filter: grayscale(.7); }
.lic-card.is-out .lic-card__live { animation: none; background: var(--ink-faint); }

/* Aparición al hacer scroll (SI.revealBoxes añade .has-reveal + .is-in con escalonado) */
.has-reveal .product-card.lic-card:not(.is-in) { opacity: 0; translate: 0 30px; }

@keyframes lic-pulse {
  0% { box-shadow: 0 0 0 0 oklch(0.78 0.18 156 / 0.55); }
  70% { box-shadow: 0 0 0 6px oklch(0.78 0.18 156 / 0); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card.lic-card, .lic-card__art, .lic-card__shine, .lic-card__hint { transition: none; }
  .lic-card__live, .lic-card__keydot { animation: none; }
  .has-reveal .product-card.lic-card:not(.is-in) { opacity: 1; translate: none; }
}

/* =============================================================================
   Showcase de licencia en la página de detalle (coherente con .lic-card)
   Logo grande del software sobre grid técnico + panel con clave y activación.
   ============================================================================= */
/* .pd-stage.pd-stage--lic: especificidad 0,2,0 para ganarle al fondo claro de
   .pd-stage (base) y que el showcase sea SIEMPRE oscuro (también en tema claro). */
.pd-stage.pd-stage--lic {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  min-height: clamp(360px, 44vw, 480px);
  overflow: hidden;
  background:
    radial-gradient(72% 52% at 50% 0%, oklch(0.32 0.07 156 / 0.5), transparent 70%),
    linear-gradient(165deg, oklch(0.17 0.018 156), oklch(0.10 0.012 156));
  border: 1px solid oklch(1 0 0 / 0.1);
  border-radius: var(--r-xl);
}
.pd-stage.pd-stage--lic::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(oklch(1 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(78% 60% at 50% 28%, #000, transparent 78%);
          mask-image: radial-gradient(78% 60% at 50% 28%, #000, transparent 78%);
  opacity: 0.5;
}
.pd-stage--lic .lic-card__flag { top: 1rem; right: 1rem; }
.pd-stage--lic:hover .lic-card__shine { transform: translateX(130%); }

.pd-lic__art { position: relative; z-index: 2; width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center;
  border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(82% 82% at 50% 32%, oklch(0.17 0.028 156), oklch(0.07 0.01 156));
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.08); }
.pd-lic__art .lic-card__glyph .brand-glyph { box-shadow: 0 22px 50px oklch(0 0 0 / 0.6), 0 0 0 1px oklch(1 0 0 / 0.12); }
/* En el detalle la imagen llena el marco (la imagen IA es un render oscuro a
   sangre, así que cubrir se ve mejor que dejarla pequeña y centrada). */
.pd-stage--lic .pd-lic__art .lic-card__img { object-fit: cover; }

.pd-lic__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.1rem;
  border-radius: var(--r-lg);
  background: oklch(0.12 0.012 156 / 0.72);
  border: 1px solid oklch(1 0 0 / 0.1);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.pd-lic__head { display: flex; align-items: center; gap: 0.7rem; }
.pd-lic__app { width: 2.6rem; height: 2.6rem; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.pd-lic__app .brand-glyph { width: 2.6rem !important; height: 2.6rem !important; border-radius: 12px; }
.pd-lic__id { flex: 1; min-width: 0; }
.pd-lic__id b { display: block; color: #fff; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.01em; }
.pd-lic__id span { font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); }
.pd-lic__status { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  color: oklch(0.88 0.16 156); background: oklch(0.7 0.16 156 / 0.16); border: 1px solid oklch(0.7 0.16 156 / 0.3); padding: 0.3rem 0.55rem; border-radius: var(--r-pill); }
.pd-lic__status svg { width: 0.85rem; height: 0.85rem; }
.pd-lic__key { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.75rem; border-radius: var(--r-sm); background: oklch(0 0 0 / 0.35); border: 1px solid var(--border); }
.pd-lic__key svg { width: 1.1rem; height: 1.1rem; color: oklch(0.82 0.16 156); flex: none; }
.pd-lic__key code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-lic__steps { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin: 0; }
.pd-lic__steps li { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: rgba(255, 255, 255, 0.82); }
.pd-lic__steps svg { width: 1rem; height: 1rem; color: oklch(0.82 0.16 156); flex: none; }

.pd-stage--lic.is-out { opacity: 0.82; }
.pd-stage--lic.is-out .pd-lic__art { filter: grayscale(0.7); }

/* Badge "Nuevo": productos sin reseñas todavía (en vez de estrellas vacías). */
.rating--new { display: inline-flex; align-items: center; min-height: 1.2rem; }
.badge-new { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  color: oklch(0.88 0.16 156); background: oklch(0.7 0.16 156 / 0.14); border: 1px solid oklch(0.7 0.16 156 / 0.3);
  padding: 0.2rem 0.6rem; border-radius: var(--r-pill); }
