/* Ficha de propiedad: visor con zoom, reproductor, mapa, similares y WhatsApp fijo */

:root {
  --azul-marca: #007bff;
}

/* ---------- Galería: más grande en el celular ---------- */
@media (max-width: 767px) {
  /* De borde a borde (anula el margen interno de la tarjeta) y en 4:3 */
  .swiper-main {
    height: auto !important;
    aspect-ratio: 4 / 3;
    width: calc(100% + 50px) !important;
    margin-left: -25px;
    margin-right: -25px;
    border-radius: 0 !important;
  }
  .swiper-main img.img-show,
  .swiper-main video.video-show,
  .swiper-main .plyr {
    border-radius: 0;
  }
}

/* Foto principal: toda la foto es un botón que abre el visor */
.abrir-visor {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.abrir-visor .lupa {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  pointer-events: none;
}
.abrir-visor:focus-visible {
  outline: 3px solid var(--azul-marca);
  outline-offset: -3px;
}

/* Miniaturas de video con ícono de play */
.swiper-thumbs .swiper-slide.es-video {
  position: relative;
}
.swiper-thumbs .swiper-slide.es-video::after {
  content: "\f04b";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* ---------- Reproductor (Plyr) con los colores del sitio ---------- */
.plyr {
  --plyr-color-main: var(--azul-marca);
  --plyr-video-control-background-hover: var(--azul-marca);
  --plyr-control-radius: 8px;
  --plyr-font-family: "Montserrat", sans-serif;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}
.plyr video {
  object-fit: contain;
}
.plyr__control--overlaid {
  padding: 22px;
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.45);
}

/* ---------- Visor a pantalla completa ---------- */
.visor {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #0a0c10;
  display: flex;
  flex-direction: column;
}
.visor[hidden] {
  display: none;
}
html.visor-abierto,
html.visor-abierto body {
  overflow: hidden;
}
.visor-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
}
.visor-cerrar {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.visor-cerrar:hover,
.visor-cerrar:focus-visible {
  background: var(--azul-marca);
}
.visor-swiper {
  flex: 1;
  width: 100%;
  min-height: 0;
}
/* style.css (plantilla vieja) le pone height:auto a .swiper-wrapper: acá
   tiene que ocupar todo el alto para que la foto quede centrada */
.visor-swiper .swiper-wrapper,
.visor-swiper .swiper-slide {
  height: 100% !important;
}
.visor-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0c10;
}
.visor-swiper .swiper-zoom-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.visor-flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
.visor-flecha:hover,
.visor-flecha:focus-visible {
  background: var(--azul-marca);
}
.visor-flecha.swiper-button-disabled {
  opacity: 0.25;
  cursor: default;
}
.visor-prev {
  left: 16px;
}
.visor-next {
  right: 16px;
}
.visor-ayuda {
  margin: 0;
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: "Montserrat", sans-serif;
}
@media (max-width: 767px) {
  .visor-flecha {
    display: none; /* en el celular se desliza */
  }
}

/* ---------- Mapa ---------- */
.mapa-ficha {
  margin-top: 28px;
}
.mapa-ficha h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.mapa-ficha iframe {
  width: 100%;
  height: 280px;
  border: 0;
  border-radius: 10px;
}

/* ---------- Propiedades similares ---------- */
.similares {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 16px;
}
.similares h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 8px 0 18px;
}
.similares-grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.similar {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.similar:hover,
.similar:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}
.similar img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.similar-texto {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px 14px;
  font-size: 14px;
}
.similar-precio {
  color: var(--azul-marca);
  font-weight: 700;
}

/* ---------- WhatsApp fijo en el celular ---------- */
.cta-wpp-fijo {
  display: none;
}
@media (max-width: 767px) {
  .cta-wpp-fijo {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    border-radius: 14px;
    background: #25d366;
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }
  .cta-wpp-fijo:hover,
  .cta-wpp-fijo:focus-visible {
    color: #fff;
  }
  .cta-wpp-fijo i {
    font-size: 22px;
  }
  body.con-cta-fijo {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* Computadora: menos aire debajo de la foto principal (antes 80px) */
@media (min-width: 768px) {
  .swiper-main {
    margin-bottom: 24px !important;
  }
}
