/* =============================================================================
   Licencia2 — 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.6 0.14 258 / 0.45);
  box-shadow:
    0 24px 54px oklch(0.3 0.04 258 / 0.14),
    0 0 0 1px oklch(0.6 0.14 258 / 0.14),
    0 10px 26px oklch(0.45 0.1 258 / 0.1);
}

/* --- Media: ícono de marca grande sobre fondo claro (mismo lenguaje del hero 3D) --- */
.lic-card__media {
  position: relative;
  display: grid;
  place-items: center;
  height: 168px;
  overflow: hidden;
  text-decoration: none;
  background: linear-gradient(170deg, #fff, oklch(0.966 0.004 240));
  border-bottom: 1px solid var(--border);
}
.lic-card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(oklch(0 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0 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.5;
}
.lic-card__art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  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 18px 34px oklch(0 0 0 / 0.16), 0 0 0 1px oklch(0 0 0 / 0.05); }
.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.65) 46%, oklch(0.7 0.14 258 / 0.07) 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(1 0 0 / 0.85);
  color: oklch(0.45 0.13 258);
  border: 1px solid oklch(0.55 0.14 258 / 0.28);
  -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: #2176f5;
  box-shadow: 0 0 0 0 oklch(0.78 0.18 258 / 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: var(--ink);
  background: linear-gradient(0deg, oklch(1 0 0 / 0.94) 40%, 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.5 0.14 258); 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 258 / 0.35);
  background: oklch(0.7 0.16 258 / 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.972 0.004 240);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--t);
}
.lic-card:hover .lic-card__key { border-color: oklch(0.6 0.14 258 / 0.4); }
.lic-card__key svg { width: 1rem; height: 1rem; color: oklch(0.5 0.14 258); 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: #2176f5;
  box-shadow: 0 0 0 0 oklch(0.78 0.18 258 / 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).
   Entra en 3D: inclinada en perspectiva, como los íconos que descienden en el hero. */
.has-reveal .product-card.lic-card:not(.is-in) { opacity: 0; translate: 0 30px;
  transform: perspective(900px) rotateX(9deg); transform-origin: 50% 100%; }

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

/* --- Móvil: tarjeta HORIZONTAL compacta (logo a la izquierda, datos a la
   derecha). Una tarjeta pasa de ~460px a ~230px de alto: el catálogo entero
   se recorre en la mitad de scroll. La clave decorativa y la cinta de hover
   no aportan en pantalla táctil y se ocultan. --- */
@media (max-width: 560px) {
  .product-card.lic-card { display: grid; grid-template-columns: 106px minmax(0, 1fr); align-items: stretch; }
  .lic-card__media { height: 100%; min-height: 150px; border-bottom: 0; border-right: 1px solid var(--border); }
  .lic-card__media::before { background-size: 16px 16px; }
  .lic-card__art { width: 60px; height: 60px; }
  .lic-card__art .brand-glyph { width: 60px !important; height: 60px !important; border-radius: 14px; }
  .lic-card__art .brand-glyph svg { width: 37px; height: 37px; }
  .lic-card__hint, .lic-card__key { display: none; }
  /* "Disponible" ya lo dicen los tags y el botón; solo "Agotado" merece sello */
  .lic-card__flag { display: none; }
  .lic-card__flag--out { display: inline-flex; top: auto; bottom: 0.6rem; left: 50%; right: auto; transform: translateX(-50%); }
  .lic-card__body { padding: 0.8rem 0.85rem 0.85rem; gap: 0.4rem; }
  .lic-card__name { font-size: 1.02rem; }
  .lic-card__tags { gap: 0.3rem; }
  .lic-tag { font-size: 0.68rem; padding: 0.26rem 0.5rem; }
  .lic-card__foot { margin-top: 0.3rem; gap: 0.55rem; }
}

@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; transform: 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: escaparate CLARO, coherente con el hero 3D blanco. */
.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: linear-gradient(170deg, #fff, oklch(0.962 0.004 240));
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
.pd-stage.pd-stage--lic::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(oklch(0 0 0 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0 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%, #fff, oklch(0.955 0.005 240));
  box-shadow: inset 0 0 0 1px oklch(0 0 0 / 0.06); }
.pd-lic__art .lic-card__glyph .brand-glyph { box-shadow: 0 22px 50px oklch(0 0 0 / 0.18), 0 0 0 1px oklch(0 0 0 / 0.05); }
/* En el detalle la imagen se muestra COMPLETA (contain): las fotos que sube
   el dueño suelen ser logos/artes cuadrados y con cover se cortaban arriba y
   abajo. El marco claro del arte hace de fondo. */
.pd-stage--lic .pd-lic__art .lic-card__img { object-fit: contain; padding: clamp(0.6rem, 3%, 1.2rem); }

.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(1 0 0 / 0.82);
  border: 1px solid var(--border);
  -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; }
/* Tinta FIJA (no var(--ink)): el panel es siempre blanco, también en modo
   oscuro; con la variable el nombre quedaba blanco sobre blanco. */
.pd-lic__id b { display: block; color: oklch(0.24 0.02 250); font-family: var(--font-display); font-size: 1.05rem; letter-spacing: -0.01em; }
.pd-lic__id span { font-size: 0.78rem; color: oklch(0.47 0.012 250); }
.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.45 0.13 258); background: oklch(0.6 0.14 258 / 0.1); border: 1px solid oklch(0.55 0.14 258 / 0.28); 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.972 0.004 240); border: 1px solid var(--border); }
.pd-lic__key svg { width: 1.1rem; height: 1.1rem; color: oklch(0.5 0.14 258); 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: oklch(0.38 0.012 250); 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: oklch(0.38 0.012 250); }
.pd-lic__steps svg { width: 1rem; height: 1rem; color: oklch(0.5 0.14 258); flex: none; }

/* Móvil: la cabecera del panel pasa a rejilla (logo + nombre arriba, estado
   debajo a lo ancho) para que el nombre no se rompa letra a letra. */
@media (max-width: 560px) {
  .pd-stage.pd-stage--lic { padding: 0.85rem; gap: 0.8rem; min-height: 0; }
  .pd-lic__panel { padding: 0.95rem; gap: 0.7rem; }
  .pd-lic__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 0.7rem; align-items: center; }
  .pd-lic__status { grid-column: 1 / -1; justify-self: start; }
}

.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.45 0.13 258); background: oklch(0.6 0.14 258 / 0.1); border: 1px solid oklch(0.55 0.14 258 / 0.28);
  padding: 0.2rem 0.6rem; border-radius: var(--r-pill); }
