/* ============================================================
   PRODUCTOS.CSS — Sprint 11 Premium
   Filtros mejorados, cards con sombra colored, CTA premium
   ============================================================ */




/* --- Barra de Filtros --- */
.filter-container {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
  position: sticky;
  top: var(--navbar-height);
  z-index: var(--z-sticky);
  transition: box-shadow var(--transition-default), background-color var(--transition-default);
}

/* Glassmorphism on scroll */
.navbar.scrolled + main .filter-container {
  box-shadow: var(--shadow-sm);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.filter-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.filter-btn {
  font-size: var(--text-sm);
  padding: 10px 20px;
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: var(--weight-medium);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.filter-btn:hover {
  background-color: var(--color-border);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(28, 46, 83, 0.2);
}

/* Product count badge in filter */
.filter-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--weight-bold);
  background-color: rgba(0, 0, 0, 0.08);
  color: inherit;
  transition: background-color var(--transition-fast);
}

.filter-btn.active .filter-btn__count {
  background-color: rgba(255, 255, 255, 0.2);
}


/* --- Secciones de Línea --- */
.product-line-section {
  padding: var(--space-3xl) 0;
  transition: opacity var(--transition-slow) ease, transform var(--transition-slow) ease;
}

.product-line-section.hidden {
  display: none;
  opacity: 0;
  transform: translateY(20px);
}

.product-line-section__header {
  margin-bottom: var(--space-2xl);
  position: relative;
}

.product-line-section__header h2 {
  font-size: var(--text-3xl);
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.product-line-section__icon {
  color: var(--line-color, var(--color-accent));
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-line-section__icon svg {
  width: 100%;
  height: 100%;
}

.product-line-section__description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 80ch;
}


/* --- Grid de Productos --- */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap-lg);
  margin-top: var(--space-xl);
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* --- Tarjeta de Producto — Sprint 11 Premium --- */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--card-product-color, var(--color-accent));
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform 0.35s var(--ease-out-expo),
    box-shadow 0.35s var(--ease-out-expo),
    border-color var(--transition-default);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 32px -8px color-mix(in srgb, var(--card-product-color, var(--color-accent)) 20%, transparent),
    var(--shadow-lg);
}

.product-card__body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Cabecera de Tarjeta (Icono + Especie) */
.product-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.product-card__icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background-color: var(--card-product-color-soft, var(--color-accent-soft));
  color: var(--card-product-color, var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    transform var(--transition-default),
    box-shadow var(--transition-default);
}

.product-card:hover .product-card__icon-wrapper {
  transform: scale(1.1);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--card-product-color, var(--color-accent)) 10%, transparent);
}

.product-card__icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.product-card__species {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-muted);
}

/* Título y Descripción */
.product-card__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
  line-height: var(--leading-tight);
}

.product-card__code {
  font-size: var(--text-xs);
  background-color: var(--color-surface-alt);
  color: var(--color-primary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  margin-left: var(--space-xs);
  font-weight: var(--weight-medium);
  border: 1px solid var(--color-border);
}

.product-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
  margin-bottom: var(--space-lg);
  flex-grow: 1;
}

/* Presentaciones (Badges) */
.product-card__presentations {
  margin-bottom: var(--space-md);
}

.product-card__presentations-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-light);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
  display: block;
}

.product-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.product-card__badge {
  background-color: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  font-weight: var(--weight-medium);
  transition: background-color var(--transition-fast);
}

.product-card:hover .product-card__badge {
  background-color: color-mix(in srgb, var(--card-product-color, var(--color-accent)) 6%, var(--color-surface-alt));
}

/* Botones de Acción */
.product-card__actions {
  display: flex;
  gap: var(--space-xs);
  margin-top: auto;
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-md);
}

.product-card__btn {
  flex: 1;
  padding: 10px 14px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}


/* --- Panel de Detalles Expandibles --- */
.product-card__details {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease-out-expo);
  overflow: hidden;
  background-color: var(--color-surface-alt);
  border-top: 0 solid var(--color-divider);
}

.product-card.expanded .product-card__details {
  grid-template-rows: 1fr;
  border-top-width: 1px;
}

.product-card__details-inner {
  min-height: 0;
  padding: 0 var(--space-lg);
  transition: padding 0.35s var(--ease-out-expo);
}

.product-card.expanded .product-card__details-inner {
  padding: var(--space-lg);
}

/* Grid técnico — Sprint 11 improved icons */
.tech-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tech-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-sm);
}

.tech-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tech-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-2xs);
  letter-spacing: var(--tracking-wide);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.tech-label::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background-color: var(--card-product-color, var(--color-accent));
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.tech-value {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
  padding-left: calc(3px + var(--space-xs));
}

/* Bacterias en cursiva */
.strain-list {
  font-style: italic;
  font-weight: var(--weight-regular);
}


/* --- Secciones Vacías y Mensajes --- */
.no-results {
  display: none;
  text-align: center;
  padding: var(--space-3xl) 0;
  color: var(--color-text-light);
}

.no-results.visible {
  display: block;
}


/* --- CTA de Contacto — Sprint 11 Premium --- */
.products-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--color-primary-dark) 0%,
    #152844 50%,
    var(--color-primary) 100%
  );
  color: var(--color-text-inverse);
  padding: var(--space-4xl) 0;
  text-align: center;
  border-top: none;
}


.products-cta__badge {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.04);
}

.products-cta__title {
  color: var(--color-text-inverse);
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
  position: relative;
}

.products-cta__text {
  color: rgba(255, 255, 255, 0.75);
  max-width: 600px;
  margin: 0 auto var(--space-xl) auto;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.products-cta__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Gentle pulse on primary CTA */
.products-cta__btn-pulse {
  animation: ctaPulse 3s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
  50%      { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
}


/* --- Ajustes Responsive --- */
@media (max-width: 480px) {
  .filter-container {
    padding: var(--space-md) 0;
  }

  .filter-bar {
    gap: var(--space-xs);
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: var(--text-xs);
  }

  .filter-btn__count {
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .product-line-section {
    padding: var(--space-xl) 0;
  }

  .product-line-section__header h2 {
    font-size: var(--text-2xl);
  }

  .product-card__body {
    padding: var(--space-md);
  }

  .product-card__actions {
    flex-direction: column;
  }

  .products-cta__title {
    font-size: var(--text-3xl);
  }

  .products-cta__actions {
    flex-direction: column;
    width: 100%;
  }

  .products-cta__actions .btn {
    width: 100%;
  }
}
