/*
  IDENTIKO — catálogo real (SS26).

  Reemplaza al catálogo de demo que traía el sitio heredado. Los productos,
  SKU, talles y medidas salen de assets/catalogo/productos.json, que a su vez
  viene de la planilla y las fotos del cliente.

  Se carga después de sitio.css y usa el prefijo ct- para no mezclarse con las
  capas heredadas.
*/

/* ── grilla ──────────────────────────────────────────────────────────────── */
.ct-grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.ct-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: #fff;
  border: 1px solid var(--gris-borde, #deded7);
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.2s, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.ct-card:hover {
  border-color: #151515;
  transform: translateY(-4px);
}

.ct-card-foto {
  display: block;
  position: relative;
  aspect-ratio: 2 / 3;
  background: #ecebe9;
  overflow: hidden;
}

.ct-card-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ct-card:hover .ct-card-foto img { transform: scale(1.04); }

.ct-card-codigo {
  position: absolute;
  top: 10px;
  left: 10px;
  /*
    El zoom de la foto al pasar el mouse es un transform, y un transform crea
    contexto de apilado: sin z-index propio, la imagen se dibuja por encima de
    esta etiqueta y el SKU desaparece justo en la tarjeta que se está mirando.
  */
  z-index: 2;
  font-family: var(--fuente-ui, inherit);
  font-size: 9px;
  letter-spacing: 1.2px;
  background: #151515;
  color: #fff;
  padding: 4px 8px;
  border-radius: 2px;
}

.ct-card-info { display: block; padding: 14px 15px 16px; }

.ct-card-nombre {
  display: block;
  font-family: var(--fuente-ui, inherit);
  font-size: 16px;
  margin-bottom: 4px;
}

.ct-card-dato {
  display: block;
  font-size: 12px;
  color: #53534f;
  margin-bottom: 10px;
}

.ct-puntos { display: flex; flex-wrap: wrap; gap: 5px; }

.ct-punto {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.ct-punto-mas {
  font-size: 10px;
  color: #53534f;
  align-self: center;
  margin-left: 2px;
}

/* ── ficha ───────────────────────────────────────────────────────────────── */
.ct-ficha { display: none; }
.ct-ficha.visible { display: block; }

.ct-volver {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--gris-borde, #deded7);
  border-radius: 3px;
  padding: 8px 15px;
  font-size: 12.5px;
  color: #53534f;
  margin-bottom: 26px;
}

.ct-volver:hover { border-color: #151515; color: #151515; }

.ct-ficha-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 44px;
  align-items: start;
}

/* galería */
.ct-visor {
  background: #ecebe9;
  border-radius: 4px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

.ct-visor img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ct-tiras {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.ct-tira {
  aspect-ratio: 2 / 3;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  background: #ecebe9;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.2s, border-color 0.2s;
}

.ct-tira img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-tira[aria-pressed='true'] { opacity: 1; border-color: var(--azul, #0B55E8); }
.ct-tira:hover { opacity: 1; }

/* datos */
.ct-codigo {
  font-family: var(--fuente-ui, inherit);
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #53534f;
  margin-bottom: 8px;
}

.ct-titulo {
  font-family: var(--fuente-ui, inherit);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  margin-bottom: 18px;
}

.ct-bloque { margin-bottom: 24px; }

.ct-bloque-titulo {
  font-family: var(--fuente-ui, inherit);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gris-borde, #deded7);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.ct-bloque-titulo span:last-child {
  color: #53534f;
  letter-spacing: 0.4px;
  text-transform: none;
  font-size: 12px;
}

.ct-colores { display: flex; flex-wrap: wrap; gap: 8px; }

.ct-color {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--gris-borde, #deded7);
  padding: 0;
  transition: transform 0.18s, border-color 0.18s;
}

.ct-color:hover { transform: scale(1.1); }

.ct-color[aria-pressed='true'] {
  border-color: var(--azul, #0B55E8);
  box-shadow: 0 0 0 3px rgba(11, 85, 232, 0.2);
}

.ct-talles { display: flex; flex-wrap: wrap; gap: 6px; }

.ct-talle {
  font-family: var(--fuente-ui, inherit);
  font-size: 12px;
  min-width: 46px;
  text-align: center;
  border: 1px solid var(--gris-borde, #deded7);
  border-radius: 3px;
  padding: 9px 10px;
  color: #151515;
}

/* tabla de medidas */
.ct-medidas { margin-top: 10px; }

.ct-medidas summary {
  font-size: 12.5px;
  color: var(--azul, #0B55E8);
  cursor: pointer;
  padding: 6px 0;
}

.ct-tabla {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11.5px;
}

.ct-tabla th,
.ct-tabla td {
  border: 1px solid var(--gris-borde, #deded7);
  padding: 6px 8px;
  text-align: center;
}

.ct-tabla th {
  background: #f5f5f2;
  font-family: var(--fuente-ui, inherit);
  font-size: 10.5px;
  letter-spacing: 0.4px;
}

.ct-tabla td:first-child,
.ct-tabla th:first-child { text-align: left; white-space: nowrap; }

.ct-nota {
  font-size: 11.5px;
  color: #53534f;
  line-height: 1.5;
  margin-top: 8px;
}

.ct-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.ct-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--fuente-ui, inherit);
  font-size: 12.5px;
  padding: 14px 22px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background 0.18s, transform 0.18s;
}

.ct-btn svg { width: 16px; height: 16px; transition: transform 0.22s; }
.ct-btn:hover { transform: translateY(-2px); }
.ct-btn:hover svg { transform: translateX(3px); }

.ct-btn-azul { background: var(--azul, #0B55E8); color: #fff; }
.ct-btn-azul:hover { background: #0843bb; }

.ct-btn-linea { background: transparent; color: #151515; border-color: #151515; }
.ct-btn-linea:hover { background: #151515; color: #fff; }

@media (max-width: 860px) {
  .ct-ficha-grid { grid-template-columns: 1fr; gap: 28px; }
  .ct-grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ct-card-nombre { font-size: 14px; }
}

@media (max-width: 420px) {
  .ct-grilla { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-card, .ct-card-foto img, .ct-btn, .ct-color { transition: none; }
  .ct-card:hover, .ct-btn:hover, .ct-color:hover { transform: none; }
  .ct-card:hover .ct-card-foto img { transform: none; }
}

/* ── categoría sin productos ──────────────────────────────────────────── */

/*
  Ocupa todas las columnas: si no, el aviso queda angosto a la izquierda y
  parece una tarjeta rota más que un mensaje.
*/
.ct-vacio {
  grid-column: 1 / -1;
  border: 1px dashed var(--gris-borde, #deded7);
  border-radius: 4px;
  background: #faf9f7;
  padding: 44px 28px;
  text-align: center;
}

.ct-vacio-titulo {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: #151515;
}

.ct-vacio-texto {
  margin: 0 auto 18px;
  max-width: 44ch;
  font-size: 13px;
  line-height: 1.55;
  color: #6b6b66;
}

.ct-vacio-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #151515;
  border-radius: 3px;
  background: #fff;
  color: #151515;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.4px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.ct-vacio-btn svg { width: 14px; height: 14px; }
.ct-vacio-btn:hover { background: #151515; color: #fff; }

/*
  Talle que marcó el asistente. La ficha no toma cantidades, así que esto no
  es una selección que se envíe a ningún lado: es un señalamiento para que la
  persona sepa cuál mirar en la tabla de medidas.
*/
.ct-talle-sugerido {
  border-color: #151515;
  background: var(--amarillo, #FFE819);
  box-shadow: 0 0 0 3px rgba(255, 232, 25, 0.35);
}
