/* --- ESTILOS GENERALES Y HEADER --- */
html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Altura mínima del 100% de la pantalla */
  background-color: #f4f4f4;
}
.bg-body-blue {
  background-color: #3366cc;
}

main.container {
  /* Esta es la regla clave: */
  flex-grow: 1; /* Hace que el contenido principal crezca y empuje el footer */
}

.header-main h4 {
  color: #235a98;
  font-weight: 300;
}

/* --- BARRA DE BÚSQUEDA AZUL --- */
.search-bar {
  background-color: #235a98; /* Color azul principal */
  color: white;
}

.search-bar .form-control-sm::placeholder {
  color: #ccc;
}

.search-bar .form-control-sm:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.alphabet-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.alphabet-filter a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 0 4px;
}

.alphabet-filter a:hover {
  color: #ffc107; /* Amarillo del botón buscar */
}

.alphabet-filter a.active {
  color: #ffc107;
  text-decoration: underline;
}

.pagination-controls {
  font-size: 0.9rem;
  color: #ddd;
}

/* --- TARJETAS DE RESULTADOS --- */
.card-result {
  border: 1px solid #ddd;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
}

.card-result:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Contenedor del logo cuadrado */
.logo-container {
  width: 100%;
  aspect-ratio: 1 / 1; /* Esto fuerza la proporción cuadrada */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #fff; /* Fondo blanco por si el logo es transparente */
  border: 1px solid #eee;
  border-radius: 0.375rem; /* Bootstrap card radius */
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 'contain' para que el logo quepa, 'cover' para que llene */
}

/* Contenido de la tarjeta (derecha) */

/* Ensure card body allows content to stretch */
.card.h-100 .card-body {
  display: flex;
  flex-direction: column; /* Arrange inner row vertically */
  height: 100%; /* Make card-body fill the card */
}

/* Ensure the inner row takes full height */
.card.h-100 .card-body .row {
  flex-grow: 1; /* Allow the row containing logo and content to grow */
}

/* Ensure the content column takes full height */
.card.h-100 .card-body .row .col-8 {
  /* Target the specific column holding card-content */
  display: flex; /* Make the column itself a flex container */
}

.card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.card-content h5 {
  color: #235a98;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card-content p {
  font-size: 0.9rem;
  color: #333333;
  margin-bottom: 1rem;
}

/* Información inferior (ciudad, zip, botón) */
.card-info {
  margin-top: auto; /* Key change: Auto margin pushes element to the end */
  flex-shrink: 0; /* Prevent this div from shrinking */
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
  gap: 1rem;
}

.card-info .info-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #555;
}

.card-info .info-items i {
  color: #235a98;
}

/* Botón "Ver más" */
.btn-ver-mas {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
  font-weight: bold;
  white-space: nowrap; /* Evita que el texto se parta */
}

.btn-ver-mas:hover {
  background-color: #e6ac00;
  border-color: #e6ac00;
  color: #212529;
}

.image-container {
  position: relative;
  display: inline-block;
  margin: 5px;
}
.delete-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  z-index: 10;
}

/* Badges de Abierto/Cerrado */
.badge-abierto {
  background-color: #198754; /* Verde Bootstrap */
  color: white;
}
.badge-cerrado {
  background-color: #dc3545; /* Rojo Bootstrap */
  color: white;
}
.badge-indefinido {
  background-color: #6c757d; /* Gris Bootstrap */
  color: white;
}

/* --- FOOTER --- */
.footer-main {
  background-color: #fff;
}

/* --- BARRA AUXILIAR SUPERIOR (GOV.CO) --- */
.navbar-aux {
  background-color: #3366cc;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Estilo para el botón de hamburguesa blanco */
.navbar-aux .navbar-toggler {
  border: none;
  color: rgba(255, 255, 255, 0.8);
}

.navbar-aux .navbar-toggler-icon {
  /* SVG data-uri para un icono de hamburguesa blanco */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-aux .navbar-toggler:focus {
  box-shadow: none;
}

/* Estilo para el botón amarillo (Bootstrap ya lo hace bien, pero esto asegura consistencia) */
.navbar-aux .btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  color: #212529;
  font-weight: bold;
}
.btn-red {
  --bs-btn-color: #fff;
  --bs-btn-bg: #d00;
  --bs-btn-border-color: #c00;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #c00;
  --bs-btn-hover-border-color: #b00;
  --bs-btn-focus-shadow-rgb: 11, 172, 204;
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #c00;
  --bs-btn-active-border-color: #b00;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: #333;
  --bs-btn-disabled-bg: #666;
  --bs-btn-disabled-border-color: #333;
}
.btn {
  --bs-btn-padding-y: 0.5rem;
}
#rangeValue {
  font-weight: bold;
  font-size: 3em;
  color: #0d6efd; /* Bootstrap primary color */
  min-width: 2em; /* Ensure space for two digits */
  display: inline-block;
  text-align: center;
}
.rating-label {
  display: block; /* Ensure label is on its own line */
  margin-bottom: 0.5rem;
}

