/* ═══════════════════════════════════════════════════════════════════
   HYC Shop — Tarjeta de producto única (.hyc-card)
   Catálogo, búsqueda, marcas, carruseles del inicio, ofertas y relacionados.
   Paleta: tinta #0f172a · pizarra #64748b · cielo #0ea5e9 · índigo #6366f1
   Se carga al final (base.php, después de $extraCss) para ganar a theme.css
   y home-nexus.css sin !important.
   ═══════════════════════════════════════════════════════════════════ */

.hyc-card {
  --hc-ink: #0f172a;
  --hc-text: #334155;
  --hc-muted: #64748b;
  --hc-line: #e5e9f0;
  --hc-stage: #f6f8fb;
  --hc-sky: #0ea5e9;
  --hc-sky-ink: #0284c7;
  --hc-indigo: #6366f1;
  --hc-grad: linear-gradient(90deg, #0ea5e9, #6366f1);

  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  color: var(--hc-ink);
  background: #fff;
  border: 1px solid var(--hc-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 24px -18px rgba(15,23,42,.22);
  transform: none;
  perspective: none;
  transform-style: flat;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease, border-color .28s ease;
}

/* Borde degradado que aparece al pasar el mouse */
.hyc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 1px;
  border-radius: inherit;
  background: var(--hc-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}

.product-card.hyc-card:hover {
  transform: none;
  background: #fff;
  border-color: var(--hc-line);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 24px -18px rgba(15,23,42,.22);
}

@media (hover: hover) {
  .product-card.hyc-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 22px 40px -22px rgba(14,165,233,.45);
  }
  .product-card.hyc-card:hover::before { opacity: 1; }
}

/* ── Escenario de la imagen ─────────────────────────────────────────── */
.hyc-card .product-img-wrap {
  position: relative;
  flex: none;
  aspect-ratio: 1 / 1;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--hc-stage);
  box-shadow: none;
  transform-style: flat;
  isolation: isolate;
}

/* Retícula de puntos: detalle tecnológico discreto */
.hyc-card .product-img-wrap::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 0;
  background: radial-gradient(circle, #d7dee8 1px, transparent 1.3px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 30%, #000 100%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 30%, #000 100%);
  opacity: .9;
  pointer-events: none;
}

/* Esquinas tipo visor (HUD): tenues, se encienden al pasar el mouse */
.hyc-card .product-img-wrap::after {
  content: '';
  position: absolute;
  inset: 10px;
  left: 10px; right: 10px; bottom: 10px; top: 10px;
  height: auto;
  z-index: 3;
  border-radius: 0;
  filter: none;
  transform: none;
  background:
    linear-gradient(currentColor, currentColor) top left    / 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) top left    / 1.5px 14px no-repeat,
    linear-gradient(currentColor, currentColor) top right   / 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) top right   / 1.5px 14px no-repeat,
    linear-gradient(currentColor, currentColor) bottom left / 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) bottom left / 1.5px 14px no-repeat,
    linear-gradient(currentColor, currentColor) bottom right/ 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) bottom right/ 1.5px 14px no-repeat;
  color: #cbd5e1;
  opacity: .8;
  pointer-events: none;
  transition: color .28s ease, inset .28s ease, opacity .28s ease;
}
@media (hover: hover) {
  .hyc-card:hover .product-img-wrap::after { color: var(--hc-sky); inset: 7px; }
}

.hyc-card .product-image-link {
  position: absolute;
  inset: 0;
  z-index: auto; /* sin capa propia: así la foto se mezcla con el escenario */
  display: block;
  transform: none;
  transform-style: flat;
}

