/* ==========================================================
   Hub SEO de categorías - Corrección final de layout
   ========================================================== */

.category-hub-section {
  --hub-purple: var(--wp--preset--color--default-purple, #820AD1);
  --hub-white: var(--wp--preset--color--white, #ffffff);
  --hub-black: var(--wp--preset--color--black, #111111);
  --hub-gray-800: var(--wp--preset--color--gray-800, #3f4650);
  --hub-soft-gray: #f5f5f5;

  width: 100%;
  font-family: Gellix, sans-serif;
  color: var(--hub-black);
}

/* Mismo ancho visual que los módulos del sitio */
.category-hub-section > .container,
.category-hub-section .container {
  width: min(1120px, calc(100% - 48px));
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

/* Header de cada sección */
.category-hub-header {
  max-width: 680px;
  margin: 0 0 0px;
}

.category-hub-title {
  color: var(--hub-black);
  font-family: Gellix, sans-serif;
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
}

.category-hub-description {
  color: var(--hub-gray-800);
  font-family: Gellix, sans-serif;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 400;
  line-height: 1.45;
  margin: 0;
}

/* ==========================================================
   Empieza aquí
   Se respeta card nativa del sitio: mm/card + card_secondary
   ========================================================== */

.category-hub-start {
  background: var(--hub-white);
  padding-top: 60px;
  padding-bottom: 60px;
}

.category-hub-native-listing {
  width: 100%;
  padding: 0;
  margin: 0;
  overflow: visible;
}

/*
  Importante:
  No redefinimos internamente .card__content__info,
  .card__content__title ni .card__content__holder.
  Dejamos que los estilos nativos de card_secondary trabajen.
*/

.category-hub-native-listing .post-listing__posts.wrapper_secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  margin: 0;
}

.category-hub-native-listing .post-listing__posts.wrapper_secondary .card {
  width: 100%;
  max-width: 376px;
  margin: 0;
}

.category-hub-native-listing .post-listing__posts.wrapper_secondary .card a {
  text-decoration: none;
}

@media (min-width: 768px) {
  .category-hub-native-listing .post-listing__posts.wrapper_secondary {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 30px;
    row-gap: 48px;
  }

  .category-hub-native-listing .post-listing__posts.wrapper_secondary .card {
    width: calc(50% - 15px);
    max-width: 376px;
  }
}

@media (min-width: 1024px) {
  .category-hub-native-listing .post-listing__posts.wrapper_secondary .card {
    width: calc(33.333% - 20px);
    max-width: 376px;
  }
}

/* Ajustes mínimos de compatibilidad visual */
.category-hub-native-listing .card_secondary .card__content__category__date {
  justify-content: space-between;
}

.category-hub-native-listing .card_secondary .card__content__category__date__cat {
  color: var(--hub-purple);
  text-decoration: none;
}

.category-hub-native-listing .card_secondary .card__content__title {
  text-decoration: none;
}

.category-hub-native-listing .card_secondary .card__content__title__text {
  color: var(--hub-black);
}

.category-hub-native-listing .card_secondary .card__content__title__text:hover {
  color: var(--hub-purple);
}

/* ==========================================================
   Temas clave con fondo gris y cards nativas del listing
   ========================================================== */

.category-hub-topics {
  background: #f5f5f5;
  padding-top: 60px;
  padding-bottom: 60px;
}

.category-hub-topics .category-hub-header {
  margin-bottom: 0px;
}

/* El listing de Temas clave debe comportarse igual que Empieza aquí */
.category-hub-topics-listing {
  width: 100%;
  padding: 0;
  margin: 0;
  overflow: visible;
}

.category-hub-topics-listing .post-listing__posts.wrapper_secondary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  margin: 0;
}

.category-hub-topics-listing .post-listing__posts.wrapper_secondary .card {
  width: 100%;
  max-width: 376px;
  margin: 0;
}

.category-hub-topics-listing .post-listing__posts.wrapper_secondary .card a {
  text-decoration: none;
}

@media (min-width: 768px) {
  .category-hub-topics-listing .post-listing__posts.wrapper_secondary {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 30px;
    row-gap: 48px;
  }

  .category-hub-topics-listing .post-listing__posts.wrapper_secondary .card {
    width: calc(50% - 15px);
    max-width: 376px;
  }
}

@media (min-width: 1024px) {
  .category-hub-topics-listing .post-listing__posts.wrapper_secondary .card {
    width: calc(33.333% - 20px);
    max-width: 376px;
  }
}

/* ==========================================================
   Preguntas frecuentes - Product card ajustada
   ========================================================== */

.category-hub-faqs {
  background: var(--hub-white, #ffffff);
  padding-top: 60px;
  padding-bottom: 60px;
}

.category-hub-product-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

/* Card completa clicable */
.category-hub-product-card {
  align-items: center;
  background: #f3f3f3;
  border-radius: 24px;
  box-sizing: border-box;
  color: #111111;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 24px;
  column-gap: 24px;
  min-height: 128px;
  padding: 28px 32px;
  position: relative;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

/* Hover: solo cambia el fondo */
.category-hub-product-card:hover {
  background: #e4e4e4;
  color: #111111;
  text-decoration: none;
  transform: none;
}

/* Ícono izquierdo: siempre negro */
.category-hub-product-card__icon {
  align-self: center;
  color: #111111;
  display: flex;
  height: 40px;
  justify-content: center;
  margin: 0;
  width: 40px;
}

.category-hub-product-card__icon svg {
  display: block;
  height: 40px;
  width: 40px;
}

.category-hub-product-card:hover .category-hub-product-card__icon {
  color: #111111;
}

/* Contenedor de texto */
.category-hub-product-card__text {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

/* Header interno */
.category-hub-product-card__header {
  align-items: flex-start;
  background: transparent;
  display: block;
  margin: 0 0 6px;
  padding: 0;
}

/* Título: siempre morado Nu */
.category-hub-product-card__title {
  color: var(--hub-purple, #820AD1) !important;
  font-family: Gellix, sans-serif;
  font-size: clamp(20px, 1.55vw, 26px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px !important;
}

.category-hub-product-card:hover .category-hub-product-card__title {
  color: var(--hub-purple, #820AD1);
}

/* Descripción: siempre negro */
.category-hub-product-card__description {
  color: #111111;
  font-family: Gellix, sans-serif;
  font-size: clamp(15px, 1.1vw, 18px);
  font-weight: 400;
  line-height: 1.38;
  margin: 0;
  max-width: 95%;
}

.category-hub-product-card:hover .category-hub-product-card__description {
  color: #111111;
}

/* Flecha derecha: siempre morado Nu y centrada verticalmente */
.category-hub-product-card__arrow {
  align-self: center;
  color: var(--hub-purple, #820AD1);
  display: flex;
  flex: 0 0 auto;
  height: 22px;
  justify-content: center;
  margin: 0;
  width: 23px;
}

.category-hub-product-card__arrow svg {
  display: block;
  height: 22px;
  width: 23px;
}

.category-hub-product-card:hover .category-hub-product-card__arrow {
  color: var(--hub-purple, #820AD1);
}

/* Evita subrayados heredados */
.category-hub-product-card,
.category-hub-product-card:hover,
.category-hub-product-card:focus {
  text-decoration: none;
}

/* Accesibilidad */
.category-hub-product-card:focus-visible {
  outline: 3px solid var(--hub-purple, #820AD1);
  outline-offset: 4px;
}

/* Tablet */
@media (max-width: 1023px) {
  .category-hub-product-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .category-hub-faqs {
    padding-top: 44px;
    padding-bottom: 48px;
  }

  .category-hub-product-card {
    grid-template-columns: 36px minmax(0, 1fr) 22px;
    column-gap: 16px;
    min-height: auto;
    padding: 24px 20px;
    border-radius: 20px;
  }

  .category-hub-product-card__icon {
    height: 36px;
    width: 36px;
  }

  .category-hub-product-card__icon svg {
    height: 36px;
    width: 36px;
  }

  .category-hub-product-card__title {
    font-size: 20px;
    line-height: 1.15;
  }

  .category-hub-product-card__description {
    font-size: 15px;
    line-height: 1.4;
    max-width: 100%;
  }

  .category-hub-product-card__arrow {
    height: 20px;
    width: 21px;
  }

  .category-hub-product-card__arrow svg {
    height: 20px;
    width: 21px;
  }
}

/* ==========================================================
   Sigue aprendiendo
   ========================================================== */

.category-hub-related {
  background: var(--hub-white);
  padding-top: 60px;
  padding-bottom: 60px;
}

.category-hub-related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.category-hub-related-card {
  align-items: center;
  background: transparent;
  border: 1px solid var(--hub-purple);
  border-radius: 999px;
  color: var(--hub-purple);
  display: inline-flex;
  font-family: Gellix, sans-serif;
  font-size: 14px;
  font-weight: 600;
  gap: 10px;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 18px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.category-hub-related-card span {
  color: currentColor;
}

.category-hub-related-card svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.category-hub-related-card svg path {
  stroke: currentColor;
}

.category-hub-related-card:hover {
  background: var(--hub-purple);
  color: var(--hub-white);
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 1023px) {
  .category-hub-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-hub-faq-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .category-hub-section > .container,
  .category-hub-section .container {
    width: min(100% - 32px, 1120px);
  }

  .category-hub-start,
  .category-hub-topics,
  .category-hub-faqs {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .category-hub-related {
    padding-top: 28px;
    padding-bottom: 44px;
  }

  .category-hub-header {
    margin-bottom: 0px;
  }

  .category-hub-title {
    font-size: 30px;
    line-height: 1.1;
  }

  .category-hub-description {
    font-size: 15px;
    line-height: 1.45;
  }

  .category-hub-topic-grid,
  .category-hub-faq-list {
    grid-template-columns: 1fr;
  }

  .category-hub-topic-card,
  .category-hub-faq-item {
    padding: 20px;
  }

  .category-hub-related-grid {
    flex-direction: column;
  }

  .category-hub-related-card {
    width: 100%;
  }
}