/* ====== BASE ====== */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

:root{
  /* Colores de botones tipo y acentos */
  --tipo-primary: #0c2537;   /* círculo activo */
  --tipo-ring:    #0c2537;   /* borde pill activo */
  --text-dark:    #102331;

  /* Colores “chip” (estado base) */
  --chip-bg:      #f8f9fa;
  --chip-border:  #cccccc;
  --chip-text:    var(--text-dark);

  /* Sombras */
  --shadow-sm: 0 6px 16px rgba(0,0,0,.15);
  --shadow-md: 0 8px 18px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.18);
}

/* ====== MAPA ====== */
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* el resto flota encima */
}

/* ====== CONTROLES CUSTOM MAPA (con Font Awesome) ====== */
.gm-custom-controls{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 12px 12px 0; /* separación del borde del mapa */
}
.gm-ctrl-btn{
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
}
.gm-ctrl-btn:hover{ box-shadow: 0 10px 24px rgba(0,0,0,.18); background: #f8f9fb; }
.gm-ctrl-btn:active{ transform: translateY(1px); }
.gm-ctrl-btn:focus-visible{ outline: 2px solid #2b7cff; outline-offset: 2px; }
.gm-ctrl-btn i{ font-size: 14px; line-height: 1; color: #0b2237; pointer-events: none; }

/* ====== PANEL SUPERIOR (CONTENEDOR) ====== */
#panel {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 95%;
  width: 95%;
  background: #fff;
  padding: 14px 18px;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  z-index: 999;              /* por encima del mapa */
  overflow-x: auto;          /* si hay muchos elementos, scroll horizontal */
  scrollbar-width: none;     /* Firefox: oculta */
}
#panel::-webkit-scrollbar { display: none; } /* Chrome: oculta */

#panel-row-1,
#panel-row-2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

/* ====== BUSCADOR: INPUT + LUPA A LA DERECHA ====== */
.panel-search { width: 320px; min-width: 260px; }
#searchBox {
  padding: 0 12px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-top-left-radius: .5rem;
  border-bottom-left-radius: .5rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  width: 84%;
  height: 36px;
}
#searchBtn {
  height: 36px;
  border: 1px solid #ccc;
  border-top-right-radius: .5rem;
  border-bottom-right-radius: .5rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  color: #000;
  background: var(--chip-bg);
  padding: 0 10px;
}
#searchBtn:hover {
  background: #f2f4f6;
  border-color: #bbb;
}

/* Botones coherentes en el panel */
#panel .btn,
#panel .input-group,
#tiposContainer .tipo-btn {
  align-self: center;
  margin-bottom: 0 !important;
  white-space: nowrap;
}
#panel .btn i { font-size: 16px; }

/* Geolocalizar (patrón chip sencillo) */
#geolocateBtn {
  height: 36px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  padding: 0 10px;
}
#geolocateBtn:hover { background: #f2f4f6; border-color: #bbb; }
#geolocateBtn i { color: black; }

/* ====== BOTONES DE TIPO (círculo + svg) ====== */
#tiposContainer{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#tiposContainer .tipo-btn{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px 4px 4px;   /* deja hueco al círculo */
  border-radius: 20px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
#tiposContainer .tipo-btn:hover{ background: #f2f4f6; border-color: #bbb; }
#tiposContainer .tipo-btn:active{ transform: translateY(1px); }
#tiposContainer .tipo-btn.activo{
  border: 1px solid var(--tipo-ring);
  background: #fff;
  color: var(--text-dark);
  box-shadow: var(--shadow-md);
  gap: 4px;
}
#tiposContainer .tipo-btn .tipo-icon{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  flex: 0 0 28px;
}
#tiposContainer .tipo-btn .tipo-icon img{
  width: 22px; height: 22px; display: block; object-fit: contain; filter: none;
}
#tiposContainer .tipo-btn.activo .tipo-icon{ background: var(--tipo-primary); border-color: var(--tipo-primary); }
#tiposContainer .tipo-btn.activo .tipo-icon img{ filter: brightness(0) invert(1); }
#tiposContainer .tipo-btn .tipo-label{ white-space: nowrap; font-weight: 500; font-size: 13px; }

/* ====== CHIPS DE FILTRO ====== */
#filtrosContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#filtrosContainer .btn-filtro {
  height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px solid var(--chip-border);
  background-color: var(--chip-bg);
  cursor: pointer;
}
#filtrosContainer .btn-filtro.activo {
  background-color: #333; color: #fff; border-color: #444;
}

/* ====== LISTA y LIMPIAR con patrón de tipo (chip + círculo en <i>) ====== */
#listaBtn,
#limpiarBtn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 0 4px;          /* deja hueco al círculo */
  border-radius: 20px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
#listaBtn:hover, #limpiarBtn:hover { background: #f2f4f6; border-color: #bbb; }
#listaBtn:active, #limpiarBtn:active { transform: translateY(1px); }
#listaBtn.activo, #limpiarBtn.activo {
  border: 1px solid var(--tipo-ring);
  background: #fff;
  color: var(--text-dark);
  box-shadow: var(--shadow-md);
}
#limpiarBtn { color: red; }
#listaBtn i, #limpiarBtn i {
  width: 25px; height: 25px; margin-right: 6px;
  border-radius: 50%;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-dark);
}
#limpiarBtn i { color: red; }
#listaBtn.activo i, #limpiarBtn.activo i { background: var(--tipo-primary); border-color: var(--tipo-primary); color: #fff; }
#listaBtn span, #limpiarBtn span { white-space: nowrap; font-weight: 500; font-size: 13px; }

