/* Bizma Properties – estilos básicos */
/* v1.3.0 - Con estados, transiciones mejoradas y lazy loading */

/* ===== Cards ===== */
.bizma-props .card {
  border: 1px solid rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
}

.bizma-props .card.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

.bizma-props .card img {
  object-fit: cover;
  height: 200px;
  background: #f3f4f6;
  transition: transform .3s ease;
}

.bizma-props .card a:hover img {
  transform: scale(1.05);
}

@media (min-width: 992px){
  .bizma-props .card img { height: 220px; }
}

/* ===== Badges ===== */
.bizma-props .badge { 
  border-radius: 10rem; 
  font-weight: 500;
}

.bizma-props .badge.text-bg-light {
  background-color: #f8f9fa !important;
  color: #495057 !important;
  border: 1px solid rgba(0,0,0,.08);
}

/* ===== Pagination ===== */
#bp-pagination { 
  gap: .75rem; 
}

#bp-pagination .btn[disabled] { 
  opacity: .5;
  cursor: not-allowed;
}

#bp-pagination #bp-pageinfo {
  min-width: 200px;
  text-align: center;
}

/* ===== Loading State ===== */
#bp-loading {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#bp-loading .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: .3rem;
}

/* ===== Error State ===== */
#bp-error {
  border-left: 4px solid var(--bs-danger, #dc3545);
}

/* ===== Empty State ===== */
#bp-empty {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#bp-empty i {
  opacity: .3;
  font-size: 4rem;
}

/* ===== Stretched Link Fix ===== */
.bizma-props .card .stretched-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}

/* ===== Price Badge ===== */
.bizma-props .badge.bg-primary {
  backdrop-filter: blur(8px);
  background-color: rgba(13, 110, 253, 0.9) !important;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 576px) {
  .bizma-props .card img {
    height: 180px;
  }
  
  .bizma-props .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
  }
  
  #bp-pagination {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  #bp-pagination .btn {
    width: 100%;
  }
}

/* ===== Icon Spacing ===== */
.bi {
  display: inline-block;
  vertical-align: -.125em;
}

/* ===== Smooth Transitions ===== */
* {
  transition-duration: .15s;
  transition-timing-function: ease-in-out;
}

a, button {
  transition: all .15s ease-in-out;
}

/* ===== Focus States ===== */
.bizma-props .btn:focus,
.bizma-props .form-control:focus,
.bizma-props .form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ===== Lazy Loading Placeholder ===== */
.bizma-props img[loading="lazy"] {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

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

/* ===== Card Hover Effects ===== */
.bizma-props .card-body {
  position: relative;
  z-index: 2;
}

.bizma-props .card:hover .card-title a {
  color: var(--bs-primary, #0d6efd) !important;
}

/* ===== Botones del Single ===== */
.bizma-contact-btn,
.bizma-share-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.bizma-contact-btn:hover,
.bizma-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bizma-contact-btn:active,
.bizma-share-btn:active {
  transform: translateY(0);
}

/* Breadcrumbs con enlaces */
.breadcrumb-item a {
  color: var(--bs-primary, #0d6efd);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
  color: var(--bs-link-hover-color, #0a58ca);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #6c757d;
  font-weight: 500;
}

/* Sticky sidebar mejorado */
@media (min-width: 992px) {
  .sticky-top {
    position: sticky !important;
    top: 20px;
    z-index: 1020;
  }
}

/* ===== Características y Amenidades - Estilos Forzados ===== */

/* Reset de estilos del tema */
.bizma-props .property-features-list,
.bizma-props .property-amenities-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 0.75rem 1rem !important;
  width: 100% !important;
}

/* Items individuales */
.bizma-props .property-features-list li,
.bizma-props .property-amenities-list li {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.5 !important;
  font-size: inherit !important;
  list-style: none !important;
  background: none !important;
  border: none !important;
}

/* Iconos */
.bizma-props .property-features-list li i,
.bizma-props .property-amenities-list li i {
  flex-shrink: 0 !important;
  margin-top: 0.125rem !important;
  font-size: 1rem !important;
  line-height: 1 !important;
}

.bizma-props .property-features-list li i.text-success {
  color: #198754 !important;
}

.bizma-props .property-amenities-list li i.text-primary {
  color: #0d6efd !important;
}

/* Texto de los items */
.bizma-props .property-features-list li span,
.bizma-props .property-amenities-list li span {
  flex: 1 !important;
  word-break: break-word !important;
}

/* Cards contenedoras */
.bizma-props .property-features-card,
.bizma-props .property-amenities-card {
  border: 1px solid rgba(0, 0, 0, 0.125) !important;
  border-radius: 0.375rem !important;
  background-color: #fff !important;
  margin-bottom: 1rem !important;
}

.bizma-props .property-features-card .card-body,
.bizma-props .property-amenities-card .card-body {
  padding: 1.25rem !important;
}

.bizma-props .property-features-card .card-title,
.bizma-props .property-amenities-card .card-title {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  margin-bottom: 1rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.bizma-props .property-features-card .card-title i,
.bizma-props .property-amenities-card .card-title i {
  font-size: 1.25rem !important;
}

/* Responsive */
@media (max-width: 767px) {
  .bizma-props .property-features-list,
  .bizma-props .property-amenities-list {
    grid-template-columns: 1fr !important;
  }
}

/* Asegurar que no hay estilos inline conflictivos */
.bizma-props .property-features-list[style],
.bizma-props .property-amenities-list[style] {
  display: grid !important;
}

/* ===== Galería de Propiedad ===== */

/* Thumbnails de galería */
.property-gallery-thumbnails {
  margin-top: 1rem;
}

.gallery-thumb-wrapper {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-thumb-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
}

.gallery-thumb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: 0.5rem;
}

/* Hero image clickeable */
.property-hero-image {
  transition: transform 0.2s;
}

.property-hero-image:hover {
  transform: scale(1.02);
}

/* Modal de galería */
#galleryModal .modal-content {
  background-color: #000;
  border: none;
}

#galleryModal .carousel-inner {
  background-color: #000;
}

#galleryModal .carousel-item img {
  background-color: #000;
}

