/* Código Rojo: chatbots por especialidad */

.cr-cb {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cr-cb [hidden] {
  display: none !important;
}

.cr-cb-search {
  margin-top: 28px;
  max-width: 760px;
}

.cr-cb-alert {
  margin-top: 24px;
  padding: 14px 20px;
  border-radius: var(--cr-radius-md);
  background: var(--cr-pink-2);
  border: 1px solid var(--cr-pink);
  color: var(--cr-red-dark);
  font-weight: 600;
}

.cr-cb-h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.cr-cb-text {
  flex-grow: 1;
  min-width: 0;
}

/* ---------- Recientes y favoritos ---------- */

.cr-cb-recent > .cr-container {
  padding-top: 40px;
}

.cr-cb-recent .cr-cb-h2 {
  margin-bottom: 16px;
}

.cr-cb-recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cr-cb-recent-card {
  padding: 14px 16px;
}

.cr-cb-recent-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(222, 6, 19, 0.2);
  color: var(--cr-red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.cr-cb-recent-kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cr-muted-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-cb-recent-name {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.cr-cb-favs-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--cr-radius-md);
  border: 1.5px dashed var(--cr-line);
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cr-slate);
}

.cr-cb-favs-empty .cr-icon-circle {
  width: 48px;
  height: 48px;
}

.cr-cb-favs-empty strong {
  color: var(--cr-ink);
}

.cr-cb-favs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--cr-radius-md);
  background: var(--cr-pink-2);
  border: 1px solid var(--cr-pink);
}

.cr-cb-favs-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cr-red);
}

.cr-cb-star-on svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.cr-cb-fav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cr-cb-fav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  height: 34px;
  padding: 0 4px 0 12px;
  border-radius: var(--cr-radius-pill);
  background: #fff;
  border: 1px solid var(--cr-pink);
}

.cr-cb-fav a {
  min-width: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--cr-ink);
  text-decoration: none;
  border-radius: var(--cr-radius-xs);
}

.cr-cb-fav a:hover {
  color: var(--cr-red);
}

.cr-cb-fav-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--cr-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}

.cr-cb-fav-remove:hover {
  background: var(--cr-pink-2);
  color: var(--cr-red);
}

.cr-cb-login {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 16px 16px 20px;
  border-radius: var(--cr-radius-md);
}

.cr-cb-login-text {
  flex-grow: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Rejilla de especialidades ---------- */

.cr-cb-main {
  flex-grow: 1;
}

.cr-cb-main > .cr-container {
  padding-top: 40px;
  padding-bottom: 88px;
}

.cr-cb-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.cr-cb-count {
  font-size: 15px;
  color: var(--cr-slate);
}

.cr-cb-all {
  margin-left: auto;
}

.cr-cb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cr-cb-grid > li {
  display: flex;
  min-width: 0;
}

.cr-cb-card {
  width: 100%;
}

.cr-cb-name {
  display: block;
  font-size: 15.5px;
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.cr-cb-sub {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--cr-slate);
  overflow-wrap: anywhere;
}

.cr-cb-card .cr-icon-circle {
  font-size: 22px;
}

/* ---------- Panel lateral ---------- */

.cr-cb-drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cr-drawer-head .cr-kicker {
  font-size: 12px;
  color: var(--cr-red-soft);
}

.cr-cb-drawer-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cr-cb-drawer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cr-cb-drawer-title {
  margin: 14px 0 0;
  font-size: clamp(28px, 6vw, 36px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.cr-cb-drawer-desc {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cr-muted-dark);
}

.cr-cb-bot {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--cr-line);
}

.cr-cb-row {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 12px;
  border-radius: var(--cr-radius-sm);
  color: var(--cr-ink);
  text-decoration: none;
  transition: background 0.2s ease;
}

.cr-cb-row:hover {
  background: var(--cr-pink-2);
  color: var(--cr-ink);
}

.cr-cb-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cr-red);
}

.cr-cb-row-name {
  flex-grow: 1;
  min-width: 0;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cr-cb-row-go {
  flex-shrink: 0;
  color: var(--cr-red);
  font-weight: 700;
}

.cr-cb-star {
  color: var(--cr-muted);
}

.cr-cb-star[aria-pressed='true'] {
  color: var(--cr-red);
}

.cr-cb-star[aria-pressed='true'] svg {
  fill: currentColor;
}

.cr-cb-group {
  margin-top: 8px;
}

.cr-cb-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 12px 10px;
  border-radius: var(--cr-radius-sm);
  color: var(--cr-ink);
  text-decoration: none;
}

.cr-cb-group-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.cr-cb-group-all {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--cr-red);
}

.cr-cb-group-head:hover .cr-cb-group-all {
  color: var(--cr-red-hover);
}

.cr-cb-group .cr-cb-group {
  padding-left: 12px;
  border-left: 2px solid var(--cr-pink);
  margin-left: 12px;
}

.cr-cb-drawer-all {
  width: 100%;
  height: 56px;
  font-size: 16px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

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

@media (max-width: 1100px) {
  .cr-cb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .cr-cb-grid,
  .cr-cb-recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .cr-cb-grid,
  .cr-cb-recent-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cr-cb-search {
    height: 60px;
    padding-left: 20px;
  }

  .cr-cb-search input {
    font-size: 16px;
  }

  .cr-cb-all {
    margin-left: 0;
  }

  .cr-drawer-head {
    padding: 24px 20px 28px;
  }

  .cr-drawer-foot {
    padding: 16px 20px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cr-cb-row,
  .cr-cb-drawer-close {
    transition: none;
  }
}
