.bretema-catalogo {
  --green: #062d25;
  --gold: #d4a64f;
  --light: #f4f5f7;
  --text: #2e2e2e;
  --white: #ffffff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
}

.bretema-catalogo__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.bretema-catalogo__search {
  flex: 1;
  min-width: 240px;
  border: 1px solid #d8dce2;
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  background: var(--white);
}

.bretema-catalogo__search:focus-visible,
.bretema-btn:focus-visible,
.bretema-familia__header:focus-visible,
.bretema-curso__toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.bretema-catalogo__actions {
  display: flex;
  gap: 0.5rem;
}

.bretema-btn {
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--white);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.bretema-btn--ghost {
  background: transparent;
  color: var(--green);
}

.bretema-familia {
  border: 1px solid #e8eaef;
  border-radius: 12px;
  margin-bottom: 0.85rem;
  background: var(--white);
  overflow: hidden;
}

.bretema-familia__header {
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--light);
  color: var(--green);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  font-weight: 700;
}

.bretema-familia__header:hover {
  background: #ebedf1;
}

.bretema-familia__count {
  background: var(--gold);
  color: var(--green);
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
}

.bretema-familia__body {
  padding: 0.5rem 1rem 1rem;
  animation: bretemaFade 0.2s ease;
}

.bretema-curso {
  border: 1px solid #eceef2;
  border-radius: 10px;
  padding: 0.9rem;
  margin-top: 0.7rem;
  transition: box-shadow 0.2s ease;
}

.bretema-curso:hover {
  box-shadow: 0 8px 22px rgba(6, 45, 37, 0.08);
}

.bretema-curso__header {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
}

.bretema-curso__header h3 {
  margin: 0;
  color: var(--green);
  font-size: 1.05rem;
}

.bretema-curso__hours {
  margin: 0;
  color: #5a5f68;
  font-size: 0.9rem;
}

