/* ==========================================================================
   ficha.css - Render HTML de fichas tecnicas (datasheets PDF) en producto.php

   Solo aplica a los productos que tienen ficha. Los productos sin ficha
   siguen mostrando su texto plano con <br /> como siempre.

   Estructura generada por tools/pdf2ficha.py:
     .ficha
       .ficha__figura -> .ficha__img
       .ficha__head   -> .ficha__eyebrow / .ficha__h2 / .ficha__subtipo
       .ficha__desc
       .ficha__badges -> .ficha__badge
       .ficha__features -> .ficha__feature (.ficha__icono + h3 + ul)
       .ficha__sec     -> h3 + .ficha__tw > .ficha__t
       .ficha__notes   -> li
   ========================================================================== */

.ficha {
  font-family: "Open Sans", sans-serif;
  color: #666666;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 30px;
}

.ficha * { box-sizing: border-box; }

/* Foto del producto. Entra arriba de todo, antes del titulo. */
.ficha__figura {
  margin: 0 0 22px 0;
}

.ficha__img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ececec;
  border-radius: 4px;
  background: #fff;
}

/* En pantallas angostas la ficha vive en una columna y la foto ya ocupa todo
   el ancho: un poco de aire arriba alcanza. */
@media only screen and (max-width: 600px) {
  .ficha__figura { margin-bottom: 16px; }
}

.ficha h2,
.ficha h3,
.ficha h4 {
  font-family: "Raleway", sans-serif;
  color: #2e7d32;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.ficha p { margin: 0 0 18px 0; }
.ficha p:last-child { margin-bottom: 0; }

.ficha a { color: #2e7d32; }

/* --------------------------------------------------------------------------
   Encabezado de la ficha
   -------------------------------------------------------------------------- */

.ficha__head {
  border-left: 4px solid #2e7d32;
  padding: 0 0 0 18px;
  margin: 0 0 24px 0;
}

.ficha__eyebrow {
  font-family: "Raleway", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #999999;
  margin: 0 0 4px 0;
}

.ficha__h2 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #2e7d32;
}

.ficha__subtipo {
  font-family: "Raleway", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #03c5ec;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Parrafo de marketing
   -------------------------------------------------------------------------- */

.ficha__desc {
  font-size: 15.5px;
  line-height: 1.8;
  color: #4a4a4a;
  margin: 0 0 28px 0;
}

/* --------------------------------------------------------------------------
   Badges (warranty, certificaciones, tecnologia)
   -------------------------------------------------------------------------- */

.ficha__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px 0;
  padding: 0;
  list-style: none;
}

.ficha__badge {
  background: #f4f8f4;
  border: 1px solid #d9e8d9;
  border-radius: 3px;
  color: #2e7d32;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  line-height: 1.4;
}

.ficha__badge b { color: #1b5e20; }

/* --------------------------------------------------------------------------
   Grid de grupos de caracteristicas
   -------------------------------------------------------------------------- */

.ficha__features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 30px 0;
}

.ficha__feature {
  background: #fafafa;
  border: 1px solid #eeeeee;
  border-top: 3px solid #03c5ec;
  border-radius: 3px;
  padding: 18px 20px;
}

.ficha__feature:nth-child(even) { border-top-color: #2e7d32; }

/* Icono de la caracteristica. Viene del PDF como un cuadrado de 25x25 pt con
   las bandas de color y el dibujo, y se escala con el alto fijo. */
.ficha__icono {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
}

.ficha__feature h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #2e7d32;
}

.ficha__feature ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ficha__feature li {
  position: relative;
  padding: 0 0 0 20px;
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.6;
}

.ficha__feature li:last-child { margin-bottom: 0; }

.ficha__feature li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  background: #03c5ec;
  border-radius: 50%;
}

.ficha__feature:nth-child(even) li:before { background: #2e7d32; }

/* --------------------------------------------------------------------------
   Seccion con tabla
   -------------------------------------------------------------------------- */

.ficha__sec { margin: 0 0 30px 0; }

.ficha__sec:last-child { margin-bottom: 0; }

.ficha__sec > h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #2e7d32;
}

