/* Estilos para el buscador de tours */

/* Contenedor principal */
.catawp-tour-search-container {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  position: relative;
}

/* Contenedor del buscador */
.catawp-tour-search {
  position: relative;
}

/* Input similar al de Google con tipografía mejorada */
.catawp-tour-search input[type="text"] {
  width: 100%;
  padding: 10px 70px 10px 20px; /* Aumenta el padding a la derecha para evitar solapamiento con el botón */
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid #ccc;
  border-radius: 25px;
  box-sizing: border-box;
}

.catawp-tour-search-total{
  font-size: 13px;
  text-align: center;
  padding: 15px;
}

/* Botón de búsqueda integrado en el input */
.catawp-tour-search button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #3b49df; /* Color base del botón */
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 25px; /* Mismo radio que el input */
  transition: background 0.3s;
}
.catawp-tour-search button:hover {
  background: #2c37b1; /* Versión más oscura para hover */
}

/* Dropdown de sugerencias con todas las esquinas redondeadas */
.catawp-tour-search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 25px;
  z-index: 1000;
}

/* Estilos para las etiquetas de sección */
.catawp-tour-search-suggestions .section-title {
  display: inline-block;
  background-color: #e8eaff;
  color: #3b49df;
  border-radius: 4px;
  padding: 3px 8px;
  margin: 8px 0 5px 8px;
  font-size: 12px;
  font-weight: bold;
}

/* Lista sin estilo */
.catawp-tour-search-suggestions ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Elementos de la lista de sugerencias */
.catawp-tour-search-suggestions li {
  padding: 10px;
  cursor: pointer;
  border-radius: 25px; /* Redondear cada elemento */
  transition: background 0.3s;
  text-align: left;
}

/* Hover en las sugerencias: fondo igual al botón buscar (#3b49df) */
.catawp-tour-search-suggestions li:hover {
  background: #ececec;
}

/* Modal de resultados a pantalla completa */
#catawp-tour-search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  overflow-y: auto;
  z-index: 2000;
  padding-top: 60px; /* Espacio para el botón sticky */
}

/* Botón de cerrar el modal centrado y sticky, con el mismo estilo del botón buscar */
#catawp-tour-search-modal .close-btn {
  position: sticky;
  top: 0;
  margin: 0 auto;
  display: block;
  background: #3b49df;
  color: #fff;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 25px;
  transition: background 0.3s;
  z-index: 3000;
  width: fit-content;
  border: 2px solid white;
}
#catawp-tour-search-modal .close-btn:hover {
  background: #2c37b1;
}

/* Barra de desplazamiento vertical en el modal (WebKit) */
#catawp-tour-search-modal::-webkit-scrollbar {
  width: 8px;
}
#catawp-tour-search-modal::-webkit-scrollbar-track {
  background: #f1f1f1;
}
#catawp-tour-search-modal::-webkit-scrollbar-thumb {
  background: #3b49df;
  border-radius: 4px;
}

/* Para Firefox */
#catawp-tour-search-modal {
  scrollbar-color: #3b49df #f1f1f1;
}

/* Por defecto, se muestra el texto y se oculta el icono */
.catawp-tour-search button .dashicons {
  display: none;
}

/* Estilo del botón de precio (hover igual que antes) */
#catawp-tour-search-modal .activity-price-list button:hover {
  background: #ff6600; /* o el color exacto que quieras */
}

/* En mobile (por ejemplo, pantallas menores a 768px) se oculta el texto y se muestra el icono */
@media (max-width: 768px) {
  .catawp-tour-search button .button-text {
    display: none;
  }
  .catawp-tour-search button .dashicons {
    display: inline-block;
    vertical-align: middle;
  }
}

