/* =========================================================
   TARJETA HERRAMIENTA TD – ESTILO FINAL (CON POPUP 2 COLUMNAS)
   ========================================================= */

/* Ocultar contenedores cuando se aplican filtros */
.elementor-element.udd-hide-on-filter,
[data-element_type].udd-hide-on-filter {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Forzar ocultamiento de elementos filtrados */
.udd-hidden-filter,
.elementor-element.udd-hidden-filter,
.elementor-column.udd-hidden-filter,
.elementor-widget.udd-hidden-filter {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  flex: 0 0 0 !important;
  flex-basis: 0 !important;
  flex-grow: 0 !important;
  flex-shrink: 1 !important;
}

/* =========================================================
   WIDGET DE BÚSQUEDA Y FILTROS
   ========================================================= */

.udd-search-filter-widget {
  width: 100%;
  margin-bottom: 30px;
}

/* Barra de búsqueda y filtros */
.udd-search-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Caja de búsqueda */
.udd-search-box {
  display: flex;
  gap: 0;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.udd-search-input {
  flex: 1;
  padding: 14px 90px 14px 20px; /* Aumentado padding-right para el botón X y el botón de búsqueda */
  font-size: 16px;
  border: 2px solid #D9E1EC;
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: #FFFFFF;
  color: #2B2F38;
  outline: none;
  transition: border-color 0.3s ease;
}

.udd-search-input:focus {
  border-color: #0A5C99;
}

.udd-search-input::placeholder {
  color: #A0A8B8;
}

.udd-search-btn {
  padding: 14px 24px;
  background: #0A5C99;
  border: 2px solid #0A5C99 !important;
  border-radius: 0 8px 8px 0;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.udd-search-btn:hover {
  background: #084a7d;
  border-color: #084a7d;
}

.udd-search-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.udd-search-clear {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px;
  background: transparent !important;
  border: none !important;
  color: #666666 !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 10;
}

.udd-search-clear:hover {
  color: #2B2F38;
}

.udd-search-clear svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* Fila de filtros */
.udd-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.udd-filter-select {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #D9E1EC;
  border-radius: 8px;
  background: #FFFFFF;
  color: #2B2F38;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%232B2F38' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.udd-filter-select:focus {
  border-color: #0A5C99;
}

.udd-filter-select:disabled {
  background-color: #F5F7FA;
  color: #A0A8B8;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Dropdown de ordenamiento personalizado */
.udd-sort-dropdown {
  position: relative;
  flex: 0 0 auto;
  min-width: auto;
}

.udd-sort-btn {
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #666666 !important;
  cursor: pointer !important;
  transition: color 0.3s ease !important;
  outline: none !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: normal !important;
  min-height: auto !important;
}

.udd-sort-btn:hover {
  color: #0A5C99 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.udd-sort-btn[aria-expanded="true"] {
  color: #0A5C99 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.udd-sort-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Ocultar iconos de ordenamiento por defecto */
.udd-sort-btn .sort-up-icon,
.udd-sort-btn .sort-down-icon {
  display: none;
}

/* Mostrar icono correcto según el estado */
.udd-sort-btn[data-sort="asc"] .sort-up-icon {
  display: block;
}

.udd-sort-btn[data-sort="desc"] .sort-down-icon {
  display: block;
}

.udd-sort-btn[data-sort=""] .sort-default-icon,
.udd-sort-btn:not([data-sort]) .sort-default-icon {
  display: block;
}

.udd-sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 8px 0;
}

.udd-sort-menu[hidden] {
  display: none;
}

.udd-sort-option {
  width: 100% !important;
  padding: 10px 16px !important;
  text-align: left !important;
  border: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #2B2F38 !important;
  font-size: 14px !important;
  font-family: inherit !important;
  line-height: 1.6 !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
  display: block !important;
  border-radius: 4px !important;
  min-height: auto !important;
}

.udd-sort-option:hover {
  background: #F5F7FA !important;
  background-color: #F5F7FA !important;
  color: #0A5C99 !important;
}

.udd-sort-option.active {
  font-weight: 600 !important;
  color: #0A5C99 !important;
  background: #F5F7FA !important;
  background-color: #F5F7FA !important;
}

/* Contador de resultados */
.udd-results-count {
  margin-top: 15px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

/* Mensaje de no resultados */
.udd-no-results {
  text-align: center;
  padding: 40px 20px;
  background: #F5F7FA;
  border-radius: 12px;
  margin-top: 20px;
}

.udd-no-results p {
  font-size: 16px;
  color: #2B2F38;
  margin: 0;
  font-weight: 500;
}

/* Responsive para búsqueda y filtros */
@media (max-width: 768px) {
  .udd-search-box {
    max-width: 100%;
  }

  .udd-filters-row {
    flex-direction: column;
  }

  .udd-filter-select {
    width: 100%;
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .udd-search-input {
    font-size: 14px;
    padding: 12px 16px;
  }

  .udd-search-btn {
    padding: 12px 20px;
  }
}

/* ---------- CONTENEDOR TARJETA ---------- */
.udd-tool-card{
  background: #ffffff;
  border-radius: 16px !important;
  padding: 28px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 480px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

/* ---------- TITULO ---------- */
.udd-tool-card__title{
  font-size: 44px;
  line-height: 1.05;
  font-weight: 800;
  color: #0B1B4D;
  margin: 0 0 18px 0;
}

/* ---------- BADGE LICENCIA ---------- */
.udd-tool-card__pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-left: auto;
  /* No definir background aquí, debe venir del widget inline */
}

/* Asegurar que las tarjetas clonadas mantengan el background inline */
.udd-results-grid .udd-tool-card__pill {
  /* El background debe venir del atributo style inline del widget original */
  background: inherit;
}

/* ---------- CATEGORÍA ---------- */
.udd-tool-card__category{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2CB8A8;
  margin: 0 0 18px 0;
}

/* ---------- DESCRIPCIÓN (wrapper) ---------- */
.udd-tool-card__description{
  font-size: 16px;
  line-height: 1.6;
  color: #2B2F38;
  flex-grow: 0;
}

/* Texto que se trunca desde JS */
.udd-tool-card__desc-text{
  display: inline;
}

/* ---------- LEER MÁS (Estilo Restaurado) ---------- */
.udd-tool-card__read-more{
  display: inline;
  background: transparent !important; /* Fuerza transparencia */
  border: none !important;
  padding: 0 !important;
  margin-left: 6px;
  color: #2CB8A8 !important;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: 16px;
}
.udd-tool-card__read-more:hover{
  opacity: 0.85;
}

/* ---------- FOOTER BOTONES ---------- */
.udd-tool-card__footer{
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* ---------- BOTÓN PRINCIPAL (Estilo Restaurado) ---------- */
.udd-tool-card__btn-main{
  flex: 1;
  background: #0A5C99;
  color: #ffffff !important; /* Texto blanco forzado */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  padding: 18px 20px;
  text-align: center;
  text-decoration: none !important;
  
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- BOTÓN TIPS (AMPOLLETA) - RESTAURADO ---------- */
.udd-tool-card__btn-tips{
  width: 70px;     /* Ancho fijo para ser cuadrado */
  flex: 0 0 70px;  /* No estirar */
  height: auto;
  
  background: transparent !important; /* Fondo transparente forzado */
  border: 2px solid #D9E1EC;
  border-radius: 8px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  cursor: pointer;
  padding: 0 !important;
  margin: 0;
  
  /* Color heredado para permitir cambios desde Elementor */
  color: inherit; 
}

/* Iconos grandes (SVG, I, Elementor) */
.udd-tool-card__btn-tips .elementor-icon,
.udd-tool-card__btn-tips i, 
.udd-tool-card__btn-tips svg {
  font-size: 34px !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 1 !important;
  
  display: flex !important;
  align-items: center;
  justify-content: center;
  
  fill: currentColor;
  transition: all 0.3s ease;
}

.udd-tool-card__btn-tips:hover .elementor-icon,
.udd-tool-card__btn-tips:hover i,
.udd-tool-card__btn-tips:hover svg {
  opacity: 0.75;
}

/* =========================================================
   RESPONSIVE TARJETA
   ========================================================= */

@media (max-width: 1024px){
  .udd-tool-card{
    min-height: 250px !important;
  }
}

@media (max-width: 767px){
  .udd-tool-card{
    min-height: auto; 
  }
}

.udd-tool-card{
  min-height: 320px; 
}
.udd-tool-card__title,
.udd-tool-card__category,
.udd-tool-card__description{
  margin-bottom: 0 !important;
}
.udd-tool-card__title{ margin-bottom: 14px !important; }
.udd-tool-card__category{ margin-bottom: 14px !important; }
.udd-tool-card__footer{
  margin-top: 10px !important;
}

/* =========================================================
   ARREGLO CRUZ POPUP
   ========================================================= */
.elementor-popup-modal .dialog-close-button {
    color: #0B1B4D !important;
    background-color: transparent !important;
}
.elementor-popup-modal .dialog-close-button svg {
    fill: #0B1B4D !important;
}

/* =========================================================
   ESTILOS PARA EL POPUP DE TIPS (2 COLUMNAS)
   ========================================================= */

/* Contenedor Flex para 2 Columnas */
.udd-tip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
}

/* Columna Izquierda: Video */
.udd-video-wrapper {
    flex: 1 1 45%; 
    width: 45%;
    margin-bottom: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}
.udd-video-wrapper iframe {
    display: block;
    width: 100%;
    min-height: 300px;
    height: auto;
    aspect-ratio: 16 / 9;
}

/* Fallbacks */
.udd-video-wrapper.no-iframe {
    padding: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}
.udd-btn-video-fallback {
    display: inline-block;
    padding: 10px 20px;
    background: #0A5C99;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
}
.udd-video-wrapper.text-only {
    padding: 20px;
}

/* Columna Derecha: Texto */
.udd-tip-text {
    flex: 1 1 45%;
    width: 45%;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    text-align: left;
}
.udd-tip-text p {
    margin-top: 0;
}

/* Swiper Ajustes */
.myTipsSwiper {
    width: 100%;
    padding-bottom: 40px;
}
.myTipsSwiper .swiper-button-next,
.myTipsSwiper .swiper-button-prev {
    color: #0A5C99;
    transform: scale(0.6);
    top: 40%;
}
.myTipsSwiper .swiper-pagination-bullet-active {
    background: #0A5C99;
}

/* Responsive Popup */
@media (max-width: 768px) {
    .udd-tip-row {
        flex-direction: column;
        gap: 20px;
    }
    .udd-video-wrapper,
    .udd-tip-text {
        flex: 1 1 100%;
        width: 100%;
    }
    .udd-video-wrapper iframe {
        min-height: 200px;
    }
}