/*
Theme Name:   Hello Elementor Child
Theme URI:    https://elementor.com/
Description:  Tema hijo para Hello Elementor - Sitio Inmobiliario Vivi Portilla
Author:       Vivi Portilla Inmobiliaria
Author URI:   https://viviportillainmobiliaria.com/
Template:     hello-elementor
Version:      1.2.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  hello-elementor-child
*/

/*
=====================================================
  ESTILOS PERSONALIZADOS - TEMA HIJO
=====================================================
*/

/* ===============================================
   1. ESTILOS DEL PAGINADOR
   =============================================== */

/* Contenedor principal del paginador */
.pagination,
.nav-links,
.page-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

/* Resetear estilos de lista si se usa <ul> */
.pagination ul,
.nav-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}

/* Estilos base para todos los elementos del paginador */
.pagination a,
.pagination span,
.page-numbers {
  border: 2px solid #ccc;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--e-global-color-text, #333);
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 14px;
  background-color: #fff;
}

/* Hover en los botones */
.pagination a:hover,
.page-numbers:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.05);
  border-color: var(--e-global-color-secondary, #007bff);
}

/* Página actual (activa) */
.pagination .current,
.page-numbers.current,
span.page-numbers.current {
  background-color: var(--e-global-color-secondary, #007bff);
  color: #fff;
  border-color: var(--e-global-color-secondary, #007bff);
  font-weight: 700;
  cursor: default;
}

/* Botones de navegación (Anterior/Siguiente) */
.pagination .prev,
.pagination .next,
.page-numbers.prev,
.page-numbers.next {
  width: auto;
  padding: 0 1rem;
  border-radius: 20px;
  font-size: 13px;
}

/* Puntos suspensivos */
.pagination .dots,
span.page-numbers.dots {
  border: none;
  background: transparent;
  cursor: default;
}

.pagination .dots:hover,
span.page-numbers.dots:hover {
  background: transparent;
  transform: none;
}

/* ===============================================
   SOPORTE PARA BOOTSTRAP PAGINATION
   (Estructura con .page-item y .page-link)
   =============================================== */

/* Resetear estilos de lista de Bootstrap */
.pagination .page-item {
  list-style: none;
  margin: 0;
}

/* Estilos base para botones de Bootstrap pagination */
.pagination .page-item .page-link {
  border: 2px solid #ccc;
  border-radius: 50% !important;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--e-global-color-text, #333);
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 14px;
  background-color: #fff;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* Hover en los botones de Bootstrap */
.pagination .page-item .page-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.05);
  border-color: var(--e-global-color-secondary, #007bff);
  color: var(--e-global-color-text, #333);
}

/* Página actual (activa) - Bootstrap usa .disabled o .active */
.pagination .page-item.disabled .page-link,
.pagination .page-item.active .page-link {
  background-color: var(--e-global-color-secondary, #007bff) !important;
  color: #fff !important;
  border-color: var(--e-global-color-secondary, #007bff) !important;
  font-weight: 700;
  cursor: default;
  pointer-events: none;
}

/* Evitar el hover en el elemento activo */
.pagination .page-item.disabled .page-link:hover,
.pagination .page-item.active .page-link:hover {
  transform: none;
  background-color: var(--e-global-color-secondary, #007bff) !important;
}

/* Botones de navegación (< > << >>) */
.pagination .page-item .page-link:contains('&lt;'),
.pagination .page-item .page-link:contains('&gt;'),
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
  width: auto;
  min-width: 40px;
  padding: 0 1rem;
  border-radius: 20px !important;
  font-size: 13px;
}

/* Si los botones de navegación tienen clases específicas */
.pagination .page-item.prev .page-link,
.pagination .page-item.next .page-link,
.pagination .page-item.first .page-link,
.pagination .page-item.last .page-link {
  width: auto;
  min-width: 40px;
  padding: 0 1rem;
  border-radius: 20px !important;
  font-size: 13px;
}


/* ===============================================
   2. ESTILOS DEL FILTRO DE BÚSQUEDA - PLUGIN DOMUS
   =============================================== */

/* Contenedor del widget de búsqueda - Aplicar a todos los widgets de filtro */
#text-5.widget_text,
.widget_text:has(form [name="gestion"]),
.widget_text:has(form [name="tipo"]),
.domus-filtro,
.property-search-widget {
  background: #fafafa;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

/* Título del widget */
#text-5.widget_text .widget-title,
.widget_text:has(form [name="gestion"]) .widget-title,
.widget_text:has(form [name="tipo"]) .widget-title,
.domus-filtro .widget-title,
.property-search-widget .widget-title {
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: center;
}

/* Estilos del formulario - GRID LAYOUT - Aplicar a todos los widgets de filtro */
#text-5.widget_text form,
.widget_text:has(form [name="gestion"]) form,
.widget_text:has(form [name="tipo"]) form,
.domus-filtro form,
.property-search-widget form,
aside form:has([name="gestion"]),
aside form:has([name="tipo"]) {
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Los primeros 3 form-group ocupan 1 columna cada uno */
#text-5.widget_text form > .form-group:nth-of-type(1),
#text-5.widget_text form > .form-group:nth-of-type(2),
#text-5.widget_text form > .form-group:nth-of-type(3),
.widget_text form > .form-group:nth-of-type(1),
.widget_text form > .form-group:nth-of-type(2),
.widget_text form > .form-group:nth-of-type(3) {
  grid-column: span 1;
}

/* El botón toggle y filtro avanzado ocupan las 3 columnas */
#toggle-filtro-domus,
#filtro-avanzado-domus {
  grid-column: 1 / -1;
}

/* El botón de submit también ocupa las 3 columnas */
#text-5.widget_text form > .form-group:has(button[type="submit"]),
.widget_text form > .form-group:has(button[type="submit"]) {
  grid-column: 1 / -1;
}

/* Form groups - resetear margin */
#text-5.widget_text .form-group,
.widget_text .form-group {
  margin-bottom: 0;
}

/* Estilos de los campos de entrada */
#text-5.widget_text .form-control,
.widget_text .form-control,
.domus-filtro .form-control,
.property-search-widget .form-control {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: #fff;
  min-height: 45px;
}

#text-5.widget_text .form-control:focus,
.widget_text .form-control:focus,
.domus-filtro .form-control:focus,
.property-search-widget .form-control:focus {
  outline: none;
  border-color: #da0000;
  box-shadow: 0 0 0 3px rgba(218, 0, 0, 0.1);
}

/* ===============================================
   SELECTS PERSONALIZADOS CON PLACEHOLDERS VISIBLES
   v1.1.2 - Forzar visibilidad del texto
   =============================================== */

/* Select personalizado - Estilos base FORZANDO VISIBILIDAD - Aplicar a todos los widgets */
#text-5.widget_text select.form-control,
#text-5.widget_text.widget.widget_text select.form-control,
aside#text-5.widget.widget_text select.form-control,
.widget_text select.form-control,
.domus-filtro select.form-control,
.property-search-widget select.form-control,
aside select.form-control[name="gestion"],
aside select.form-control[name="tipo"],
aside select.form-control[name="ciudad"],
aside select.form-control[name="minhab"],
aside select.form-control[name="minbanos"] {
  /* Apariencia */
  cursor: pointer !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  
  /* Flecha personalizada - TAMAÑO AUMENTADO */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%23da0000' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.875rem center !important;
  background-size: 14px !important;
  
  /* PADDING Y DIMENSIONES AJUSTADAS */
  padding: 0.75rem 2.5rem 0.75rem 0.875rem !important;
  min-height: 48px !important;
  height: auto !important;
  
  /* FORZAR VISIBILIDAD DEL TEXTO */
  color: #999 !important; /* Gris por defecto (placeholder) */
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  text-align: left !important;
  overflow: visible !important;
  white-space: normal !important;
  display: block !important;
}

/* Estilo para los placeholders de los selects (primera opción con value vacío) */
#text-5.widget_text select.form-control option[value=""],
#text-5.widget_text.widget.widget_text select.form-control option[value=""],
aside#text-5.widget.widget_text select.form-control option[value=""] {
  color: #999 !important;
  font-style: italic !important;
}

/* Estilo para cuando el select tiene el placeholder seleccionado */
#text-5.widget_text select.form-control.placeholder-selected,
#text-5.widget_text.widget.widget_text select.form-control.placeholder-selected,
aside#text-5.widget.widget_text select.form-control.placeholder-selected {
  color: #999 !important;
  font-style: italic !important;
}

/* Estilo para cuando el select tiene un valor real seleccionado */
#text-5.widget_text select.form-control.value-selected,
#text-5.widget_text.widget.widget_text select.form-control.value-selected,
aside#text-5.widget.widget_text select.form-control.value-selected {
  color: #333 !important;
  font-style: normal !important;
}

/* Estilos para las opciones dentro del select - BORDES UNIFORMES */
#text-5.widget_text select.form-control option,
#text-5.widget_text.widget.widget_text select.form-control option,
aside#text-5.widget.widget_text select.form-control option {
  color: #333 !important;
  font-style: normal !important;
  padding: 8px 12px !important;
  border: none !important;
  background-color: #fff !important;
}

/* Hover en las opciones del select */
#text-5.widget_text select.form-control option:hover,
#text-5.widget_text.widget.widget_text select.form-control option:hover,
aside#text-5.widget.widget_text select.form-control option:hover {
  background-color: #f5f5f5 !important;
}

/* Opción seleccionada/checkeada */
#text-5.widget_text select.form-control option:checked,
#text-5.widget_text.widget.widget_text select.form-control option:checked,
aside#text-5.widget.widget_text select.form-control option:checked {
  background-color: #da0000 !important;
  color: #fff !important;
}

