/* ===== Fidalsa Listings - estilos ===== */

.fidalsa-widget {
  font-family: inherit;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0;
}

/* ---- Filtros ---- */
.fidalsa-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.fidalsa-filters select,
.fidalsa-filters input {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
}
.fidalsa-filters select:focus,
.fidalsa-filters input:focus {
  outline: none;
  border-color: #00bfa5;
}
.fidalsa-counter {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

/* ---- Grid ---- */
.fidalsa-grid {
  display: grid;
  gap: 24px;
}
.fidalsa-widget[data-columnas="2"] .fidalsa-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.fidalsa-widget[data-columnas="3"] .fidalsa-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fidalsa-widget[data-columnas="4"] .fidalsa-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---- Card ---- */
.fidalsa-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.25s ease;
  text-decoration: none !important;
  color: inherit;
  display: block;
}
.fidalsa-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Imagen */
.fd-img-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 75%; /* ratio 4:3 */
  overflow: hidden;
  background: #f5f5f5;
}
.fd-img-wrap img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Body */
.fd-body {
  padding: 16px 4px 18px;
}

/* Título + rating en la misma línea */
.fd-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #222;
}
.fd-rating {
  color: #f5a623;
  font-weight: 600;
  font-size: 14px;
  margin-left: 2px;
  white-space: nowrap;
}

/* Ubicación */
.fd-location {
  margin: 0 0 6px;
  font-size: 14px;
  color: #555;
  font-weight: 400;
}

/* Specs */
.fd-specs {
  margin: 0;
  font-size: 13px;
  color: #888;
}

/* ---- Mensajes ---- */
.fidalsa-empty {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

/* ---- Card oculta por filtro ---- */
.fidalsa-card.fd-hidden {
  display: none;
}

/* ---- Galería con dots ---- */
.fd-gallery .fd-img-wrap img {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fd-gallery .fd-img-wrap img.fd-img-active {
  opacity: 1;
}

.fd-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
}
.fidalsa-card:hover .fd-dots {
  opacity: 1;
}
.fd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.fd-dot.fd-dot-active {
  background: #fff;
  transform: scale(1.3);
}
.fd-dot:hover {
  background: rgba(255,255,255,0.85);
}

/* ---- Flechas de galería ---- */
.fd-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
  padding: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
  line-height: 0;
}
.fd-arrow-prev { left: 8px; }
.fd-arrow-next { right: 8px; }
.fidalsa-card:hover .fd-arrow { opacity: 1; }
.fd-arrow:hover { filter: drop-shadow(0 1px 6px rgba(0,0,0,0.8)); }

/* ---- Imagen rota ---- */
.fd-img-wrap.fd-img-error {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
}
.fd-img-wrap.fd-img-error img {
  display: none;
}
.fd-img-wrap.fd-img-error::after {
  content: "🏠";
  font-size: 48px;
  opacity: 0.3;
}

/* ---- Mapa ---- */
.fidalsa-map-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

/* Marcador individual */
.fd-marker { background: none !important; border: none !important; }
.fd-marker-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: #00bfa5;
  transform: rotate(-45deg);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cluster */
.fd-cluster {
  width: 36px;
  height: 36px;
  background: #00bfa5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  font-family: inherit;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 10px rgba(0,191,165,0.4);
}

/* Popup wrapper */
.fd-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.fd-popup-wrap .leaflet-popup-content {
  margin: 0;
  width: 220px !important;
}
.fd-popup-wrap .leaflet-popup-tip-container { margin-top: -1px; }

/* Card compacta dentro del popup — hereda estilos del grid, ajusta tamaños */
.fd-popup-wrap .leaflet-popup-content {
  width: 170px !important;
}
.fd-popup-card {
  border-radius: 0;
  box-shadow: none;
}
.fd-popup-card .fd-img-wrap { padding-bottom: 52%; }
.fd-popup-card .fd-body     { padding: 8px 8px 10px; }
.fd-popup-card .fd-title    { font-size: 11px; margin-bottom: 2px; }
.fd-popup-card .fd-location { font-size: 10px; margin-bottom: 3px; }
.fd-popup-card .fd-specs    { font-size: 10px; }
.fd-popup-card .fd-rating   { font-size: 11px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .fidalsa-widget[data-columnas="3"] .fidalsa-grid,
  .fidalsa-widget[data-columnas="4"] .fidalsa-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .fidalsa-widget[data-columnas="2"] .fidalsa-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .fd-body { padding: 12px 2px 14px; }
  .fd-title { font-size: 13px; }
  .fd-location { font-size: 12px; }
  .fd-specs { font-size: 11px; }
}