#galleryModal .carousel-control-prev,
#galleryModal .carousel-control-next {
  width: 10%;
  opacity: 1;
}

#galleryModal .carousel-control-prev-icon,
#galleryModal .carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  padding: 0.75rem;
}

#galleryModal .carousel-control-prev:hover .carousel-control-prev-icon,
#galleryModal .carousel-control-next:hover .carousel-control-next-icon {
  background-color: rgba(255, 255, 255, 0.6);
}

#galleryModal .carousel-indicators {
  margin-bottom: 1rem;
}

#galleryModal .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
}

#galleryModal .carousel-indicators .active {
  background-color: #fff;
}

/* Badge de contador de fotos */
.badge.bg-dark.bg-opacity-75 {
  backdrop-filter: blur(8px);
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-thumb-wrapper {
    aspect-ratio: 1;
  }
  
  #galleryModal .carousel-control-prev,
  #galleryModal .carousel-control-next {
    width: 15%;
  }
  
  #galleryModal .carousel-control-prev-icon,
  #galleryModal .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
  }
}

/* ===== Mapa de Propiedad con Leaflet ===== */

/* Card contenedor del mapa */
.bizma-props .bizma-map-card {
  border: 1px solid rgba(0, 0, 0, 0.125) !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
  background-color: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.bizma-props .bizma-map-card .card-body {
  padding: 0 !important;
}

/* Contenedor del mapa */
.bizma-props .bizma-property-map {
  width: 100% !important;
  height: 400px !important;
  position: relative !important;
  z-index: 1 !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
}

/* Fix para Leaflet - Resetear estilos del tema */
.bizma-props .bizma-property-map * {
  box-sizing: border-box !important;
}

.bizma-props .bizma-property-map img {
  max-width: none !important;
  max-height: none !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  object-fit: initial !important;
}

/* Popup personalizado */
.bizma-props .leaflet-popup-content-wrapper {
  border-radius: 0.5rem !important;
  padding: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.bizma-props .leaflet-popup-content {
  margin: 1rem !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  line-height: 1.5 !important;
}

.bizma-props .leaflet-popup-tip {
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15) !important;
}

/* Controles de zoom */
.bizma-props .leaflet-control-zoom {
  border: 2px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
}

.bizma-props .leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 20px !important;
  border: none !important;
  background-color: #fff !important;
  color: #333 !important;
  transition: all 0.2s ease !important;
}

.bizma-props .leaflet-control-zoom a:hover {
  background-color: #f8f9fa !important;
  color: #0d6efd !important;
}

/* Atribución */
.bizma-props .leaflet-control-attribution {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border-radius: 0.25rem !important;
  margin: 0.5rem !important;
}

.bizma-props .leaflet-control-attribution a {
  color: #6c757d !important;
  text-decoration: none !important;
}

.bizma-props .leaflet-control-attribution a:hover {
  color: #0d6efd !important;
  text-decoration: underline !important;
}

/* Marker personalizado */
.bizma-props .leaflet-marker-icon {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) !important;
}

/* Loading state del mapa */
.bizma-props .bizma-property-map.loading {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%) !important;
  background-size: 200% 100% !important;
  animation: mapLoading 1.5s ease-in-out infinite !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.bizma-props .bizma-property-map.loading::before {
  content: "Cargando mapa..." !important;
  color: #6c757d !important;
  font-size: 1rem !important;
}

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

/* Responsive */
@media (max-width: 768px) {
  .bizma-props .bizma-property-map {
    height: 300px !important;
  }
  
  .bizma-props .leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 18px !important;
  }
}

/* Fix para temas que agregan estilos a todos los divs */
.bizma-props .leaflet-pane,
.bizma-props .leaflet-tile,
.bizma-props .leaflet-marker-icon,
.bizma-props .leaflet-marker-shadow,
.bizma-props .leaflet-tile-container,
.bizma-props .leaflet-pane > svg,
.bizma-props .leaflet-pane > canvas,
.bizma-props .leaflet-zoom-box,
.bizma-props .leaflet-image-layer,
.bizma-props .leaflet-layer {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
}

.bizma-props .leaflet-container {
  overflow: hidden !important;
}

.bizma-props .leaflet-tile {
  filter: inherit !important;
  visibility: inherit !important;
}

/* Fix para evitar que las imágenes de los tiles se rompan */
.bizma-props .leaflet-tile-container img {
  width: 256px !important;
  height: 256px !important;
  max-width: 256px !important;
  max-height: 256px !important;
}