/* MAPA index */

#resultsMap {
  height: 400px;
  width: 100%;
  margin-bottom: 2rem;
  border: 1px solid #ccc;
  border-radius: 0.375rem;
}

/* --- ESTILO PARA CARD RESALTADO --- */
.card-result.highlighted {
  border: 2px solid #dc3545; /* Rojo de Bootstrap */
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
  transform: scale(1.01); /* Efecto sutil de "pop" */
  transition: all 0.2s ease-in-out;
}

/*//////////////////// Carrusel de logos ///////////////////////////////*/

/* Contenedor principal del carrusel */
.logo-marquee {
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: #ffffff;
  padding: 10px 0;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 1) 10%,
    rgba(0, 0, 0, 1) 90%,
    rgba(0, 0, 0, 0)
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 1) 10%,
    rgba(0, 0, 0, 1) 90%,
    rgba(0, 0, 0, 0)
  );
}

/* El "track" que contiene los logos y se anima */
.logo-track {
  display: flex;
  width: max-content; /* El ancho se ajusta al contenido */
  animation: marquee-scroll 15s linear infinite;
  /* NUEVO: Asegura que el track comience fuera de la pantalla a la derecha */
  padding-left: 100vw;
}

/* Pausar la animación al pasar el ratón */
.logo-marquee:hover .logo-track {
  animation-play-state: paused;
}

/* Cada logo individual */
.logo-slide {
  height: 80px;
  margin: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* La imagen del logo dentro de su contenedor */
.logo-slide img {
  max-height: 100%;
  max-width: 100px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.9;
  transition: all 0.3s ease;
}

/* Efecto al pasar el ratón sobre un logo */
.logo-slide:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

/* La animación de desplazamiento (ACTUALIZADA) */
@keyframes marquee-scroll {
  from {
    /* Comienza en la posición 0 (ya está fuera de la pantalla gracias al padding-left) */
    transform: translateX(0);
  }
  to {
    /* Se mueve hacia la izquierda la longitud TOTAL del track */
    /* -100% se refiere al ancho total del .logo-track */
    transform: translateX(-100%);
  }
}
/*//////////////////// FIN Carrusel de logos ///////////////////////////////*/

/*//////////////////// anunciante_detalle ///////////////////////////////*/

#map {
  height: 300px;
  width: 100%;
  border-radius: 0.375rem;
  border: 1px solid #dee2e6;
}
.gallery-thumb {
  height: 100px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid #eee;
  padding: 2px;
}
.gallery-thumb:hover {
  border-color: #0d6efd;
}
.social-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
}
.rating-star {
  color: #ffc107;
}
.carousel-item img {
  max-height: 80vh;
  object-fit: contain;
  margin: auto;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}

/*//////////////////// FIN anunciante_detalle ///////////////////////////////*/

.caja666 {
  background-color: #666;
  color: #fc0;
  font-weight: 300;
}

.caja999 {
  background-color: #999;
  color: #036;
  font-weight: 300;
}

.custom-popover {
  --bs-popover-max-width: 200px;
  --bs-popover-border-color: var(--bd-violet-bg);
  --bs-popover-header-bg: var(--bd-violet-bg);
  --bs-popover-header-color: var(--bs-white);
  --bs-popover-body-padding-x: 1rem;
  --bs-popover-body-padding-y: 0.5rem;
}

