/*
 * gva_busquedas_dge.css
 * =====================
 * Estilos del panel lateral de búsqueda y facetas.
 *
 * Extraídos de ckanext-dge/assets/css/dge-base-ckan.css (secciones
 * custom_select, radio-button__filter__type__search, container__filter__type__search,
 * .filters) y dge-modules-ckan.css (.filters general).
 *
 * Las referencias a var(--xxx) usan las variables CSS del DGE. Si tu
 * instalación no tiene esas variables, sustituye por colores directos:
 *   --primary-300 → #cce0f5
 *   --primary-400 → #4da6e8
 *   --primary-500 → #1a7abf --> Sustituido por 293d82 (azul indicado en manual de estilos GVA)
 *   --primary-600 → #0d5a8f
 *   --dark-gray   → #555555
 *   --white       → #ffffff
 */

/* ============================================================
   DESPLEGABLE DE FACETA (.custom_select)
   Fuente: dge-base-ckan.css líneas 112-196
   ============================================================ */

.custom_select {
  box-sizing: border-box;
  width: 100%;
  position: relative;}

.custom_select h2 {
  font-size: .875rem;
  line-height: normal;
  color: var(--primary-600, #0f595c); /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  margin-top: .83em;
  margin-bottom: 0.5rem !important;
  font-weight: 600;
}

.custom_select .custom_select-body {
  cursor: pointer;
  position: relative;
}

.custom_select .custom_select-body input.filter-input {
  cursor: pointer;
  width: 100%;
  padding: 0.375rem 2rem 0.375rem 0.5rem;
  border: 2px solid var(--primary-300, #0f595c); /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  border-radius: 4px;
  font-size: 16px;
  font-weight: normal;
  background-color: var(--white, #fff);
  box-sizing: border-box;
}

.custom_select .custom_select-body input.filter-input::placeholder {
  color: var(--dark-gray, #555);
}

.custom_select .custom_select-body .custom_select-arrow {
  position: absolute;
  right: .625rem;
  top: 0.9rem;
  pointer-events: none;
}

.custom_select .custom_select-body.select-visible + ul {
  display: flex;
}

.custom_select ul {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  display: none;
  min-width: 10rem;
  width: 100%;
  padding: 0;
  margin: 0;
  /* fo nt-size: .85rem; */
  /* fo nt-family: montserrat; */
  font-weight: normal;
  
  color: var(--dark-gray, #555);
  list-style: none;
  background-color: var(--white, #fff);
  border: 1px solid var(--primary-300, #cce0f5);
  border-radius: .35rem;
  flex-direction: column;
  max-height: 400px;
  overflow-y: scroll;
  margin-top: 5px;
}

.custom_select ul li {
  padding: .5rem 1rem;
  background-color: var(--white, #fff);
  transition: .2s background-color;
}

.custom_select ul li:hover {
  background-color: var(--primary-300, #cce0f5);
}

.custom_select ul li input[type="checkbox"] {
  /* accesible pero oculto visualmente */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.custom_select ul li label {
  cursor: pointer;
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.625rem;
  /* fo nt-size: .85rem; */
  /* fo nt-family: montserrat; */
  font-weight: normal;
  
  margin-bottom: 0;
  width: 100%;
}

.custom_select ul li label::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 10px; /* GESTIC-821911 08/07/2026 */
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid var(--primary-400, #555555); /* Cambio de color, de  #4da6e8 a #0f595c */ /* Se quita color. Si no funcionase, pondremos 555555 */
  border-radius: 3px;
  background: #fff;
  transition: .2s background-color;
}

.custom_select ul li input[type="checkbox"]:checked + label::before {
  background-color: var(--primary-500, #293d82);
  border-color: var(--primary-500, #293d82);
}

.custom_select ul li input[type="checkbox"]:checked + label::after {
  content: '✓';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .75rem;
  color: #fff;
  line-height: 1;
}

/* ============================================================
   SELECTOR OR / AND (.container__filter__type__search)
   Fuente: dge-base-ckan.css líneas 7316-7370
   ============================================================ */
   
/* TIPO DE BÚSQUEDA */
.container__filter__type__search {
 display: flex;
  flex-direction: column !important;
  align-items: flex-start !important;
  padding: 0px 0px !important; 
}

.container__filter__type__search .span__filter__type__search {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

/* OR / AND */
.container__filter__type__search .container__filter__type__search_and__or {
  display: flex;
  flex-direction: row;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  margin-left: 0 !important;
  gap: 16px;
  width: 100%;
  flex-wrap: nowrap;
}

.radio-button__filter__type__search {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;   /* clave */
  margin: 0;
}

.radio-button__filter__type__search::after {
  content: " ";
}

.radio-button__filter__type__search a {
  background-color: transparent !important;
  display: flex;
  text-decoration: none;
  color: var(--dark-gray, #555);
  padding: 0;
  gap: 0.175rem;
  align-items: center;
}

.radio-button__filter__type__search a:hover .radio-button__control {
  border-color: var(--primary-500, #293d82);
  background-color: var(--primary-300, #cce0f5) !important;
}

.radio-button__input {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.radio-button__control {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--primary-400, #0f595c); /* Se cambia a verde claro, 00bb99 (oscuro, 0f595c, queda un poco feo)*/
  border-radius: 50%;
  background: #fff;
  position: relative;
  flex-shrink: 0;
  transition: .2s all;
}

.radio-button__control::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1.2rem;
  height: 1.2rem;
  background-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transition: .2s opacity;
}

.radio-button__input:checked + a .radio-button__control {
  border-color: var(--primary-500, #293d82);
  background-color: var(--primary-500, #293d82);
}

.radio-button__input:checked + a .radio-button__control::after {
  opacity: 1;
}

.radio-button__label {
  /* fo nt-size: .875rem; */
  margin-left: 0.25rem;
}

.and_padding {
  margin-left: 4px;
}

/* ============================================================
   PANEL LATERAL (.filters, .secondary)
   Fuente: dge-modules-ckan.css
   ============================================================ */
   
   
.row {
  display: flex;
  align-items: stretch;
}


.secondary {
  display: flex;
  flex-direction: column;
}

#gva-facet-panel {
  flex: 0; /* o nada */
}

.btn-info-reutilitzadors {
  margin-top: auto;
}


.gva-bottom-link {
  margin-top: 10px;
}



/* FIX REAL CKAN GRID */
.secondary,
.primary,
.col-md-3,
.col-sm-3 {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* HEADER (titulos de etiquetas, formatos ... ) */
.filters h2 {
  font-size: 12px;
  font-weight: 700;
  color: #0f595c; /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
}
.filters .h2 {
  /* fo nt-size: 12px;
  fo nt-weight: 700; */
  font-size: 16px;
  /* fo nt-family: 'Work Sans', sans-serif; */
  color: #0f595c; /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  
  font-weight: normal; /* GESTIC-821911 FUENTE */
}

.btn, label { /* GESTIC-821911 FUENTE */
    font-weight: normal;
    font-size: 16px;
    /* fo nt-family: 'Work Sans', sans-serif; */
}



/* LABELS */
.filters label,
.filters legend {
  font-size: 14px;
  font-weight: 600;
  /*color: #1f5c5c;*/
  margin-bottom: 6px;
  display: block;
}

/* ESPACIADO ENTRE BLOQUES */
.filters .module-content {
  margin-bottom: 18px;
}

/* RADIO BUTTONS */
.filters input[type="radio"] {
  accent-color: #1f5c5c;
  margin-right: 6px;
}
/* INPUTS Y SELECTS */
.filters input,
.filters select,
.custom_select {
  text-align: left !important;
}

.filters .radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* SELECTS */
.filters select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #1f5c5c;
  border-radius: 4px;
  background-color: #ffffff;
  font-size: 14px;
  color: #333;
}

/* INPUT BUSCADOR */
.filters input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #1f5c5c;
  border-radius: 4px;
}

/* EFECTO AL HACER FOCO */
.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: #174949;
  box-shadow: 0 0 0 2px rgba(31, 92, 92, 0.2);
}

/*
#gva-facet-panel,
#gva-facet-panel * {
  margin-left: 5px !important;
}
*/
#gva-facet-panel .row,
#gva-facet-panel .col-md-3,
#gva-facet-panel .col-sm-3,
#gva-facet-panel .facet,
#gva-facet-panel .module,
#gva-facet-panel .panel-body,
#gva-facet-panel .module-content {
  padding-left: 0 !important;
}
.filters .module-content,
.container__filter__type__search {
  width: 100% !important;
  align-items: flex-start !important;
}

.filters .module-content.search-form {
  margin-bottom: 1rem;
}

.filters .module-content.search-form h2 {
  font-size: .875rem;
  font-weight: 600;
  color: var(--primary-600, #0f595c); /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  margin-bottom: 0.5rem;
}

.filters .module-content.search-form div {
  display: flex;
  position: relative;
}

/* Botón buscador dentro del formulario lateral */
.btn-searcher {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 2.5rem;
  background-image: url(/images/search.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1rem;
}

/* CONTENEDOR GENERAL */

#gva-facet-panel2 {
  /* background-color: #f1f3f2; */
  border: 5px solid #0f595c; /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  border-radius: 12px;
  /* padding: 16px; */
  padding: 26px 10px 10px 20px;
  text-align: left !important;
  margin-top: 10px;
}

/* SOLO contenedor principal */
#gva-facet-panel {
  /* background-color: #f1f3f2; */
  border: 2px solid #0f595c; /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  border-radius: 8px;
  /* padding: 16px; */
  padding: 16px 0px 0px 0px;
  text-align: left !important;
  margin-top: 10px;
}

#gva-facet-panel .filters {
  background: transparent !important;
  border: none !important;
  padding: 10 !important;
  /* display: flex !important; */
  flex-direction: column !important;
  align-items: flex-start !important
}

/* TITULOS */
#gva-facet-panel .filters h2,
#gva-facet-panel .span__filter__type__search,
#gva-facet-panel .module-heading {
  text-align: left !important;
  align-self: flex-start !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

#gva-facet-panel .module-heading * {
  color: transparent !important;
}

#gva-facet-panel .module-heading::before {
  content: "Filtrar por" !important;
  color: #0f595c !important; /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  position: absolute;
  left: 0;
}

/* TODOS LOS TITULOS INTERNOS:
   Búsqueda, Publicador, Categoria, Tema... */
#gva-facet-panel .filters h2,
#gva-facet-panel .filters legend,
#gva-facet-panel .filters label,
#gva-facet-panel .span__filter__type__search {
  /* fo nt-family: montserrat, sans-serif !important; */
  font-size: 16px !important; 
 /* font-weight: 600 !important; */
 /* color: #0f595c !important;*/ /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */ 
                                 /* Se cancela el color verde, a indicación de AM en GESTIC-821911          */
  line-height: 1.3;
}


/* ============================================================
   BOTÓN BORRAR FILTROS (.badge-clear-all)
   ============================================================ */

.badge-clear-all .link--primary a { /* GESTIC-821911 FUENTE */
  display: inline-flex !important;
  align-items: center;
  color: #0f595c !important; /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
  text-decoration: none;
  
  font-weight: normal;
  font-size: 16px;
  /* fo nt-family: 'Work Sans', sans-serif; */
}

.badge-clear-all .link--primary a::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 4px;

  background: url('/images/trash-can.svg') no-repeat center;
  background-size: contain;
}

.badge-clear-all .link--primary a::before {
  content: none !important;
}

.badge-clear-all .remove-filter,
.badge-clear-all .close,
.badge-clear-all .icon-remove {
  display: none !important;
}

/* ============================================================
   FLEX UTILITIES (usadas en search.html del DGE)
   ============================================================ */

.flex-display          {display: flex;color: #0f595c;margin-left: 5px; margin-right: 10px;} /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
.flex-row              { flex-direction: row; }
.flex-justify-between  { justify-content: space-between; }
.flex-baseline         { align-items: baseline; }
.flex-center           { align-items: center; }
/*.flex-gap-05           { gap: 0.5rem; }*/
.flex-gap-2            { gap: 0.5rem; }
.align-right           { margin-left: 5px; }

/* ============================================================
   ÍCONO FILTRO (cabecera del panel)
   ============================================================ */

.filter-icon {
  width: 1rem;
  height: 1rem;
  margin-left: .25rem;
  vertical-align: middle;
}

/* ============================================================
   BOTÓN MÓVIL "Filter Results"
   ============================================================ */

.button-arrow-filter-mobile {
  display: none;
}

@media (max-width: 767px) {
  .button-arrow-filter-mobile {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .5rem 1rem;
    background: var(--primary-500, #0f595c); /* Se cambia de 146362 a 0f595c, (verde indicado en manual de estilos GVA) */
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: .875rem;
  }  
}

label::after {
  content: none !important;
}

label {
  cursor: auto;
}


.nav-aside > li {
  /*fo nt-size: 12px;
  line-height: 1.1666666667em; */
  padding: 0px 0px; 
  /*border-bottom: 1px dotted #ddd;*/
}

.item-listado-desplegable-dge {
    margin-left: 10px;
}