/* Compatibilidad adicional para navegadores que soportan :has() */
@supports selector(:has(> option)) {
  #text-5.widget_text select.form-control:has(option[value=""]:checked),
  #text-5.widget_text.widget.widget_text select.form-control:has(option[value=""]:checked),
  aside#text-5.widget.widget_text select.form-control:has(option[value=""]:checked) {
    color: #999 !important;
    font-style: italic !important;
  }
  
  #text-5.widget_text select.form-control:has(option:not([value=""]):checked),
  #text-5.widget_text.widget.widget_text select.form-control:has(option:not([value=""]):checked),
  aside#text-5.widget.widget_text select.form-control:has(option:not([value=""]):checked) {
    color: #333 !important;
    font-style: normal !important;
  }
}

/* Estilos específicos para el dropdown desplegado (Chrome/Edge) */
#text-5.widget_text select.form-control::-webkit-scrollbar,
#text-5.widget_text.widget.widget_text select.form-control::-webkit-scrollbar {
  width: 8px !important;
}

#text-5.widget_text select.form-control::-webkit-scrollbar-track,
#text-5.widget_text.widget.widget_text select.form-control::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
}

#text-5.widget_text select.form-control::-webkit-scrollbar-thumb,
#text-5.widget_text.widget.widget_text select.form-control::-webkit-scrollbar-thumb {
  background: #da0000 !important;
  border-radius: 4px !important;
}