.bretema-curso__toggle {
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.bretema-curso__content {
  margin-top: 0.6rem;
  border-top: 1px dashed #d9dde4;
  padding-top: 0.6rem;
  animation: bretemaFade 0.2s ease;
}

.bretema-catalogo__empty {
  margin: 1rem 0;
  background: #fff8e8;
  border: 1px solid #f2ddb0;
  color: #7b5d1c;
  padding: 0.8rem;
  border-radius: 8px;
}

@keyframes bretemaFade {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 680px) {
  .bretema-catalogo__tools {
    align-items: stretch;
  }

  .bretema-catalogo__actions {
    width: 100%;
  }

  .bretema-btn {
    flex: 1;
  }
}

.bretema-curso__objetivo[hidden],
.bretema-curso__content[hidden]{
  display:none;
}

/* ===== Rediseño visual catálogo Bretema ===== */

.bretema-catalogo{
  max-width: 1180px;
}

/* herramientas */
.bretema-catalogo__tools{
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e8eaef;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 10px 30px rgba(6,45,37,0.04);
}

.bretema-catalogo__search{
  border: 1px solid #dfe4ea;
  border-radius: 999px;
  padding: 0.95rem 1rem;
  font-size: 0.96rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.bretema-catalogo__search::placeholder{
  color: #7b818a;
}

.bretema-btn{
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 6px 16px rgba(6,45,37,0.08);
}

.bretema-btn:hover{
  transform: translateY(-1px);
}

.bretema-btn--ghost{
  border: 1px solid #d8dde5;
  background: #fff;
  color: var(--green);
  box-shadow: none;
}

/* familias */
.bretema-familia{
  border: 1px solid #e8eaef;
  border-radius: 16px;
  margin-bottom: 1rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(6,45,37,0.04);
}

.bretema-familia__header{
  background: linear-gradient(180deg, #f8f9fa 0%, #f2f4f6 100%);
  color: var(--green);
  padding: 1.05rem 1.15rem;
  font-size: 1rem;
  letter-spacing: 0.2px;
  transition: background 0.2s ease;
}

.bretema-familia__header:hover{
  background: linear-gradient(180deg, #f2f4f6 0%, #eceff2 100%);
}

.bretema-familia__count{
  background: rgba(212,166,79,0.15);
  color: var(--green);
  border: 1px solid rgba(212,166,79,0.35);
  font-weight: 700;
  padding: 0.25rem 0.55rem;
}

.bretema-familia__body{
  padding: 0.4rem 1rem 1rem;
}

/* cursos */
.bretema-curso{
  border: 1px solid #eceef2;
  border-radius: 14px;
  padding: 1rem 1rem 0.95rem;
  margin-top: 0.8rem;
  background: #fff;
  transition: all 0.2s ease;
}

.bretema-curso:hover{
  transform: translateY(-1px);
  border-color: rgba(6,45,37,0.18);
  box-shadow: 0 12px 24px rgba(6,45,37,0.07);
}

.bretema-curso.is-open{
  border-color: rgba(212,166,79,0.55);
  box-shadow: 0 14px 30px rgba(6,45,37,0.08);
}

.bretema-curso__header{
  align-items: center;
  gap: 0.75rem;
}

.bretema-curso__header h3{
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 700;
}

.bretema-curso__hours{
  display: inline-flex;
  align-items: center;
  background: rgba(6,45,37,0.06);
  color: var(--green);
  border: 1px solid rgba(6,45,37,0.08);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* botón ver contenido */
.bretema-curso__toggle{
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  background: transparent;
  border: 1px solid rgba(6,45,37,0.12);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.bretema-curso__toggle:hover{
  background: rgba(6,45,37,0.04);
  border-color: rgba(6,45,37,0.2);
}

.bretema-curso__toggle[aria-expanded="true"]{
  background: rgba(212,166,79,0.14);
  border-color: rgba(212,166,79,0.35);
  color: var(--green);
}

/* objetivo y contenido */
.bretema-curso__objetivo{
  margin-top: 0.9rem;
  background: #f8fafb;
  border: 1px solid #e7ebf0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  line-height: 1.6;
}

.bretema-curso__content{
  margin-top: 0.75rem;
  background: #fcfcfd;
  border: 1px solid #eceef2;
  border-top: 1px solid #eceef2;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  line-height: 1.7;
}

.bretema-curso__content[hidden],
.bretema-curso__objetivo[hidden]{
  display: none;
}

/* empty state */
.bretema-catalogo__empty{
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

/* responsive */
@media (max-width: 680px){
  .bretema-catalogo__tools{
    border-radius: 14px;
    padding: 0.85rem;
  }

  .bretema-familia__header{
    padding: 0.95rem;
  }

  .bretema-curso{
    padding: 0.9rem;
  }

  .bretema-curso__header h3{
    font-size: 1rem;
  }
}

/* ===== Mejorar jerarquía visual ===== */

/* FAMILIA (más fuerte) */
.bretema-familia__header{
  background: linear-gradient(90deg, #062d25 0%, #0b3a30 100%);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.bretema-familia__count{
  background: #d4a64f;
  color: #062d25;
  border: none;
}

/* CURSOS (menos blanco, más contraste) */
.bretema-curso{
  background: #f9fbfb;
  border: 1px solid #e2e7ec;
}

/* TÍTULO CURSO */
.bretema-curso__header h3{
  color: #062d25;
  font-weight: 700;
}

/* HORAS (más visibles) */
.bretema-curso__hours{
  background: #062d25;
  color: #ffffff;
  border: none;
}

/* BOTÓN */
.bretema-curso__toggle{
  background: #ffffff;
}

.bretema-curso__toggle[aria-expanded="true"]{
  background: #d4a64f;
  color: #062d25;
}

/* OBJETIVO (caja diferenciada) */
.bretema-curso__objetivo{
  background: #eef3f3;
  border-left: 4px solid #d4a64f;
}

/* CONTENIDO (más neutro) */
.bretema-curso__content{
  background: #ffffff;
}

/* ===== Ajustes de contraste finales ===== */

/* fondo del bloque superior */
.bretema-catalogo__tools{
  background: #eef3f1;
  border: 1px solid #d7e0dc;
}

/* buscador */
.bretema-catalogo__search{
  background: #ffffff;
  border: 1px solid #bfcac5;
  color: #062d25;
}

.bretema-catalogo__search::placeholder{
  color: #5f6f69;
}

/* botones superiores */
.bretema-btn{
  background: #062d25;
  color: #ffffff;
  border: 1px solid #062d25;
}

.bretema-btn:hover{
  background: #0b3a30;
  color: #ffffff;
}

.bretema-btn--ghost{
  background: #dfe8e4;
  color: #062d25;
  border: 1px solid #c4d0ca;
}

.bretema-btn--ghost:hover{
  background: #cfdad5;
  color: #062d25;
}

/* cabecera de familia */
.bretema-familia__header{
  background: linear-gradient(90deg, #062d25 0%, #0b3a30 100%);
  color: #ffffff;
}

.bretema-familia__header:hover{
  background: linear-gradient(90deg, #0b3a30 0%, #11473b 100%);
  color: #ffffff;
}

/* contador */
.bretema-familia__count{
  background: #d4a64f;
  color: #062d25;
}

/* tarjetas de curso */
.bretema-curso{
  background: #f4f7f6;
  border: 1px solid #dce4e1;
}

.bretema-curso:hover{
  background: #eef3f1;
  border-color: #cfd9d5;
}

/* título curso */
.bretema-curso__header h3{
  color: #062d25;
}

/* horas */
.bretema-curso__hours{
  background: #dce7e2;
  color: #062d25;
}

/* botón ver contenido */
.bretema-curso__toggle{
  background: #ffffff;
  border: 1px solid #cfd8d4;
  color: #062d25;
}

.bretema-curso__toggle:hover{
  background: #eef3f1;
  color: #062d25;
}

.bretema-curso__toggle[aria-expanded="true"]{
  background: #d4a64f;
  color: #062d25;
  border-color: #d4a64f;
}

/* objetivo */
.bretema-curso__objetivo{
  background: #eaf0ee;
  border-left: 4px solid #d4a64f;
  color: #24312d;
}

/* contenido */
.bretema-curso__content{
  background: #ffffff;
  color: #2e2e2e;
}

.bretema-curso__content{
  white-space: pre-line;
  line-height: 1.45;
  font-size: 0.93rem;
  padding: 0.7rem 0.9rem;
  margin-top: 0.5rem;
  background: #ffffff;
  border: 1px solid #e2e7ec;
  border-left: 3px solid rgba(212,166,79,0.4);
  border-radius: 10px;
  color: #2e2e2e;
}

.bretema-curso__objetivo{
  margin-top: 0.6rem;
  padding: 0.7rem 0.9rem;
  line-height: 1.5;
}

.bretema-curso__content[hidden],
.bretema-curso__objetivo[hidden]{
  display:none;
}