.hyc-card .product-img,
.hyc-card .product-img-wrap.has-flip .product-img-front,
.hyc-card .product-img-wrap.has-flip .product-img-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 13%;
  object-fit: contain;
  object-position: center;
  /* Las fotos con fondo blanco se funden con el escenario */
  mix-blend-mode: multiply;
  filter: none;
  transform: none;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .35s ease;
}
/* En táctil el :hover queda "pegado": anulamos el zoom heredado de theme.css */
.product-card.hyc-card:hover .product-img { transform: none; filter: none; }
@media (hover: hover) {
  .product-card.hyc-card:hover .product-img,
  .product-card.hyc-card:hover .product-img-wrap.has-flip .product-img-front,
  .product-card.hyc-card:hover .product-img-wrap.has-flip .product-img-back {
    transform: scale(1.06);
    filter: none;
  }
}
.hyc-card .product-img-wrap.has-flip .product-img-back { opacity: 0; }
@media (hover: hover) {
  .hyc-card:hover .product-img-wrap.has-flip .product-img-front { opacity: 0; }
  .hyc-card:hover .product-img-wrap.has-flip .product-img-back  { opacity: 1; }
}

/* Sin imagen: icono de línea de la categoría */
.hyc-card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: #94a3b8;
}
.hyc-card-ph svg {
  width: 30%;
  max-width: 64px;
  height: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hyc-card-ph small {
  max-width: 80%;
  overflow: hidden;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: .62rem;
  letter-spacing: .1em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Insignias ──────────────────────────────────────────────────────── */
.hyc-card .product-badge {
  position: absolute;
  top: .7rem;
  left: .7rem;
  right: auto;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .2rem .55rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: none;
}
.hyc-card .badge-sale {
  color: #fff;
  background: var(--hc-grad);
  box-shadow: 0 6px 14px -6px rgba(99,102,241,.6);
}
.hyc-card .hyc-badge-featured {
  color: var(--hc-sky-ink);
  background: rgba(255,255,255,.92);
  border: 1px solid #bae6fd;
}

/* ── Favoritos / comparar ───────────────────────────────────────────── */
.hyc-card .product-card-tools {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.hyc-card .product-tool-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--hc-muted);
  background: rgba(255,255,255,.92);
  border: 1px solid var(--hc-line);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(15,23,42,.06);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .2s ease, opacity .25s ease;
}
.hyc-card .product-tool-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hyc-card .product-tool-btn:hover {
  color: var(--hc-sky-ink);
  border-color: #bae6fd;
  background: #fff;
  transform: scale(1.06);
}
.hyc-card .product-wishlist-btn[aria-pressed="true"] { color: #e11d48; border-color: #fecdd3; background: #fff; }
.hyc-card .product-wishlist-btn[aria-pressed="true"] svg { fill: #e11d48; stroke: #e11d48; }
.hyc-card .product-compare-btn[aria-pressed="true"] { color: var(--hc-sky-ink); border-color: #7dd3fc; background: #f0f9ff; }

/* En escritorio aparecen al pasar el mouse (salvo si ya están activos) */
@media (hover: hover) {
  .hyc-card .product-tool-btn { opacity: 0; transform: translateX(6px); }
  .hyc-card:hover .product-tool-btn,
  .hyc-card .product-tool-btn:focus-visible,
  .hyc-card .product-tool-btn[aria-pressed="true"] { opacity: 1; transform: none; }
}

.hyc-card .product-quick-view { display: none; }

/* ── Cuerpo ─────────────────────────────────────────────────────────── */
.hyc-card .product-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: .9rem 1rem 1rem;
  background: #fff;
  border-top: 1px solid #eef2f6;
  border-radius: 0;
}

.hyc-card .product-category {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 0;
  margin: 0 0 .4rem;
  padding: 0;
  overflow: hidden;
  color: var(--hc-sky-ink);
  border: 0;
  font-family: var(--font-mono, monospace);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}
.hyc-card .product-category::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  background: var(--hc-sky);
  transform: rotate(45deg);
}

.hyc-card .product-name {
  display: -webkit-box;
  min-height: calc(1.38em * 2);
  margin: 0 0 .7rem;
  overflow: hidden;
  color: var(--hc-ink);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hyc-card .product-name a { color: inherit; text-decoration: none; transition: color .2s ease; }
.hyc-card .product-name a:hover { color: var(--hc-sky-ink); }

.hyc-card .product-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .55rem;
  min-height: 0;
  margin: auto 0 0;
}
.hyc-card .product-price {
  color: var(--hc-ink);
  font-family: var(--font-display, sans-serif);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.01em;
  text-shadow: none;
}
.hyc-card .product-price-old {
  color: #94a3b8;
  font-family: var(--font-body, sans-serif);
  font-size: .78rem;
  text-decoration: line-through;
}
.hyc-card .product-price-consult {
  padding: 0;
  border: 0;
  color: var(--hc-sky-ink);
  font-family: var(--font-display, sans-serif);
  font-size: .95rem;
  font-weight: 700;
}
.hyc-card-save {
  align-self: flex-start;
  margin-top: .35rem;
  padding: .12rem .5rem;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
}

/* ── Acciones ───────────────────────────────────────────────────────── */
.hyc-card .product-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: .5rem;
  margin-top: .85rem;
}
.hyc-card .product-card-actions:has(.product-view-btn:only-child) { grid-template-columns: 1fr; }

.hyc-card .product-view-btn,
.hyc-card .product-cart-btn {
  min-height: 42px;
  border-radius: 10px;
  font-family: var(--font-display, sans-serif);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .2s ease;
}
.hyc-card .product-view-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  overflow: hidden;
  color: #fff;
  background: var(--hc-ink);
  border: 0;
  box-shadow: none;
  isolation: isolate;
}
/* El degradado entra suave al pasar el mouse */
.hyc-card .product-view-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hc-grad);
  opacity: 0;
  transition: opacity .25s ease;
}
.hyc-card .product-view-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}
.hyc-card .product-view-btn:hover { color: #fff; background: var(--hc-ink); transform: none; box-shadow: 0 8px 18px -8px rgba(99,102,241,.6); }
.hyc-card .product-view-btn:hover::before { opacity: 1; }
.hyc-card .product-view-btn:hover svg { transform: translateX(3px); }

.hyc-card .product-cart-btn {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--hc-sky-ink);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  box-shadow: none;
}
.hyc-card .product-cart-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hyc-card .product-cart-btn:hover {
  color: #fff;
  background: var(--hc-sky);
  border-color: var(--hc-sky);
  transform: none;
  box-shadow: 0 8px 18px -8px rgba(14,165,233,.7);
}
.hyc-card .product-cart-btn.success { color: #fff; background: #16a34a; border-color: #16a34a; }

.hyc-card .product-view-btn:focus-visible,
.hyc-card .product-cart-btn:focus-visible,
.hyc-card .product-tool-btn:focus-visible {
  outline: 2px solid var(--hc-sky);
  outline-offset: 2px;
}

/* ── Contenedores ───────────────────────────────────────────────────── */
/* Carruseles: espacio vertical para que la elevación y la sombra no se corten */
.nx-carousel-track,
.sc-track { padding: 6px 0 16px; align-items: stretch; }
.nx-carousel-track > .hyc-card,
.sc-track > .hyc-card { height: auto; }

/* Rejillas (catálogo, búsqueda, marcas, relacionados) */
.products-grid { align-items: stretch; }

@media (prefers-reduced-motion: reduce) {
  .hyc-card,
  .hyc-card *,
  .hyc-card::before,
  .hyc-card .product-img-wrap::after { transition: none !important; }
  .product-card.hyc-card:hover,
  .hyc-card:hover .product-img { transform: none; }
}

/* ═══════════════════════════════ MÓVIL ═══════════════════════════════ */
@media (max-width: 768px) {
  .products-grid,
  div.search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
}

@media (max-width: 640px) {
  .hyc-card { border-radius: 14px; }
  .hyc-card .product-img-wrap::after { inset: 7px; }
  .hyc-card .product-img,
  .hyc-card .product-img-wrap.has-flip .product-img-front,
  .hyc-card .product-img-wrap.has-flip .product-img-back { padding: 11%; }

  .hyc-card .product-badge { top: .5rem; left: .5rem; min-height: 21px; padding: .15rem .45rem; font-size: .62rem; }
  .hyc-card .product-card-tools { top: .45rem; right: .45rem; gap: .3rem; }
  .hyc-card .product-tool-btn { width: 30px; height: 30px; }
  .hyc-card .product-tool-btn svg { width: 14px; height: 14px; }

  .hyc-card .product-body { padding: .7rem .75rem .8rem; }
  .hyc-card .product-category { margin-bottom: .3rem; font-size: .56rem; letter-spacing: .06em; }
  .hyc-card .product-name { margin-bottom: .55rem; font-size: .8rem; line-height: 1.32; min-height: calc(1.32em * 2); }
  .hyc-card .product-price { font-size: 1.05rem; }
  .hyc-card .product-price-old { font-size: .68rem; }
  .hyc-card-save { font-size: .62rem; padding: .1rem .42rem; }

  .hyc-card .product-card-actions { grid-template-columns: minmax(0, 1fr) 40px; gap: .4rem; margin-top: .65rem; }
  .hyc-card .product-view-btn,
  .hyc-card .product-cart-btn { min-height: 40px; border-radius: 9px; font-size: .74rem; }
  .hyc-card .product-view-btn svg { display: none; }

  /* Carruseles: dos tarjetas y un asomo de la siguiente */
  .nx-carousel-track { gap: .7rem; }
  .nx-carousel-track > .nx-product-card.hyc-card,
  .sc-track > .product-card.hyc-card { flex: 0 0 calc(46% - .35rem); }
  .sc-track { gap: .7rem; }
}

/* theme.css pasa a 1 columna bajo 400px: mantenemos 2 columnas compactas */
@media (max-width: 400px) {
  .products-grid,
  div.search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .search-results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .6rem; }
  .hyc-card .product-body { padding: .62rem .65rem .7rem; }
  .hyc-card .product-name { font-size: .78rem; }
  .hyc-card .product-price { font-size: 1rem; }
  .hyc-card .product-card-actions { grid-template-columns: minmax(0, 1fr) 38px; }
  .hyc-card .product-view-btn,
  .hyc-card .product-cart-btn { min-height: 40px; font-size: .7rem; }
}

