/*
 * JCM: ajustes globales del sitio (fase 4). Colores de css/tokens.css.
 */

/* Botón flotante de WhatsApp: style.min.css ocultaba «footer ul» en móvil y con eso
   el botón nunca se veía en celulares. Aquí se mantiene visible en todos los tamaños. */
.whatsapp ul { display: block !important; margin: 0; padding: 0; }
.whatsapp a:focus-visible { outline: 3px solid var(--color-tinta); outline-offset: 3px; }

/* Teléfonos del header: enlaces de llamada con área táctil cómoda */
.follow_icon a[href^="tel:"] { display: inline-block; padding: 4px 2px; color: inherit; text-decoration: none; white-space: nowrap; }
.follow_icon a[href^="tel:"]:hover { text-decoration: underline; text-underline-offset: 3px; }
footer a[href^="tel:"] { white-space: nowrap; }

/* Texto oculto junto al logo (para buscadores y lectores): color con contraste por si se muestra */
.navbar-brand_ span { color: var(--color-oscuro); }

/* ------------------------------------------------------------------
 * Productos relacionados («Más …» al final de cada ficha)
 * Antes: nombre y «Ver más» flotando en rojo sobre la foto; solo el botón era clicable.
 * Ahora: tarjeta completa clicable, nombre legible bajo la foto y «Ver más» con flecha.
 * ------------------------------------------------------------------ */
.producto.cs-style-2 {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px;
  margin: 0; padding: 8px 0 24px; list-style: none;
}
.producto.cs-style-2 > li {
  float: none; width: auto; min-height: 0; margin: 0; padding: 12px 12px 14px;
  display: flex; flex-direction: column;
  background: var(--color-fondo); border: 1px solid var(--color-borde); border-radius: 6px;
  text-align: left; overflow: visible; position: relative;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.producto.cs-style-2 > li:hover {
  border-color: var(--color-marca); transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--color-tinta) 35%, transparent);
}
.producto.cs-style-2 > li:focus-within { outline: 3px solid var(--color-tinta); outline-offset: 2px; }
.producto.cs-style-2 figure { display: flex; flex-direction: column; height: 100%; margin: 0; }
.producto.cs-style-2 figure img {
  position: static; left: auto; transform: none !important;
  width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
}
.producto.cs-style-2 figcaption {
  position: static; height: auto; width: auto; flex: 1;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  padding: 10px 2px 0; background: none; color: var(--color-tinta);
}
.producto.cs-style-2 figcaption p {
  position: static; top: auto; margin: 0;
  font: 600 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-tinta); text-align: left;
}
.producto.cs-style-2 figcaption p strong { font-weight: inherit; }
.producto.cs-style-2 figcaption a {
  position: static; transform: none; left: auto; bottom: auto;
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 0; background: none; border-radius: 0;
  font: 700 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-marca-oscuro); text-decoration: none;
}
/* La tarjeta entera responde al clic del enlace */
.producto.cs-style-2 figcaption a::before { content: ""; position: absolute; inset: 0; border-radius: 6px; }
/* Flecha (SVG dibujado, toma el color del texto) */
.producto.cs-style-2 figcaption a::after {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8h11M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s ease;
}
.producto.cs-style-2 > li:hover figcaption a { text-decoration: underline; text-underline-offset: 3px; }
.producto.cs-style-2 > li:hover figcaption a::after { transform: translateX(3px); }
.producto.cs-style-2 figcaption a:focus-visible { outline: none; }

/* Tablet: 3 por fila · Móvil: 2 por fila (pedido del usuario) */
@media (min-width: 768px) and (max-width: 1024px) {
  .producto.cs-style-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 767px) {
  .producto.cs-style-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .producto.cs-style-2 > li { padding: 10px 10px 12px; }
  .producto.cs-style-2 figcaption p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .producto.cs-style-2 > li, .producto.cs-style-2 figcaption a::after { transition: none; }
}
/* component.min.css forzaba en móvil el ancho al 45% (!important) y volvía a pintar el nombre como etiqueta roja */
.producto.cs-style-2 > li { width: auto !important; }
.producto.cs-style-2 figcaption p {
  top: auto; z-index: auto; padding: 0; border-radius: 0; background: none;
  font-weight: 600; color: var(--color-tinta);
}
/* Los códigos de modelo (SJ-295, M-32-3HP…) no se parten en el guion */
.jcm-modelo { white-space: nowrap; }
/* component.min.css (efecto Codrops) antepone «by » a todo <span> del pie de foto: se anula en los códigos de modelo */
.producto figcaption .jcm-modelo::before { content: none; display: none; }