/* En desktop: usar overlay oscuro y centrar el contenido en un contenedor con 70% de ancho */
@media (min-width: 1024px) {
  /* El modal ahora ocupa la pantalla completa con fondo semi-transparente */
  #catawp-tour-search-modal {
    background: rgba(0, 0, 0, 0.5); /* Fondo inactivo para focalizar */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
  }
  /* Contenedor interno que ocupa el 70% del ancho, con fondo blanco */
  #catawp-tour-search-modal .modal-inner {
    width: 70%;
    background: #fff;
    border-radius: 8px;
    overflow-y: auto;
    max-height: 95%;
    position: relative;
    padding: 20px;
  }
}

/* Trending queries container - OPTIMIZADO PARA CLS */
.trending-queries-container {
    text-align: center;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
    /* CRÍTICO: Reservar altura para prevenir CLS */
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Centrar horizontalmente */
}

.trending-title {
    display: block;
    font-size: 16px;
    margin-bottom: 10px;
    color: #3b49df;
    /* Altura fija para el título */
    height: 20px;
    line-height: 20px;
}

.trending-queries-scroll {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    /* CRÍTICO: Altura mínima para el contenedor de scroll */
    min-height: 40px;
    /* Centrado para desktop */
    text-align: center;
    width: 100%;
    /* Ocultar scrollbar pero mantener funcionalidad */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.trending-queries-scroll::-webkit-scrollbar {
    display: none;
}

.trending-query-bubble {
    display: inline-flex; /* inline-flex para centrado y control */
    align-items: center;
    font-size: 14px;
    color: #3b49df;
    border: 1px solid #3b49df;
    border-radius: 20px;
    padding: 2px 10px;
    margin: 0 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    /* CRÍTICO: Altura fija para prevenir saltos */
    height: 32px;
    line-height: 1;
    vertical-align: middle; /* Asegurar alineación vertical */
}

.trending-query-bubble i {
    color: #ff6600;
    margin-left: 5px;
    /* CRÍTICO: Dimensiones fijas para el icono */
    width: 14px;
    height: 14px;
    display: inline-block;
    font-size: 12px;
    line-height: 14px;
}

/* Skeleton loader mientras cargan las trending queries */
.trending-queries-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Gradient overlay para indicar más contenido horizontal */
.trending-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to left, #fff, rgba(255,255,255,0));
}

/* Estilos para "Mostrar todos" */
#show-all-results {
  text-align: left;
  cursor: pointer;
  border-radius: 25px !important;
  transition: background 0.3s;
  list-style: none !important;
  display: block;
  font-weight: bold;
}

#show-all-results:hover {
  background: #ececec;
}

/* ------------------------------------------------------------------ */

/* ============================
   1) PESTAÑA LATERAL "-sglobal"
   ============================ */
#search-tab-sglobal {
  position: fixed;
  top: 30%;
  right: 0;
  width: 45px;                /* muestra solo 40px al inicio */
  height: 60px;
  background: #3b49df;
  border-radius: 45px 0 0 45px;
  border: 3px solid white;
  z-index: 10000;

  display: flex;
  align-items: center;
  overflow: hidden;           /* oculta lo que sobrepase los 40px */
  transition: width 0.3s ease, box-shadow 0.3s ease;
  cursor: default;            /* cursor por defecto hasta el hover */
}

#search-tab-sglobal:hover {
  width: 180px;               /* ancho al hacer hover */
  cursor: pointer;            /* pointer solo en hover */
  /* sombra del mismo color que el fondo */
  box-shadow: 0 0 10px rgba(59, 73, 223, 0.7);
}

#search-tab-sglobal .dashicons-search {
  font-size: 28px;
  color: #fff;
  margin: 0 20px 0 0;         /* separa el icono del texto */
  padding-left: 8px;
}

#search-tab-sglobal .search-tab-text {
  white-space: nowrap;
  font-size: 1em;
  font-weight: 500;
  color: #fff;
  padding-right: 12px;
}


/* ================================
   2) OVERLAY / VENTANA "-sglobal"
   ================================ */
/* Estado cerrado */
#catawp-tour-search-modal-sglobal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  overflow: auto;
}