/* ═══════════════ Página de Ofertas: mismo lenguaje visual ═══════════════ */
.offers-page .offer-card {
  border: 1px solid #e5e9f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 24px -18px rgba(15,23,42,.3);
}
.offers-page .offer-card:hover {
  border-color: #7dd3fc;
  box-shadow: 0 22px 40px -22px rgba(14,165,233,.55);
}
.offers-page .offer-media {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle, #d7dee8 1px, transparent 1.3px) 0 0 / 14px 14px,
    #f6f8fb;
}
.offers-page .offer-media img { padding: 13%; mix-blend-mode: multiply; }
.offers-page .offer-placeholder { color: #94a3b8; }
.offers-page .offer-discount {
  min-height: 24px;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  font-family: var(--font-mono, monospace);
  font-size: .7rem;
  box-shadow: 0 6px 14px -6px rgba(99,102,241,.6);
}
.offers-page .offer-category {
  margin-bottom: .45rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #0284c7;
  font-family: var(--font-mono, monospace);
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
}
.offers-page .offer-name { color: #0f172a; font-size: .9rem; font-weight: 600; }
.offers-page .offer-name a:hover { color: #0284c7; }
.offers-page .offer-price { color: #0f172a; font-size: 1.28rem; }
.offers-page .offer-old-price { color: #94a3b8; font-size: .8rem; }
.offers-page .offer-save {
  margin-top: .55rem;
  padding: .35rem .6rem;
  color: #4f46e5;
  background: #eef2ff;
  border: 0;
  border-radius: 10px;
  font-size: .74rem;
  font-weight: 600;
}
.offers-page .offer-cta {
  min-height: 42px;
  margin-top: .8rem;
  border-radius: 10px;
  color: #fff;
  background: #0f172a;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
  transition: background .25s ease, box-shadow .25s ease;
}
.offers-page .offer-cta:hover {
  color: #fff;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  box-shadow: 0 8px 18px -8px rgba(99,102,241,.6);
}
@media (max-width: 560px) {
  .offers-page .offers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .offers-page .offer-media { aspect-ratio: 1 / 1; }
  .offers-page .offer-body { padding: .7rem .75rem .8rem; }
  .offers-page .offer-name { font-size: .8rem; }
  .offers-page .offer-price { font-size: 1.05rem; }
  .offers-page .offer-save { font-size: .64rem; padding: .3rem .45rem; }
  .offers-page .offer-cta { min-height: 40px; font-size: .74rem; }
  .offers-page .offer-cta svg { display: none; }
}