/* ====== LISTADO (SIDEBAR COMO TARJETA BAJO HAMBURGUESA) ====== */
#sidebar {
  position: absolute;
  display: none;                 /* se muestra al pulsar hamburguesa */
  background: #fff;
  border-radius: .75rem;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  padding: 14px;
  max-height: 60vh;
  overflow: auto;
}
#sidebar::before {
  content: "✕";
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 18px;
  cursor: pointer;
}
#sidebar hr { border: 0; border-top: 1px solid #eee; margin: 10px 0; }

/* ====== FILTROS AVANZADOS EN GRID (debajo del panel, mismo ancho) ====== */
#filtrosAvanzados {
  position: absolute;
  display: none;                 /* el JS alterna a 'grid' */
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  z-index: 1000;
  max-height: 50vh;
  overflow-y: auto;

  /* GRID por columnas responsive */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 14px;
}
.adv-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.adv-title { font-weight: 600; color: var(--text-dark); }
#filtrosAvanzados select { width: 100%; min-height: 110px; }

/* ====== TARJETA (InfoWindow) ====== */
/* Ocultar la “X” del InfoWindow nativo */
.gm-ui-hover-effect { display: none !important; }

/* Card */
.poi-card { font-family: inherit; color: #0b2237; min-width: 280px; max-width: 360px; }
.poi-card__header { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; margin-bottom: 6px; }
.poi-card__icon { width: 40px; height: 40px; object-fit: contain; }
.poi-card__img { width: 100%; height: auto; object-fit: contain; }

.poi-card__title { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 800; }

/* Dirección + distancia */
.poi-card__row { display: grid; grid-template-columns: 1fr auto; gap: 0px; align-items: start; margin: 2px 0 8px; font-size: 14px; }
.poi-card__left { color: #30465a; margin-left: 10px; }
.poi-card__right { color: #30465a; font-weight: 600; }

/* Productos: “badge (cantidad) + nombre” por línea */
.poi-products { list-style: none; padding: 0; margin: 12px 6px 12px 6px; }
.poi-products li { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.poi-badge{
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--tipo-primary); color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}

/* Botones de acción */
.poi-card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.poi-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.poi-btn--outline { border: 2px solid var(--tipo-primary); color: var(--tipo-primary); background: #fff; }
.poi-btn--solid   { border: 2px solid var(--tipo-primary); background: var(--tipo-primary); color: #fff; }
.poi-btn--accent  { border: 2px solid #e74c3c; background: #e74c3c; color: #fff; }

/* ====== UTILIDAD ICONOS IMG GENÉRICOS ====== */
.btn-icon-img {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  display: inline-block;
  vertical-align: -2px;
}

/* ====== BANNER GEOLOCALIZACIÓN ====== */
.geo-banner{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1002;
  background: #fff;
  border: 1px solid var(--chip-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  max-width: min(680px, 92vw);
}

.geo-banner__content{
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
}

.geo-banner__icon{
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-dark);
}

.geo-banner__text strong{
  display: block;
  font-size: 14px;
  line-height: 1.2;
  color: var(--text-dark);
}
.geo-banner__text span{
  display: block;
  font-size: 13px;
  color: #30465a;
  margin-top: 2px;
}

.geo-banner__actions{
  display: inline-flex;
  gap: 8px;
}

.geo-btn{
  height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  color: var(--chip-text);
  transition: background .2s ease, border-color .2s ease, transform .05s ease;
}
.geo-btn:hover{ background: #f2f4f6; border-color: #bbb; }
.geo-btn:active{ transform: translateY(1px); }

.geo-btn--primary{
  border-color: var(--tipo-primary);
  background: var(--tipo-primary);
  color: #fff;
}
.geo-btn--primary:hover{
  filter: brightness(1.05);
}
.geo-btn--ghost{
  background: #fff;
}

.sidebar-poi-card {
  padding: 0px 0px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-poi-top {
  display: flex;
  gap: 8px;
}

.sidebar-poi-img {
  flex: 0 0 40%;
	margin-top: 3px;
}

.sidebar-poi-img img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}

.sidebar-poi-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.poi-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-poi-title {
  font-size: 1rem;
  font-weight: bold;
}

.sidebar-poi-tipo{
	font-size: 0.8rem;
    font-weight: normal;
	display: block;
}

.sidebar-poi-icon {
  width: 20px;
  height: 20px;
}

.poi-dir-line,
.poi-dir-line-2 {
  font-size: 0.85rem;
  color: #444;
}

.sidebar-separator {
  margin: 0px 0 !important;
  border: none !important;
  border-top: 1px solid #ccc !important;
}

.sidebar-divider {
  margin: 2px 0 !important;
  border: none !important;
  border-top: 1px solid #000 !important;
}


.sidebar-poi-body {
  display: flex;
  gap: 10px;
}

.sidebar-poi-products {
  flex: 1;
}

.sidebar-poi-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 6px;
}

.sidebar-poi-actions .poi-btn {
  padding: 6px 8px;
  font-size: 0.85rem;
  text-align: center;
}


/* Responsive */
@media (max-width: 560px){
  .geo-banner__content{
    grid-template-columns: 24px 1fr;
    grid-template-rows: auto auto;
  }
  .geo-banner__actions{
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1200px) {
  .panel-search { width: 300px; }
}
@media (max-width: 992px) {
  .panel-search { width: 280px; }
}
@media (max-width: 768px) {
  .panel-search { width: 100%; min-width: 0; }
  #sidebar { width: min(92vw, 420px); } /* el JS la ajusta igualmente */
}