/* ========================================
   MODERN CSS - BROWSER COMPATIBLE
   ======================================== */

.body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-areas:
    "hero hero"
    "section1 section1"
    "section2 section2"
    "section3 section3"
    "section4 section4"
    "section7 section7"
    "section5 section5"
    "section6 section6"
    "footer footer";
  background-color: var(--negro);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.h1,
.h2 {
  width: 100%;
  font-family: "Catamaran", sans-serif;
  font-style: oblique;
  color: var(--secundario);
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.h1:hover,
.h2:hover {
  transform: translateX(5px);
  text-shadow: 0 0 20px rgba(204, 214, 35, 0.5);
}

.h3 {
  color: var(--secundario);
  font-family: "Catamaran", sans-serif;
  font-style: oblique;
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 20px;
}

.p {
  color: var(--blanco);
  margin-bottom: 1rem;
}

/* ========================================
   BUTTONS
   ======================================== */

.button__book,
.button__info {
  display: inline-block;
  max-width: fit-content;
  color: var(--primario);
  background-color: var(--secundario);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 10px;
  border: 3px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 2;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.button__book::before,
.button__info::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.button__book:hover,
.button__info:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(204, 214, 35, 0.4);
  background-color: #d4e627;
}

.button__book:hover::before,
.button__info:hover::before {
  left: 100%;
}

.button__book:active,
.button__info:active {
  transform: translateY(-1px) scale(1.02);
}

.button__book {
  margin: 20px;
  padding: 8px 5px;
  font-size: 1.5rem;
}

.button__info {
  margin: 10px 0 0 4rem;
  padding: 5px 3px;
  font-size: 1.2rem;
}

.button__book-icon {
  display: inline-block;
  width: 1.5rem;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  width: 100%;
  grid-area: hero;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  position: relative;
}

.hero__logo {
  width: 100px;
  position: fixed;
  top: 20px;
  left: 20px;
  border-radius: 50%;
  animation: float 3s ease-in-out infinite, sombra 3s ease-in-out infinite;
  z-index: 1;
  transition: transform 0.3s ease;
}

.hero__logo:hover {
  transform: scale(1.1) rotate(5deg);
}

.hero_contenido {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  background-image: url(/images/hero_fondo.webp);
  background-size: cover;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 2rem 2rem rgba(0, 0, 0, 0.6);
}

.hero__offroad1,
.hero__offroad2 {
  font-family: "Catamaran", sans-serif;
  font-style: oblique;
  color: rgba(0, 0, 0, 0.585);
  position: absolute;
  font-size: 3rem;
  animation: texto 2.5s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.hero__offroad1:hover,
.hero__offroad2:hover {
  transform: scale(1.05);
  animation-play-state: paused;
}

.hero__offroad1 {
  top: 35%;
  left: 5%;
  z-index: -1;
}

.hero__offroad2 {
  top: 60%;
  right: 5%;
  z-index: 2;
}

.hero__imagen {
  display: none;
  width: 70%;
  z-index: 1;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.hero__imagen-movil {
  display: block;
  width: 80%;
  z-index: 1;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.coche-fijo {
  display: none;
  position: fixed;
  width: 70vw;
  height: 70vh;
  top: calc((100% - 70vw) / 2);
  left: calc((100% - 70vw) / 2);
  z-index: -2;
}

.coche-fijo2 {
  display: block;
  position: fixed;
  width: 80vw;
  height: 80vh;
  top: calc((100% - 80vw) / 2);
  left: calc((100% - 80vw) / 2);
  z-index: -2;
}

/* ========================================
   SECTION 1 - PRESENTATION
   ======================================== */

.section__presentacion {
  width: 100%;
  height: 100%;
  padding: 10px 10%;
  grid-area: section1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ========================================
   SECTION 2 - VIDEO
   ======================================== */

.section__video {
  width: 100%;
  padding: 0 10px;
  height: auto;
  grid-area: section2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(0deg, rgba(31, 71, 96, 1) 0%, rgba(0, 0, 0, 0) 100%);
  position: relative;
}

.section__video-img {
  width: 100%;
  position: absolute;
  bottom: 50%;
  z-index: -1;
}

.section__video-iframe {
  width: 100%;
  max-width: 700px;
  border-radius: 20px;
  height: 40vh;
  margin: 5rem 0;
  padding: 5px;
  animation: sombra 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.section__video-iframe:hover {
  transform: scale(1.02);
}

/* FACADE DE VÍDEO (poster + botón play hasta que se hace clic) */
.video-facade {
  position: relative;
  border: none;
  cursor: pointer;
  background-color: var(--negro);
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-facade__play {
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: var(--secundario);
  position: relative;
  transition: transform 0.2s ease;
}

.video-facade__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--primario);
}

.video-facade:hover .video-facade__play,
.video-facade:focus-visible .video-facade__play {
  transform: scale(1.12);
}

/* ========================================
   SECTION 3 - INFO
   ======================================== */

.section3__info {
  width: 100%;
  grid-area: section3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, rgba(31, 71, 96, 1) 0%, rgba(204, 214, 35, 1) 100%);
  z-index: 1;
}

.section3__info-cont {
  padding: 10%;
}

/* ========================================
   SECTION 4 - LANDSCAPE IMAGE
   ======================================== */

.section4 {
  width: 100%;
  height: auto;
  padding: 10px;
  grid-area: section4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, rgba(204, 214, 35, 1) 0%, rgba(31, 71, 96, 1) 100%);
}

.section4__img {
  width: 100%;
  border-radius: 20px;
  margin: 60px 0;
  padding: 5px;
  animation: sombra 3s ease-in-out infinite;
  transition: transform 0.5s ease, filter 0.3s ease;
  filter: brightness(0.95);
}

.section4__img:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ========================================
   SECTION 5 - GRID GALLERY
   ======================================== */

.section5__grid {
  width: 100vw;
  grid-area: section5;
  background: linear-gradient(0deg, rgba(31, 71, 96, 1) 0%, rgba(204, 214, 35, 1) 100%);
}

section.grid {
  background-color: #1f4760;
  padding: 5rem 5%;
  display: grid;
  grid-gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 15rem 15rem 15rem;
  grid-template-areas:
    "producto1 producto2 producto2"
    "producto3 producto3 producto6"
    "producto5 producto4 producto7";
}

.producto1 {
  grid-area: producto1;
}
.producto2 {
  grid-area: producto2;
}
.producto3 {
  grid-area: producto3;
}
.producto4 {
  grid-area: producto4;
}
.producto5 {
  grid-area: producto5;
}
.producto6 {
  grid-area: producto6;
}
.producto7 {
  grid-area: producto7;
}

.producto {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.producto:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(204, 214, 35, 0.3);
}

.more_info {
  width: 2rem;
  position: absolute;
  bottom: 8px;
  left: 10px;
  z-index: 1;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.producto:hover .more_info {
  transform: scale(1.2) rotate(15deg);
  filter: drop-shadow(0 0 8px rgba(204, 214, 35, 0.8));
}

.img {
  width: 100%;
  height: 15rem;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
  filter: brightness(0.9);
}

.img:hover {
  transform: scale(1.15) rotate(2deg);
  filter: brightness(1.1) contrast(1.1);
}

.titulo {
  width: 100%;
  font-family: "Catamaran", sans-serif;
  font-style: oblique;
  position: absolute;
  bottom: 0;
  padding: 8px 8px 8px 40px;
  color: #cddd53;
  background: linear-gradient(0deg, rgba(31, 71, 96, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 212, 255, 0) 100%);
  font-size: clamp(0.9rem, 2.2vw, 1.3rem);
  transition: all 0.3s ease;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1.15;
  min-height: 50px;
  display: flex;
  align-items: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.producto:hover .titulo {
  padding-bottom: 12px;
  text-shadow: 0 0 10px rgba(204, 214, 35, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* ========================================
   LIGHTBOX
   ======================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(10px);
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}

.lightbox.activo {
  display: flex;
  flex-flow: column;
  align-items: center;
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.lightbox .cerrar {
  position: absolute;
  top: 20px;
  right: 30px;
  cursor: pointer;
  width: 40px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.lightbox .cerrar:hover {
  transform: scale(1.2) rotate(90deg);
  filter: drop-shadow(0 0 12px rgba(204, 214, 35, 0.8));
}

.lightbox .imagen_grande {
  margin-top: 10vh;
  width: 90%;
  height: 50%;
  padding: 5px;
  border-radius: 20px;
  object-fit: cover;
  animation: sombra 3s ease-in-out infinite;
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.4s ease;
}

.lightbox.activo .imagen_grande {
  transform: scale(1);
  opacity: 1;
}

.texto_light {
  width: 90%;
  color: var(--blanco);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.lightbox.activo .texto_light {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   SECTION 6 - CONTACT & MAP
   ======================================== */

.section6__google {
  width: 100vw;
  grid-area: section6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--primario);
}

.section6__contacto {
  text-align: center;
  padding: 5rem 0 10rem;
  z-index: 1;
}

.section6__iframe-google {
  min-width: 100vw;
  height: 60vh;
}

/* FACADE DE GOOGLE MAPS (poster + pin hasta que se hace clic) */
.map-facade {
  position: relative;
  border: none;
  cursor: pointer;
  /* Sin poster local: queda el azul de fondo de respaldo */
  background-color: var(--primario);
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Capa oscura sobre el fondo para que el pin y el texto se lean siempre */
.map-facade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(31, 71, 96, 0.55); /* --primario translúcido */
}

.map-facade__content {
  position: relative; /* por encima de la capa oscura */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--blanco);
  font-family: var(--tipo-principal);
}

.map-facade__pin {
  width: 34px;
  height: 34px;
  background: var(--secundario);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
}

.map-facade__pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primario);
}

.map-facade__text {
  font-size: 1.2rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.map-facade:hover .map-facade__text,
.map-facade:focus-visible .map-facade__text {
  color: var(--secundario);
}

/* ========================================
   SECTION 7 - PARALLAX
   ======================================== */

.section7__parallax {
  width: 100%;
  text-align: center;
  padding: 20vh 20px;
  grid-area: section7;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  width: 100%;
  padding: 5rem 0 10rem;
  text-align: center;
  grid-area: footer;
  background: linear-gradient(180deg, rgba(31, 71, 96, 1) 0%, rgba(0, 0, 0, 1) 100%);
  z-index: 1;
}

.footer__logo {
  width: 150px;
  margin: 3rem auto;
  border-radius: 50%;
  animation: float 4s ease-in-out infinite, sombra 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.footer__logo:hover {
  transform: scale(1.1);
  animation-play-state: paused;
}

.footer__icons {
  display: flex;
  justify-content: center;
}

.footer__firma {
  text-align: center;
}

.footer__button-book {
  position: fixed;
  bottom: 20px;
  left: 30px;
  display: inline-block;
  max-width: fit-content;
  color: var(--primario);
  background-color: var(--secundario);
  padding: 8px 5px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 10px;
  border: 3px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 1.5rem;
  z-index: 2;
  animation: pulse 2s ease-in-out infinite;
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.footer__button-book::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.footer__button-book:hover {
  animation-play-state: paused;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 10px 30px rgba(204, 214, 35, 0.5);
}

.footer__button-book:hover::before {
  left: 100%;
}

.footer__button-whatsapp {
  position: fixed;
  bottom: 10px;
  right: 30px;
  z-index: 2;
  /* Tamaño fijo (= icono) para anclar bien los anillos */
  width: 4rem;
  height: 4rem;
  transition: transform 0.3s ease;
}

.footer__button-whatsapp:hover {
  transform: scale(1.1);
}

/* Anillos expansivos detrás del botón ("WhatsApp sonando").
   Dos anillos con el mismo bucle pero desfasados → onda continua */
.footer__button-whatsapp::before,
.footer__button-whatsapp::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #25d366; /* verde WhatsApp */
  z-index: 0;
  animation: ondas-whatsapp 2s ease-out infinite;
}

.footer__button-whatsapp::after {
  animation-delay: 1s; /* cuando un anillo va por la mitad, sale el otro */
}

.footer__phone {
  position: relative; /* por encima de los anillos */
  z-index: 1;
  width: 4rem;
  height: 4rem;
  filter: drop-shadow(0 4px 10px rgba(37, 211, 102, 0.5));
  /* Vibración: tiembla un instante cada 4s y descansa el resto */
  animation: vibrar-whatsapp 4s ease-in-out infinite;
  transition: filter 0.3s ease;
}

.footer__button-whatsapp:hover .footer__phone {
  filter: drop-shadow(0 8px 20px rgba(37, 211, 102, 0.8));
}

/* Anillo que crece desde el botón y se desvanece */
@keyframes ondas-whatsapp {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* El tembleque ocurre solo al final del ciclo (últimas décimas) */
@keyframes vibrar-whatsapp {
  0%,
  88%,
  100% {
    transform: rotate(0);
  }
  90% {
    transform: rotate(-12deg);
  }
  92% {
    transform: rotate(12deg);
  }
  94% {
    transform: rotate(-10deg);
  }
  96% {
    transform: rotate(10deg);
  }
  98% {
    transform: rotate(-6deg);
  }
}

.icons {
  display: inline-block;
  width: 30px;
  margin: 15px;
  transition: all 0.3s ease;
  filter: grayscale(0.3);
}

.icons:hover {
  transform: translateY(-5px) scale(1.2);
  filter: grayscale(0) drop-shadow(0 5px 15px rgba(204, 214, 35, 0.5));
}

.heart {
  display: inline-block;
  width: 30px;
}

/* ========================================
   ANIMATIONS
   ======================================== */

/* Animación de sombra original con parpadeo */
@keyframes sombra {
  0%,
  10%,
  15%,
  20%,
  30%,
  35%,
  40%,
  50%,
  55%,
  60%,
  70%,
  75%,
  80%,
  85%,
  90%,
  100% {
    box-shadow: 7px 5px 6px #cddd53, 7px 7px 7px #68c6dd, 7px 7px 5px #214254,
      7px 5px 9px #b7e5ef;
  }
  10%,
  60%,
  80%,
  85% {
    box-shadow: none;
  }
}

/* Animación de texto original con parpadeo */
@keyframes texto {
  0%,
  10%,
  15%,
  20%,
  30%,
  35%,
  40%,
  50%,
  55%,
  60%,
  70%,
  75%,
  80%,
  85%,
  90%,
  100% {
    text-shadow: 5px 5px 6px #cddd53, 3px 3px 5px #68c6dd, -3px -3px 5px #214254,
      -5px -5px 9px #b7e5ef;
  }
  10%,
  15%,
  80%,
  85% {
    text-shadow: none;
  }
}

/* Animación de flotación para el logo */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Animación de pulso para botones */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(204, 214, 35, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 5px rgba(204, 214, 35, 0);
  }
}

/* Efecto de brillo que recorre el botón */
@keyframes shine {
  0% {
    left: -100%;
  }
  20%, 100% {
    left: 100%;
  }
}

/* Animación de entrada desde abajo */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de rotación suave para elementos hover */
@keyframes rotateIn {
  from {
    transform: rotate(-5deg) scale(0.9);
    opacity: 0;
  }
  to {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

/* ========================================
   MEDIA QUERIES
   ======================================== */

@media screen and (min-width: 480px) {
  .hero__offroad1 {
    font-size: 4rem;
    top: 30%;
    left: 10%;
  }

  .hero__offroad2 {
    font-size: 4rem;
    top: 60%;
    right: 10%;
  }

  .section__video-iframe {
    height: 50vh;
  }

  .titulo {
    font-size: clamp(1.1rem, 2.3vw, 1.6rem);
    padding: 10px 10px 10px 45px;
  }
}

@media screen and (min-width: 720px) {
  section.grid {
    grid-template-areas:
      "producto1 producto1 producto1"
      "producto2 producto2 producto2"
      "producto3 producto3 producto3"
      "producto4 producto4 producto4"
      "producto5 producto5 producto5"
      "producto6 producto6 producto6"
      "producto7 producto7 producto7";
    grid-template-rows: 15rem 15rem 15rem 15rem 15rem 15rem 15rem;
  }
}

@media screen and (min-width: 768px) {
  .body {
    grid-template-areas:
      "hero hero"
      "section1 section1"
      "section2 section2"
      "section3 section4"
      "section7 section7"
      "section5 section5"
      "section6 section6"
      "footer footer";
  }

  .hero__offroad1 {
    font-size: 5rem;
    top: 30%;
    left: 15%;
  }

  .hero__offroad2 {
    font-size: 5rem;
    top: 60%;
    right: 15%;
  }

  .section__video-img {
    bottom: 20%;
  }

  .section__video-iframe {
    height: 60vh;
  }

  .section4 {
    padding: 0 10%;
    background: linear-gradient(180deg, rgba(31, 71, 96, 1) 0%, rgba(204, 214, 35, 1) 100%);
  }

  .lightbox .imagen_grande {
    width: 60%;
    height: 50%;
  }

  .texto_light {
    width: 60%;
  }

  section.grid {
    grid-template-areas:
      "producto1 producto2 producto2"
      "producto3 producto3 producto6"
      "producto5 producto4 producto7";
    grid-template-rows: 15rem 15rem 15rem;
  }

  .titulo {
    font-size: clamp(1.3rem, 1.8vw, 1.8rem);
  }
}

@media screen and (min-width: 960px) {
  .hero__imagen {
    display: block;
  }

  .hero__imagen-movil {
    display: none;
  }

  .section__video-img {
    width: 80%;
    bottom: 0;
  }

  .section4 {
    min-height: 450px;
  }
}

@media screen and (min-width: 1024px) {
  .coche-fijo {
    display: block;
    width: 70vw;
    height: 70vw;
    top: calc((100% - 70vw) / 2);
    left: calc((100% - 70vw) / 2);
  }

  .coche-fijo2 {
    display: none;
  }

  .hero__offroad1 {
    font-size: 7rem;
    top: 30%;
    left: 15%;
  }

  .hero__offroad2 {
    font-size: 7rem;
    top: 60%;
    right: 15%;
  }
}
