/* Calendario visual de los kits de fertilizantes (22-oct-2026, petición de Alan).
   Guía con movimiento sin JavaScript: la animación es CSS, se sirve desde el servidor y se
   desactiva con prefers-reduced-motion. El dato accesible sigue en la tabla real del bloque. */
.pg-kit-timeline {
  --pg-kit-roots: #7d9b6a;
  --pg-kit-growth: #4f8a5b;
  --pg-kit-bloom: #8a5a8f;
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pg-kit-head {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) repeat(var(--pg-kit-phases, 3), minmax(0, 1fr));
  gap: 0.4rem;
  align-items: end;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5d6b60;
}
.pg-kit-head span {
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #ded8cb;
}
.pg-kit-head span:first-child {
  color: transparent;
}
.pg-kit-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.1fr) repeat(var(--pg-kit-phases, 3), minmax(0, 1fr));
  gap: 0.4rem;
  align-items: center;
  min-height: 42px;
}
.pg-kit-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  color: #26382d;
}
.pg-kit-track {
  display: contents;
}
.pg-kit-bar {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0.15rem 0.3rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform-origin: left center;
}
.pg-kit-bar--raices {
  background: var(--pg-kit-roots);
}
.pg-kit-bar--crecimiento {
  background: var(--pg-kit-growth);
}
.pg-kit-bar--floracion {
  background: var(--pg-kit-bloom);
}
.pg-kit-row:hover .pg-kit-bar,
.pg-kit-row:focus-within .pg-kit-bar {
  filter: saturate(1.15) brightness(1.05);
}
.pg-kit-now {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-size: 0.72rem;
  color: #5d6b60;
}
.pg-kit-now::before {
  content: "";
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--pg-kit-roots), var(--pg-kit-bloom));
}
@media (prefers-reduced-motion: no-preference) {
  /* Sin `both`: si la animación no llega a correr (captura, pestaña en segundo plano), la
     barra queda ya en su estado final y legible. */
  .pg-kit-bar {
    animation: pg-kit-grow 720ms cubic-bezier(0.2, 0.7, 0.2, 1);
    animation-delay: calc(var(--pg-kit-i, 0) * 80ms);
  }
  .pg-kit-row {
    animation: pg-kit-fade 520ms ease-out;
    animation-delay: calc(var(--pg-kit-i, 0) * 80ms);
  }
  @keyframes pg-kit-grow {
    from {
      transform: scaleX(0.35);
      opacity: 0.75;
    }
    to {
      transform: scaleX(1);
      opacity: 1;
    }
  }
  @keyframes pg-kit-fade {
    from {
      opacity: 0;
      translate: 0 6px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}
@media (max-width: 640px) {
  .pg-kit-head {
    display: none;
  }
  .pg-kit-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    min-height: 0;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid #ece6d9;
  }
  .pg-kit-bar {
    grid-row: auto;
    justify-content: flex-start;
    padding: 0.45rem 0.75rem;
    border-radius: 14px;
    text-align: left;
    /* En estrecho el texto se parte: nunca se recorta la dosis. */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .pg-kit-bar::before {
    content: attr(data-phase) " · ";
    font-weight: 800;
    letter-spacing: 0.04em;
  }
}

/* Rejilla semanal: la tabla real del fabricante, con la dosis en cada semana y el color
   graduado por cantidad. El número siempre está escrito; el color solo ayuda a leerlo. */
.pg-kit-weekblock {
  margin-top: 0.6rem;
}
.pg-kit-weekblock > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #285d43;
}
.pg-kit-weekscroll {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e2dccd;
  background: #fff;
}
.pg-kit-table-scroll:focus-visible {
  outline: 2px solid #285d43;
  outline-offset: 3px;
}
.pg-kit-weeks {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.72rem;
  text-align: center;
}
.pg-kit-weeks caption {
  caption-side: top;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-weight: 800;
  color: #26382d;
  background: #f3efe4;
}
.pg-kit-weeks thead th {
  padding: 0.45rem 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5d6b60;
  background: #faf7ee;
  white-space: nowrap;
}
.pg-kit-weeks thead th:first-child,
.pg-kit-weeks tbody th {
  width: 13ch;
}
.pg-kit-weeks thead th:not(:first-child) {
  white-space: normal;
  font-size: 0.56rem;
  line-height: 1.15;
}
.pg-kit-weeks tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  padding: 0.45rem 0.6rem;
  text-align: left;
  white-space: nowrap;
  font-weight: 700;
  color: #26382d;
  background: #fbfaf4;
  border-right: 1px solid #ece6d9;
}
.pg-kit-weeks td {
  padding: 0.4rem 0.25rem;
  border-top: 1px solid #f1ece0;
  font-variant-numeric: tabular-nums;
  color: #26382d;
}
.pg-kit-cell {
  background: color-mix(in srgb, #4f8a5b calc(var(--pg-kit-level, 0) * 16%), transparent);
  font-weight: 600;
}
.pg-kit-cell[data-kind="agua"] {
  background: #e8eef3;
  color: #4b5a51;
  font-weight: 500;
}
.pg-kit-cell[data-kind="cosecha"] {
  background: #efe4ee;
  color: #6f4a74;
  font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) {
  .pg-kit-weeks tbody tr {
    animation: pg-kit-fade 480ms ease-out;
    animation-delay: calc(var(--pg-kit-i, 0) * 70ms);
  }
}

/* El detalle por fase va cerrado: la guía visual ya muestra producto y dosis, y repetir la
   tabla abierta duplicaba la composición tres veces en la misma ficha. */
.pg-kit-detail > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #285d43;
}
.pg-kit-detail > summary::marker,
.pg-kit-detail > summary::-webkit-details-marker {
  color: #285d43;
}

/* Frecuencia de aplicación: segunda línea del producto, solo cuando la publica el fabricante. */
.pg-kit-whenWhen {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.55rem;
  font-weight: 500;
  line-height: 1.2;
  color: #536459;
  white-space: normal;
}

/* Nota del color: el degradado compara dentro de la fila, no entre productos. */
.pg-kit-colorNote {
  margin-top: 0.5rem;
  font-size: 0.68rem;
  line-height: 1.4;
  color: #5d6b60;
}

/* Calculadora de mezcla. */
.pg-kit-doses {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e2dccd;
  border-radius: 1rem;
  background: #fff;
}
.pg-kit-doses-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: #26382d;
}
.pg-kit-doses-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.pg-kit-doses-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #4b5a51;
}
.pg-kit-doses-controls select,
.pg-kit-doses-controls input {
  min-height: 2.25rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cfc8b8;
  border-radius: 0.5rem;
  background: #fbfaf4;
  font-size: 0.85rem;
  color: #26382d;
}
.pg-kit-doses-controls input {
  width: 6.5rem;
}
.pg-kit-doses-list {
  display: grid;
  gap: 0.3rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}
.pg-kit-doses-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #f1ece0;
  font-size: 0.82rem;
  color: #3c4a42;
}
.pg-kit-doses-list strong {
  font-variant-numeric: tabular-nums;
  color: #26382d;
}
.pg-kit-doses-empty {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  color: #5d6b60;
}