/* Labels mejorados - Base */
#text-5.widget_text label,
.widget_text label,
.domus-filtro label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* Labels de campos básicos - TAMAÑO AUMENTADO */
#text-5.widget_text label[for*="gestion"],
#text-5.widget_text label[for*="tipo"],
#text-5.widget_text label[for*="ciudad"],
.widget_text label[for*="gestion"],
.widget_text label[for*="tipo"],
.widget_text label[for*="ciudad"],
.domus-filtro label[for*="gestion"],
.domus-filtro label[for*="tipo"],
.domus-filtro label[for*="ciudad"] {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #2c3e50 !important;
  margin-bottom: 0.625rem !important;
  letter-spacing: 0.3px !important;
}

/* Selectores de campos básicos - TEXTO AUMENTADO */
#text-5.widget_text select[name="gestion"],
#text-5.widget_text select[name="tipo"],
#text-5.widget_text select[name="ciudad"],
.widget_text select[name="gestion"],
.widget_text select[name="tipo"],
.widget_text select[name="ciudad"],
.domus-filtro select[name="gestion"],
.domus-filtro select[name="tipo"],
.domus-filtro select[name="ciudad"] {
  font-size: 15px !important;
  font-weight: 500 !important;
}

/* Ranges - sliders */
#text-5.widget_text input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#text-5.widget_text input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #da0000;
  cursor: pointer;
  transition: all 0.3s ease;
}

#text-5.widget_text input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(218, 0, 0, 0.2);
}

#text-5.widget_text input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #da0000;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

#text-5.widget_text input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(218, 0, 0, 0.2);
}

/* Filas con columnas - GRID LAYOUT */
#text-5.widget_text .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 1.25rem;
}

#text-5.widget_text .row .col {
  padding: 0;
}

#text-5.widget_text .row .form-group {
  margin-bottom: 0;
}

/* Inputs dentro de las filas */
#text-5.widget_text .row input[type="text"],
#text-5.widget_text .row input[type="number"] {
  border: 2px solid #ddd;
  padding: 0.75rem 0.875rem;
  border-radius: 8px;
  min-height: 48px;
  font-size: 14px;
  line-height: 1.5;
}

/* Placeholder visible en inputs de texto y número */
#text-5.widget_text input::placeholder {
  color: #999;
  opacity: 1;
  font-style: italic;
}

/* Estilos específicos para campos de área */
#text-5.widget_text input[name="areamin"],
#text-5.widget_text input[name="areamax"] {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}