.redWS {
  color: #e2620d;
}
.cajaWS {
  background-color: #e2620d;
  color: #fff;
}
.redFB {
  color: #235a98;
}
.cajaFB {
  background-color: #235a98;
  color: #fff;
}
.redIG {
  color: #c06;
}
.cajaIG {
  background-color: #c06;
  color: #fff;
}
.redLI {
  color: #1a426e;
}
.cajaLI {
  background-color: #1a426e;
  color: #fff;
}
.redXT {
  color: #000;
}
.cajaXT {
  background-color: #000;
  color: #fff;
}
.redWA {
  color: #168325;
}
.cajaWA {
  background-color: #168325;
  color: #fff;
}
.redYT {
  color: #bb1616;
}
.cajaYT {
  background-color: #bb1616;
  color: #fff;
}
#procesando-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 99999;
  text-align: center;
}

#procesando-overlay .loader-box {
  max-width: 400px;
  width: 90%;
}

.progress {
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
}

#barra-progreso {
  background-color: #007bff;
  transition: width 0.6s ease;
}

ol li {
  margin-bottom: 20px;
}

/*///////////////////// ADMIN /////////////////////*/

.bodyadmin {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: 240px;
  background: #212529;
  color: white;
  padding-top: 20px;
  flex-shrink: 0;
}

#sidebar a {
  color: #cfd8dc;
  text-decoration: none;
  display: block;
  padding: 10px 18px;
  border-left: 3px solid transparent;
}

#sidebar a:hover,
#sidebar a.active {
  background: #343a40;
  border-left-color: #0d6efd;
  color: #ffffff;
}

#content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-height: 100vh;
  padding: 20px;
}

/* Footer fijo al fondo sin ocupar media pantalla */
.admin-footer {
  background: #212529;
  margin-top: auto; /* Lo pega al fondo */
  padding: 10px 0;
  color: #fff;
  width: 100%;
  font-size: 0.8rem;
}

/*--- CORRECCIÓN CRÍTICA PARA ADMIN ---*/
.bodyadmin {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh !important;
}

/* Desactiva el flex global del body para admin */
.bodyadmin body,
.bodyadmin {
  background-color: #f4f4f4;
}

/* Sidebar a la izquierda fijo */
#sidebar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* Badges normales alineados */
#sidebar .badge {
  float: right;
  font-size: 0.75rem;
  padding: 4px 7px;
  border-radius: 5px;
}

/* Badge con efecto de alerta */
.badge-alert {
  background-color: #dc3545 !important; /* Rojo */
  color: #fff !important;
  animation: pulseBadge 1.3s infinite ease-in-out;
}

/* Animación */
@keyframes pulseBadge {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* El contenido ahora toma todo el espacio restante */
#content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

/* Footer del admin siempre abajo, sin espacios raros */
.admin-footer {
  margin-top: auto;
  background: #212529;
  color: #fff;
  text-align: center;
  padding: 8px 0;
  font-size: 0.85rem;
}
.stat-card {
  border-left: 5px solid;
  margin-bottom: 1rem;
}
.stat-card.border-success {
  border-color: #198754;
}
.stat-card.border-danger {
  border-color: #dc3545;
}
.stat-card.border-warning {
  border-color: #ffc107;
}
.stat-card.border-dark {
  border-color: #212529;
}
.stat-card .card-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #6c757d;
}
.stat-card .card-text {
  font-size: 2rem;
  font-weight: 700;
}

/* === DASHBOARD ICON CARDS === */
.stat-box {
  border-radius: 10px;
  text-align: center;
  padding: 25px 10px;
  font-weight: bold;
  margin-bottom: 15px;
  color: white;
}
.stat-box .stat-value {
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 800;
}
.stat-box .stat-label {
  margin-top: 8px;
  font-size: 0.95rem;
}
.stat-green {
  background: #198754;
}
.stat-red {
  background: #dc3545;
}
.stat-yellow {
  background: #ffc107;
  color: #000;
}
.stat-gray {
  background: #6c757d;
}
.stat-blue {
  background: #0e3455;
}
/* Limita la altura de las cards del dashboard y activa scroll interno */
.widget-scroll {
  max-height: 320px; /* Ajusta la altura deseada */
  overflow-y: auto; /* Scroll vertical si el contenido excede */
}

/* Opcional: mejora el estilo del scrollbar */
.widget-scroll::-webkit-scrollbar {
  width: 6px;
}
.widget-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

/*///////////////////// FIN ADMIN /////////////////////*/
