:root {
  --ks-primary: #24b9d7;
  --ks-primary-dark: #1a9cb5;
  --ks-bg-glass: rgba(255, 255, 255, 0.95);
  --ks-border-glass: rgba(255, 255, 255, 0.8);
  --ks-shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --ks-shadow-md: 0 12px 30px rgba(36, 185, 215, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
  --ks-radius: 20px;
  --ks-card-min-h: 180px;
}

.ks-buscador-container {
  margin-bottom: 40px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- Search & Filters --- */
.ks-search {
  margin: 0 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.ks-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.45rem 1rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.ks-back-btn:hover {
  background: #e2e8f0;
  color: #1a2e4a;
  text-decoration: none;
}
@media (max-width: 768px) {
  .ks-back-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 10px;
    width: 100%;
    justify-content: center;
  }
}

.ks-resume-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem auto;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, #1a2e4a, #1d5087);
  color: #fff;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ks-resume-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  color: #fff;
  text-decoration: none;
}

.ks-search-input {
  width: min(600px, 100%);
  padding: 1rem 2rem;
  /* Larger padding */
  border: 1px solid rgba(0, 0, 0, 0.05);
  /* Softer border */
  border-radius: 999px;
  font-size: 1.1rem;
  outline: none;
  background: white;
  box-shadow: var(--ks-shadow-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ks-search-input:focus {
  border-color: var(--ks-primary);
  box-shadow: 0 0 0 4px rgba(36, 185, 215, 0.1), var(--ks-shadow-md);
  transform: translateY(-2px);
}

.ks-results-count {
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
  margin: -1rem 0 0.5rem;
}

.ks-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ks-tag {
  border: 1px solid transparent;
  /* Cleaner loop */
  background: #f3f4f6;
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  color: #4b5563;
}

.ks-tag:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

/* Selected Tag State - Softer */
.ks-tag[aria-pressed="true"] {
  background: var(--ks-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(36, 185, 215, 0.4);
  /* Softer glow */
  border-color: transparent;
  /* No border */
}

/* === Word Bubbles (Frequent Words) === */
/* === Búsquedas frecuentes (inline, compactas) === */
.ks-freq {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0.6rem 0 1rem 0;
  line-height: 1.4;
}

.ks-freq-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  text-align: center;
}

.ks-freq-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.ks-freq-tags::-webkit-scrollbar { display: none; }

.ks-freq-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: rgba(36, 185, 215, 0.06);
  border: 1px solid rgba(36, 185, 215, 0.25);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: #2a8fa5;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.ks-freq-tag:hover,
.ks-freq-tag[aria-pressed="true"] {
  background: var(--ks-primary, #24b9d7);
  color: white;
  border-color: var(--ks-primary, #24b9d7);
}

.ks-freq-tag--extra {
  display: none;
}
.ks-freq-tags.ks-expanded .ks-freq-tag--extra {
  display: inline-flex;
}

.ks-freq-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  color: #dc2626;
  transition: background 0.15s, color 0.15s;
}
.ks-freq-clear:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.ks-freq-more {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  border: 1px dashed rgba(36, 185, 215, 0.4);
  border-radius: 999px;
  background: none;
  color: var(--ks-primary, #24b9d7);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ks-freq-more:hover {
  background: var(--ks-primary, #24b9d7);
  color: white;
  border-color: var(--ks-primary, #24b9d7);
}
.ks-freq-more-count { opacity: 0.7; font-weight: 400; }

/* === End Búsquedas frecuentes === */

/* ... existing code ... */

.ks-caret-row {
  margin-top: auto;
  padding-top: 1rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* Space between badge and caret */
  opacity: 0.6;
  /* Increased visibility */
  transition: opacity 0.2s;
}

/* ... existing code ... */

/* Badge for Children Count */
.ks-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 99px;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.2s;
}

.ks-parent-toggle:hover .ks-badge {
  background: var(--ks-primary);
  color: white;
}

.ks-tag-clear {
  margin-left: 0.5rem;
  background: #fff1f2;
  color: #e11d48;
}

.ks-tag-clear:hover {
  background: #ffe4e6;
  color: #be123c;
}

/* --- Barra de herramientas: filtros + selector de vista --- */
.ks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
}

/* --- Helper Filters (Accordion Style) --- */
.ks-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  flex: 1;
  margin: 0;
}

.ks-filter {
  border: 0;
  border-radius: 16px;
  background: white;
  box-shadow: var(--ks-shadow-sm);
  min-width: 200px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.ks-filter:hover {
  box-shadow: var(--ks-shadow-md);
}

/* Facet filter panel (product filters) */
.ks-filters__container {
  width: 100%;
}

.ks-filters__toprow {
  text-align: center;
  margin-bottom: 0.75rem;
}

.ks-filters__bottomrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.ks-filter--product {
  min-width: 160px;
  max-width: 260px;
}

.ks-filter__header {
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  border-bottom: 1px solid #eee;
  color: #374151;
}

.ks-filter__help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d1d5db;
  color: #374151;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}

.ks-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem;
}

.ks-filter-product-btn[aria-pressed="true"] {
  background: var(--ks-primary);
  color: #fff;
  border-color: var(--ks-primary);
}

.ks-filter__clear {
  font-size: 0.8rem;
  opacity: 0.7;
}

.ks-filter__clear:hover {
  opacity: 1;
}

.ks-filter-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.8rem 1.25rem;
  font-weight: 700;
  color: #374151;
  transition: background 0.2s;
}

.ks-filter-toggle:hover {
  background: #f9fafb;
  color: var(--ks-primary);
}

.ks-filter-toggle[aria-expanded="true"] {
  background: #f0f9fb;
  color: var(--ks-primary);
}

.ks-filter-toggle[aria-expanded="true"] .ks-caret {
  transform: rotate(180deg);
}

.ks-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1rem;
  background: #fafafa;
  border-top: 1px solid #f3f4f6;
}

/* --- Grid & Items --- */
.ks-buscador-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
/* Tarjetas: 2 móvil → 4 desktop */
.ks-buscador-list {
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .ks-buscador-list { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
}

/* Móvil: toolbar en columna */
@media (max-width: 575px) {
  .ks-toolbar { flex-direction: column; align-items: center; gap: 0.5rem; }
  .ks-filters { justify-content: center; flex: unset; width: 100%; }
  .ks-theme-switcher { justify-content: center; }
}

/* Móvil: tarjetas más compactas */
@media (max-width: 767px) {
  .ks-buscador-list { gap: 0.75rem; }
  .ks-buscador-link {
    padding: 1rem 0.75rem;
    min-height: 100px;
  }
  .ks-parent-toggle {
    padding: 1rem 0.75rem 0.6rem;
    min-height: 100px;
  }
  .ks-intro-paragraph-old { padding: 1.25rem; margin: 1rem 0; }
  .ks-vehicle-specs { justify-content: center; }
  .ks-hermanos { padding: 1rem; }
  .ks-hermanos__list--marcas { grid-template-columns: repeat(4, 1fr); }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ks-buscador-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  contain: layout style;
  animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Card Base Styles */
.ks-buscador-link,
.ks-parent {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  /* Align top */
  border: 0;
  /* Remove border */
  border-radius: var(--ks-radius);
  background: white;
  box-shadow: var(--ks-shadow-sm);
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
  text-decoration: none !important;
  color: #1f2937;
  overflow: hidden;
}

/* Link-specific */
.ks-buscador-link {
  min-height: var(--ks-card-min-h);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  flex: 1;
  width: 100%;
  gap: 0.5rem;
}

.ks-buscador-link:hover,
.ks-parent:hover {
  transform: translateY(-8px);
  box-shadow: var(--ks-shadow-md);
}

/* Parent Node */
.ks-parent-toggle {
  width: 100%;
  text-align: center;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  gap: 0.5rem;
  /* Gap between elements */
  cursor: pointer;
  padding: 2rem 1.5rem 1rem;
  /* Less padding bottom for caret */
  min-height: var(--ks-card-min-h);
  flex: 1;
}

/* Images */
.ks-thumb {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Typography */
.ks-label-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  margin-bottom: 0.25rem;
}

.ks-line {
  /* H3 reset */
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.ks-year-row {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

.ks-buscador-year {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(36, 185, 215, 0.1);
  color: var(--ks-primary-dark);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0;
  backdrop-filter: blur(4px);
}

.ks-caret-row {
  margin-top: auto;
  /* Push to bottom */
  padding-top: 1rem;
  width: 100%;
  display: flex;
  justify-content: center;
  opacity: 0.4;
  transition: opacity 0.2s;
}

.ks-parent:hover .ks-caret-row {
  opacity: 1;
}

.ks-caret {
  transition: transform 0.3s ease;
  fill: var(--ks-primary);
}

/* Child Items (Inside Accordion) */
.ks-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
  width: 100%;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03);
  display: grid;
  grid-template-columns: 1fr;
  /* Stack vertically by default in sublist */
}

.ks-buscador-link.ks-child {
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: auto;
  padding: 1rem 1.5rem;
  padding-right: 1.5rem;
  /* Reset padding */
  flex-direction: column;
  /* Allow wrapping or column flow for mobile */
  justify-content: start;
  align-items: flex-start;
  /* Align left */
  text-align: left;
  gap: 0.5rem;
}

.ks-buscador-link.ks-child:last-child {
  border-bottom: 0;
}

.ks-buscador-link.ks-child:hover {
  background: white;
  transform: none;
}

.ks-buscador-link.ks-child .ks-label-lines {
  align-items: flex-start;
  font-size: 1rem;
}


/* Skeleton Loading */
.ks-skeleton {
  background: #f0f0f0;
  border-radius: var(--ks-radius);
  min-height: var(--ks-card-min-h);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

/* Badge for Children Count */
.ks-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ks-primary);
  color: white;
  border-radius: 99px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

/* Show More Button */
.ks-show-more-wrap {
  grid-column: 1/-1;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.ks-show-more-btn {
  background: white;
  border: 1px solid #e5e5e5;
  color: var(--ks-primary);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 2rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--ks-shadow-sm);
}

.ks-show-more-btn:hover {
  background: var(--ks-primary);
  color: white;
  border-color: var(--ks-primary);
  box-shadow: var(--ks-shadow-md);
}

/* Caret rotation */
.ks-caret {
  transition: transform 0.3s ease;
  fill: #aaa;
}

.ks-parent-toggle:hover .ks-caret {
  fill: var(--ks-primary);
}

.ks-parent-toggle[aria-expanded="true"] .ks-caret {
  transform: rotate(180deg);
  fill: var(--ks-primary);
}

[hidden] {
  display: none !important;
}

/* --- Database Content (Checklist) --- */
.ks-check.card {
  background: white;
  border-radius: var(--ks-radius);
  box-shadow: var(--ks-shadow-sm);
  padding: 1.5rem 2rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--ks-primary);
  transition: box-shadow 0.3s ease;
}

.ks-check.card:hover {
  box-shadow: var(--ks-shadow-md);
}

.ks-check__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ks-check__title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
  font-weight: 600;
  min-width: 120px;
}

.ks-check__highlight {
  flex: 1;
  font-size: 1.1rem;
  color: #333;
}

.ks-check__highlight strong {
  color: var(--ks-primary-dark);
}

.ks-toggle-extra {
  background: #f9f9f9;
  border: 0;
  padding: 0.5rem 1rem;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ks-primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.ks-toggle-extra:hover {
  background: var(--ks-primary);
  color: white;
}

.ks-toggle-extra[aria-expanded="true"] {
  background: var(--ks-primary);
  color: white;
}

.ks-toggle-extra[aria-expanded="true"] .ks-toggle-extra__icon {
  transform: rotate(45deg);
}

.ks-toggle-extra__icon {
  font-size: 1.2em;
  line-height: 1;
  transition: transform 0.3s;
}

.ks-check__body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
  color: #555;
  line-height: 1.6;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.ks-check.is-open .ks-check__body {
  max-height: 1200px;
}

/* Helpers */
.ks-lead {
  font-size: 1.1rem;
  color: rgba(255,255,255,.78);
  margin-bottom: 1.5rem;
}

.ks-muted {
  color: rgba(255,255,255,.78);
  font-size: 0.95rem;
}

/* Warning/Info Box */
.ks-note {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  padding: 1rem 1.5rem;
  border-radius: var(--ks-radius);
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  line-height: 1.6;
  position: relative;
}

.ks-note strong {
  color: #b45309;
  font-weight: 700;
}

/* --- Mensaje "Sin resultados" --- */
.ks-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  background: #f9fafb;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  margin: 2rem 0;
  color: #6b7280;
}

.ks-no-results p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

.ks-no-results p:first-child {
  font-weight: 500;
  color: #374151;
  font-size: 1.1rem;
}
.ks-no-results__hint {
  font-size: .9rem;
  color: #666;
}

/* ============================================
   VARIACIONES DE BÚSQUEDA (Párrafos bonitos)
   ============================================ */

.ks-specs-heading {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #9ca3af;
  margin: 1rem 0 0.3rem;
  text-align: center;
  width: 100%;
}
.ks-vehicle-specs {
  list-style: none;
  padding: 0;
  margin: 0 auto 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  font-size: 0.88rem;
  color: #555;
}
.ks-vehicle-specs li {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}
.ks-spec-label {
  font-weight: 700;
  color: #333;
  white-space: nowrap;
}
.ks-spec-value {
  color: var(--ks-primary, #24b9d7);
  text-decoration: none;
}
.ks-spec-value:hover {
  text-decoration: underline;
}

/* ============================================
   ENLAZADO INTERNO: HERMANOS
   ============================================ */
.ks-hermanos {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: #f8fafb;
  border: 1px solid #e5e9ec;
  border-radius: 12px;
  font-size: 0.82rem;
  color: #666;
}
.ks-hermanos__title {
  display: block;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 0.85rem;
}

/* ---- Hermanos texto (modelo, motor, año): chips ---- */
.ks-hermanos__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.ks-hermanos__list li { display: flex; }
.ks-hermanos__list li::after { content: ''; }
.ks-hermanos__link {
  color: inherit;
  text-decoration: none;
}
.ks-hermanos__chip {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1.5px solid #e0e4e8;
  background: white;
  color: #444;
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  white-space: nowrap;
}
.ks-hermanos__link:hover .ks-hermanos__chip {
  border-color: var(--ks-primary, #24b9d7);
  color: var(--ks-primary, #24b9d7);
  background: #f0fafe;
  transform: translateY(-1px);
}

/* ---- Hermanos nivel 2: tarjetas de marca (solo icono) ---- */
.ks-hermanos--marcas {
  padding: 1rem;
}
/* 2 filas fijas: height tarjeta × 2 + gap × 1 */
.ks-hermanos__list--marcas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;              /* 8px */
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: calc(52px * 2 + 8px);   /* mobile: 112px */
  overflow: hidden;
  align-content: flex-start;
  justify-content: space-evenly;
}
.ks-hermanos__list--marcas li { display: flex; }
.ks-hermanos__list--marcas li::after { content: ''; }
.ks-hermanos__list--marcas .ks-hermanos__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1.5px solid #e8edf0;
  background: white;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
@media (min-width: 768px) {
  .ks-hermanos__list--marcas {
    max-height: calc(60px * 2 + 8px); /* desktop: 128px */
  }
  .ks-hermanos__list--marcas .ks-hermanos__link { width: 60px; height: 60px; }
}
.ks-hermanos__list--marcas .ks-hermanos__link:hover {
  border-color: var(--ks-primary, #24b9d7);
  box-shadow: 0 4px 14px rgba(36, 185, 215, 0.18);
  transform: translateY(-2px);
}
.ks-hermanos__img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: grayscale(0.3) opacity(0.8);
  transition: filter 0.2s;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .ks-hermanos__img { width: 44px; height: 44px; }
}
.ks-hermanos__list--marcas .ks-hermanos__link:hover .ks-hermanos__img {
  filter: grayscale(0) opacity(1);
}
/* Fallback sin imagen: cuadrado con iniciales (match img 48×48) */
.ks-hermanos__img--text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--ks-primary, #24b9d7), var(--ks-primary-dark, #1a8fa3));
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 7px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ============================================
   SELECTOR DE TEMA VISUAL
   ============================================ */
.ks-theme-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ks-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.ks-theme-btn:hover {
  border-color: var(--ks-primary);
  color: var(--ks-primary);
  background: #f0fafe;
}
.ks-theme-btn[aria-pressed="true"] {
  border-color: var(--ks-primary);
  background: var(--ks-primary);
  color: white;
}
.ks-theme-btn-label {
  display: none; /* solo icono en móvil */
}
@media (min-width: 600px) {
  .ks-theme-btn-label { display: inline; }
}

/* ============================================
   TEMA: ICONOS
   ============================================ */
/* Iconos: 3 móvil → 6 desktop */
.ks-theme-icons .ks-buscador-list {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .ks-theme-icons .ks-buscador-list { grid-template-columns: repeat(6, 1fr); gap: 1rem; }
}
.ks-theme-icons .ks-buscador-link,
.ks-theme-icons .ks-parent-toggle {
  min-height: 90px;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
}
@media (min-width: 768px) {
  .ks-theme-icons .ks-buscador-link,
  .ks-theme-icons .ks-parent-toggle {
    min-height: 110px;
    padding: 1rem 0.75rem;
    font-size: inherit;
  }
}
.ks-theme-icons .ks-buscador-link:hover,
.ks-theme-icons .ks-parent-toggle:hover {
  transform: translateY(-5px);
}
.ks-theme-icons .ks-line { font-size: 0.88rem; }
.ks-theme-icons .ks-thumb { width: 56px; height: 56px; }

/* ============================================
   TEMA: LISTA — 1 columna móvil → 2 columnas desktop
   ============================================ */
.ks-theme-list .ks-buscador-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}
@media (min-width: 768px) {
  .ks-theme-list .ks-buscador-list { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
}
.ks-theme-list .ks-buscador-link,
.ks-theme-list .ks-parent-toggle {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  text-align: left;
  gap: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  width: 100%;
}
.ks-theme-list .ks-buscador-link:hover,
.ks-theme-list .ks-parent-toggle:hover {
  transform: none;
  background: #f0fafe;
  box-shadow: 0 1px 6px rgba(36,185,215,0.15);
}
.ks-theme-list .ks-thumb { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; }
.ks-theme-list .ks-item-icon {
  display: block;
  font-size: 1.15rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.ks-theme-list .ks-label-lines { flex: 1; min-width: 0; }
.ks-theme-list .ks-line { font-size: 0.9rem; text-align: left; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ks-theme-list .ks-year-row { margin: 0; margin-left: auto; flex-shrink: 0; }
.ks-theme-list .ks-caret-row { width: auto; padding: 0; margin: 0; margin-left: auto; flex-shrink: 0; }
.ks-theme-list .ks-buscador-item { height: auto; }
.ks-theme-list .ks-freq { margin: 0.4rem 0 0.8rem 0; }

.ks-intro-paragraph-old {
  background: linear-gradient(135deg, #f0f9fb 0%, #e0f7fa 100%);
  border: 1px solid rgba(36, 185, 215, 0.2);
  border-radius: var(--ks-radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 15px rgba(36, 185, 215, 0.1);
}

.ks-intro-paragraph-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ks-primary-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ks-intro-paragraph-title::before {
  content: '🔍';
  font-size: 1.1rem;
}

/* Contenedor de keywords/variaciones */
.ks-keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-start;
}

/* Chips de palabras clave */
.ks-keyword-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1.5px solid var(--ks-primary);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ks-primary-dark);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.ks-keyword-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(36, 185, 215, 0.1);
  transition: left 0.3s ease;
  z-index: 0;
}

.ks-keyword-chip:hover {
  background: var(--ks-primary);
  color: white;
  border-color: var(--ks-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(36, 185, 215, 0.3);
}

.ks-keyword-chip:hover::before {
  left: 0;
}

.ks-keyword-chip > * {
  position: relative;
  z-index: 1;
}

/* Separador visual */
.ks-keyword-separator {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--ks-primary);
  border-radius: 50%;
  opacity: 0.3;
  margin: 0 0.25rem;
}

/* Layout alternativo: Grid para muchas palabras */
@media (max-width: 768px) {
  .ks-keywords-container {
    justify-content: center;
  }
}

/* Párrafos dinámicos con mejor formato */
.ks-intro-paragraph-text-old {
  color: #555;
  line-height: 1.8;
  font-size: 0.95rem;
  margin: 0;
}

.ks-intro-paragraph-text-old strong {
  color: var(--ks-primary-dark);
  font-weight: 700;
}

.ks-intro-paragraph-text-old em {
  color: var(--ks-primary);
  font-style: italic;
}

/* Sección de "relacionadas" */
.ks-related-section {
  background: white;
  border-radius: var(--ks-radius);
  padding: 2rem;
  margin: 2rem 0;
  border-left: 4px solid var(--ks-primary);
  box-shadow: var(--ks-shadow-sm);
}

.ks-related-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ks-related-section-title::before {
  content: '🎯';
  font-size: 1.3rem;
}

.ks-related-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.ks-related-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.ks-related-item:last-child {
  border-bottom: none;
}

.ks-related-item:hover {
  color: var(--ks-primary);
  padding-left: 0.5rem;
}

.ks-related-item-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.ks-related-item-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

/* Animación de entrada */
@keyframes chipSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ks-keyword-chip {
  animation: chipSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.ks-keyword-chip:nth-child(1) { animation-delay: 0.05s; }
.ks-keyword-chip:nth-child(2) { animation-delay: 0.1s; }
.ks-keyword-chip:nth-child(3) { animation-delay: 0.15s; }
.ks-keyword-chip:nth-child(4) { animation-delay: 0.2s; }
.ks-keyword-chip:nth-child(5) { animation-delay: 0.25s; }
.ks-keyword-chip:nth-child(6) { animation-delay: 0.3s; }
.ks-keyword-chip:nth-child(n+7) { animation-delay: 0.35s; }