#text-5.widget_text input[name="areamin"]::-webkit-outer-spin-button,
#text-5.widget_text input[name="areamin"]::-webkit-inner-spin-button,
#text-5.widget_text input[name="areamax"]::-webkit-outer-spin-button,
#text-5.widget_text input[name="areamax"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Botón de búsqueda mejorado - ESTILO PREMIUM - Aplicar a todos los widgets */
#text-5.widget_text button[type="submit"],
.widget_text button[type="submit"],
.domus-filtro button[type="submit"],
.property-search-widget button[type="submit"],
aside form button[type="submit"]:only-of-type {
  background-color: #da0000 !important;
  color: white !important;
  border: none !important;
  padding: 1rem 3rem !important;
  border-radius: 50px !important;
  cursor: pointer !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(218, 0, 0, 0.3) !important;
  margin: 1.5rem auto 0 !important;
  display: block !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

#text-5.widget_text button[type="submit"]:hover,
.widget_text button[type="submit"]:hover,
.domus-filtro button[type="submit"]:hover,
.property-search-widget button[type="submit"]:hover,
aside form button[type="submit"]:only-of-type:hover {
  background-color: #b00000 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(218, 0, 0, 0.4) !important;
}

#text-5.widget_text button[type="submit"]:active,
.widget_text button[type="submit"]:active,
.domus-filtro button[type="submit"]:active,
.property-search-widget button[type="submit"]:active,
aside form button[type="submit"]:only-of-type:active {
  transform: translateY(0) !important;
}

/* ===============================================
   FILTRO AVANZADO - TOGGLE
   =============================================== */

/* Contenedor del filtro avanzado (oculto por defecto) */
#filtro-avanzado-domus,
.filtro-avanzado-section {
  display: none;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

/* Estado visible del filtro avanzado */
#filtro-avanzado-domus.visible,
.filtro-avanzado-section.visible {
  display: block;
  max-height: 2000px;
  opacity: 1;
  margin-top: 1rem;
}

/* Botón para mostrar/ocultar filtro avanzado */
#toggle-filtro-domus {
  background-color: #da0000;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin: 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(218, 0, 0, 0.25);
}

#toggle-filtro-domus:hover {
  background-color: #b00000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(218, 0, 0, 0.3);
}

#toggle-filtro-domus:active {
  transform: translateY(0);
}

/* Ícono del botón */
#toggle-filtro-domus::after {
  content: '▼';
  font-size: 10px;
  transition: transform 0.3s ease;
  display: inline-block;
}

#toggle-filtro-domus.active::after {
  transform: rotate(180deg);
}

/* Separador visual */
.filtro-separator {
  text-align: center;
  margin: 1rem 0;
}


/* ===============================================
   3. ESTILOS RESPONSIVOS
   =============================================== */

@media (max-width: 768px) {
  /* Paginador en móvil */
  .pagination a,
  .pagination span,
  .page-numbers,
  .pagination .page-item .page-link {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .pagination .prev,
  .pagination .next,
  .page-numbers.prev,
  .page-numbers.next,
  .pagination .page-item:first-child .page-link,
  .pagination .page-item:last-child .page-link,
  .pagination .page-item.prev .page-link,
  .pagination .page-item.next .page-link {
    padding: 0 0.75rem;
    font-size: 12px;
    min-width: 36px;
  }

  /* Botón de filtro en móvil */
  #toggle-filtro,
  .toggle-filtro-btn,
  #toggle-filtro-domus {
    width: 100%;
    max-width: 100%;
    justify-content: center;
  }

  /* Filtro Domus en móvil */
  #text-5.widget_text {
    padding: 1.5rem;
  }

  /* Grid de formulario a 1 columna en móvil */
  #text-5.widget_text form {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Campos básicos ocupan toda la columna */
  #text-5.widget_text form > .form-group:nth-of-type(1),
  #text-5.widget_text form > .form-group:nth-of-type(2),
  #text-5.widget_text form > .form-group:nth-of-type(3) {
    grid-column: 1;
  }

  /* Filas dentro del filtro avanzado también en columna */
  #text-5.widget_text .row {
    grid-template-columns: 1fr;
  }

  /* Botón de búsqueda ancho completo */
  #text-5.widget_text button[type="submit"] {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem 2rem !important;
  }

  /* Botón toggle ancho completo */
  #toggle-filtro-domus {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .pagination a,
  .pagination span,
  .page-numbers,
  .pagination .page-item .page-link {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}


/* ===============================================
   4. ESTILOS ADICIONALES Y UTILIDADES
   =============================================== */

/* Asegurar que el contenedor de paginación sea visible */
.elementor-pagination,
.elementor-widget-archive-posts .elementor-pagination {
  display: flex !important;
  justify-content: center;
}

/* Mejoras de accesibilidad */
.pagination a:focus,
.page-numbers:focus,
#toggle-filtro:focus {
  outline: 2px solid var(--e-global-color-secondary, #007bff);
  outline-offset: 2px;
}