/* Estado abierto */
#catawp-tour-search-modal-sglobal.open-sglobal {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#catawp-tour-search-modal-sglobal .modal-inner-sglobal {
  width: 100%; height: 100%;
  background: #fff;
  padding-top: 150px;
  box-sizing: border-box;
  overflow-y: auto;
  position: relative;
}

#catawp-tour-search-modal-sglobal .close-btn-sglobal {
  display: block;
  margin: 0 auto 25px;
  font-size: 40px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
}
#catawp-tour-search-modal-sglobal .close-btn-sglobal:hover {
  color: #000;
}

/* Oculta la pestaña cuando el modal está abierto */
#catawp-tour-search-modal-sglobal.open-sglobal + #search-tab-sglobal,
#catawp-tour-search-modal-sglobal.open-sglobal ~ #search-tab-sglobal {
  display: none !important;
}


/* =================================
   3) ADAPTACIÓN PARA MÓVIL (<=768px)
   ================================= */
@media (max-width: 768px) {
  /* pestaña aún más reducida */
  #search-tab-sglobal {
    width: 35px;
  }
  /* ancho al hover en móvil */
  #search-tab-sglobal:hover {
    width: 180px;
    box-shadow: 0 0 8px rgba(59, 73, 223, 0.7);
  }

  /* icono más pequeño en móvil */
  #search-tab-sglobal .dashicons-search {
    font-size: 20px;
    padding-left: 6px;       /* padding izquierdo añadido */
  }

  /* padding menor en modal móvil */
  #catawp-tour-search-modal-sglobal .modal-inner-sglobal {
    padding: 35px 20px 0;
  }
  /* buscador a ancho completo */
  #catawp-tour-search-modal-sglobal
    .modal-inner-sglobal
    .catawp-tour-search-container {
    width: 100% !important;
    max-width: none !important;
  }
  
  /* Ajuste para trending queries en móvil */
  .trending-queries-scroll {
    justify-content: flex-start; /* Alinear al inicio para permitir scroll */
    overflow-x: scroll; /* Asegurar scroll en móvil */
  }
}

/* ============================================
   4) ANIMACIONES DE ATENCIÓN - NUEVAS
   ============================================ */

/* Animación de brillo pulsante tipo neón */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 73, 223, 0.8),
                0 0 40px rgba(59, 73, 223, 0.6),
                0 0 60px rgba(59, 73, 223, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 73, 223, 1),
                0 0 60px rgba(59, 73, 223, 0.8),
                0 0 80px rgba(59, 73, 223, 0.6);
  }
}

/* Clase para expansión automática */
#search-tab-sglobal.auto-expand {
  width: 180px !important;
  cursor: pointer !important; /* Siempre mostrar cursor pointer durante la animación */
}

/* Clase para efecto de brillo */
#search-tab-sglobal.glow-effect {
  animation: glow-pulse 1.5s ease-in-out infinite;
}

/* Animación de sacudida suave opcional */
@keyframes gentle-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Aplicar sacudida junto con el brillo */
#search-tab-sglobal.glow-effect .dashicons-search {
  animation: gentle-shake 0.5s ease-in-out infinite;
}

/* Para móvil: ajustar la animación */
@media (max-width: 768px) {
  #search-tab-sglobal.auto-expand {
    width: 180px !important;
  }
  
  /* Efecto de brillo más suave en móvil para no saturar */
  @keyframes glow-pulse-mobile {
    0%, 100% {
      box-shadow: 0 0 15px rgba(59, 73, 223, 0.7),
                  0 0 30px rgba(59, 73, 223, 0.5);
    }
    50% {
      box-shadow: 0 0 25px rgba(59, 73, 223, 0.9),
                  0 0 45px rgba(59, 73, 223, 0.7);
    }
  }
  
  #search-tab-sglobal.glow-effect {
    animation: glow-pulse-mobile 1.5s ease-in-out infinite;
  }
}