/* ===================================================
   Ubicaciones - CSS Limpio y Reorganizado
   =================================================== */

/* --- GLOBAL --- */
#mapa-ubicaciones {
  width: 100%;
  position: relative;
  z-index: 389 !important; /* Debajo del header */
}

/* --- MOBILE LAYOUT --- */
#ubicaciones-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#lista-ubicaciones {
  margin-top: 1.5rem;
}

/* --- FILTROS --- */
#ubicaciones-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 1rem;
}

/* Selects full-width */
#ubicaciones-filtros select {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
}

/* Pills: Comprar / Degustar */
.filtro-tipo-buttons {
  display: flex;
  flex: 1 1 100%;
  gap: 15px;
}
.btn-filtro-tipo {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #0073aa;
  background: #fff;
  color: #0073aa;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-align: center;
  text-transform: none;
}
.btn-filtro-tipo:hover {
  background: #e6f2fa;
}
.btn-filtro-tipo.active {
  background: #0073aa;
  color: #fff;
  border-color: #005177;
}

/* Hacer que #btn-nearest ocupe toda la línea */
#ubic-nearest {
  display: flex;
  flex: 1 1 100%;
}

#ubic-nearest .btn-filtro-tipo {
  flex: 1;
  width: 100%;
}



/* --- DESKTOP LAYOUT --- */
@media (min-width: 768px) {
  #ubicaciones-top {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Filtros a la izquierda */
  #ubicaciones-filtros {
    width: 30%;
    margin-bottom: 0;
  }

  /* Mapa a la derecha */
  #mapa-ubicaciones {
    width: 70%;
  }

  /* Lista bajo el top */
  #lista-ubicaciones {
    margin-top: 2rem;
  }
}

/* ===================================================
   Lista de Ubicaciones - Tarjetas
   =================================================== */
#lista-ubicaciones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.card-ubicacion {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.card-ubicacion h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #333;
}

.card-ubicacion .direccion {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #666;
}

.productos-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.productos-list li {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.tipo {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 6px;
  font-size: 0.8rem;
  border-radius: 4px;
  background: #eee;
  color: #333;
}
.tipo-comprar {
  background: #d1e7dd;
  color: #0f5132;
}
.tipo-degustar {
  background: #cff4fc;
  color: #055160;
}

.detalle-btn {
  margin-top: auto;
  text-align: center;
  padding: 0.5rem;
  font-weight: bold;
  color: #0073aa;
  border-top: 1px solid #eee;
  text-decoration: none;
}
.detalle-btn:hover {
  color: #005177;
}

/* ===================================================
   Popups Leaflet
   =================================================== */
.leaflet-popup.leaflet-popup-card .leaflet-popup-content-wrapper,
.leaflet-popup.leaflet-popup-card .leaflet-popup-content {
  padding: 0 !important;
  margin: 0;
  background: none !important;
  box-shadow: none !important;
}
.leaflet-popup.leaflet-popup-card .leaflet-popup-tip {
  border-top-color: #fff !important;
}
.leaflet-popup.leaflet-popup-card .popup-card {
  background: #fff !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  padding: 0.75rem;
}
.leaflet-popup.leaflet-popup-card .popup-card .card-ubicacion {
  background: transparent;
  padding: 0.75rem;
  transform: scale(0.95);
  transform-origin: top center;
  margin: 0;
}
.leaflet-popup.leaflet-popup-card .popup-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.leaflet-popup.leaflet-popup-card .popup-card .direccion,
.leaflet-popup.leaflet-popup-card .popup-card .productos-list li {
  font-size: 0.85rem;
}
.leaflet-popup.leaflet-popup-card .popup-card .tipo {
  padding: 1px 4px;
  font-size: 0.7rem;
}
.leaflet-popup.leaflet-popup-card .popup-card .detalle-btn {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: inline-block;
}

/* ===================================================
   Paginador Cliente
   =================================================== */
.ubic-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 15px 0; /* separación extra */
  font-size: 0.9rem;
}
.ubic-pager button {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.ubic-pager button[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* ===================================================
   Filter Divider
   =================================================== */

.filter-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 15px 0;
}
.filter-divider::before,
.filter-divider::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background-color: #ccc;
}
.filter-divider span {
  color: #666;
  white-space: nowrap;
}