.ficha__sec > p {
  font-size: 13px;
  color: #999999;
  margin: 0 0 14px 0;
}

/* --------------------------------------------------------------------------
   Tabla tecnica - wrapper con scroll horizontal
   -------------------------------------------------------------------------- */

.ficha__tw {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e4e4e4;
  border-radius: 3px;
  background: #ffffff;
}

.ficha__t {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}

.ficha__t th,
.ficha__t td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #eeeeee;
  line-height: 1.5;
}

.ficha__t thead th {
  background: #2e7d32;
  color: #ffffff;
  font-family: "Raleway", sans-serif;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 0;
}

.ficha__t tbody th {
  background: #f4f8f4;
  color: #4a4a4a;
  font-weight: 600;
  width: 34%;
  min-width: 190px;
}

.ficha__t tbody td { color: #666666; }

/* Tablas anchas: las de paneles, con una columna por modelo y condicion.
   Sin esto la columna de la etiqueta se queda con el 34% de una tabla de 11
   columnas y los numeros no entran. */
.ficha__t--ancha tbody th {
  width: auto;
  min-width: 170px;
  white-space: nowrap;
}

.ficha__t--ancha tbody td,
.ficha__t--ancha thead th { white-space: nowrap; }

.ficha__t tbody tr:nth-child(even) th { background: #eef5ee; }
.ficha__t tbody tr:nth-child(even) td { background: #fcfdfc; }

.ficha__t tr.ficha__sub th {
  background: #e8f4f8;
  color: #0277a9;
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ficha__t tr.ficha__sub td { background: #f4fbfd; }

/* Notas al pie de tabla (asteriscos del PDF) */

.ficha__notes {
  margin: 12px 0 0 0;
  padding: 0 0 0 18px;
  font-size: 12.5px;
  color: #999999;
  line-height: 1.6;
}

.ficha__notes li { margin: 0 0 4px 0; }

/* --------------------------------------------------------------------------
   Enlace a la ficha PDF descargable
   -------------------------------------------------------------------------- */

.ficha__dl {
  display: inline-block;
  margin: 4px 0 0 0;
  padding: 11px 20px;
  background: #2e7d32;
  color: #ffffff !important;
  border-radius: 3px;
  font-family: "Raleway", sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.ficha__dl:hover {
  background: #1b5e20;
  color: #ffffff;
  text-decoration: none;
}

.ficha__dl .fa { margin-right: 8px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media only screen and (max-width: 800px) {

  .ficha { font-size: 14px; }

  .ficha__h2 { font-size: 23px; }
  .ficha__subtipo { font-size: 14.5px; }
  .ficha__head { padding-left: 13px; }

  .ficha__features { grid-template-columns: minmax(0, 1fr); }

  .ficha__feature { padding: 15px 16px; }

  /* Primera columna fija para no perder la etiqueta al desplazar */
  /*
  .ficha__t tbody th,
  .ficha__t thead th:first-child {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 150px;
    width: auto;
  }

  .ficha__t thead th:first-child { z-index: 3; }
  */

  /* Sombra para que se note que la tabla se puede desplazar */
  .ficha__tw {
    -webkit-box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.25);
    box-shadow: inset -8px 0 8px -8px rgba(0, 0, 0, 0.25);
  }

  .ficha__dl { width: 100%; text-align: center; }
}

/* --------------------------------------------------------------------------
   Impresion
   -------------------------------------------------------------------------- */

@media print {

  .ficha__tw { overflow: visible; border: 1px solid #999999; }
  .ficha__t { min-width: 0; font-size: 10px; }
  .ficha__t th,
  .ficha__t td { padding: 4px 6px; }
  .ficha__features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ficha__feature { border: 1px solid #cccccc; }
  .ficha__dl { display: none; }
  .ficha a { color: #000000; text-decoration: none; }
}
