/* Variables de raíz */
:root {
  --primary-color: #2c5282;
  --secondary-color: #4299e1;
  --text-color: #2d3748;
  --light-bg: #f7fafc;
  --white: #ffffff;
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
}

/* Encabezado y navegación */
header {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
}

.logo img {
  max-width: 150px;
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: pointer;
  margin-top: 70px;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
  transition: transform 0.3s ease;
}

.nav-links a {
  text-decoration: none;
  color: black;
  font-weight: 500;
  font-size: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: orange;
  text-shadow: none;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1001;
  padding: 0.5rem;
}

/* Sección Hero */
#hero {
  height: 100vh;
  background: linear-gradient(rgba(230, 160, 29, 0.9), rgba(255, 165, 0, 0.9)),
    url(imagenes/fachada.jpg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 2rem;
}

.hero-content {
  max-width: 800px;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.cta-button {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  background-color: var(--secondary-color);
  color: var(--white);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: var(--primary-color);
}

/* Títulos de secciones */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 2rem;
  padding: 0 1rem;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Carrusel de productos */
.product-carousel {
  padding: 4rem 0;
  background: var(--white);
}

.carousel-container {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px;
  overflow-x: auto; /* Permitir desplazamiento horizontal en móviles */
  -webkit-overflow-scrolling: touch; /* Mejorar desplazamiento en iOS */
  scroll-snap-type: x mandatory; /* Añadir snapping para mejor UX */
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 1rem;
  width: max-content; /* Asegurar que el track sea lo suficientemente ancho */
}

.carousel-item {
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 280px;
  margin: 0 0.75rem;
  scroll-snap-align: center; /* Centrar ítems al hacer scroll */
}

.product-card {
  background: white;
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  text-align: center;
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
  transition: all 0.3s ease;
}

.carousel-control.prev {
  left: 2rem;
}

.carousel-control.next {
  right: 2rem;
}

.carousel-control:hover {
  background: var(--primary-color);
  color: white;
}

/* Sección de características */
#features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.feature {
  text-align: center;
  padding: 2rem;
}

.feature i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Sección de contacto */
#contact {
  background-color: var(--light-bg);
  padding: 5rem 2rem;
}

#contact h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
}

#contact-form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contact-form input,
#contact-form textarea {
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

#contact-form textarea {
  height: 150px;
  resize: vertical;
}

#contact-form button {
  padding: 1rem;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

#contact-form button:hover {
  background-color: var(--secondary-color);
}

/* Pie de página */
footer {
  background-color: rgb(252, 141, 5);
  color: var(--white);
  padding: 4rem 2rem 1rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.social-links {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.social-links a {
  color: var(--white);
  font-size: 3rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Botón flotante de WhatsApp */
.whatsapp-float {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-size: 1.5rem;
  z-index: 1000;
  transition: transform 0.3s, background-color 0.3s;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  background-color: #68a160;
}

.whatsapp-float::after {
  content: "¡Contáctanos por WhatsApp!";
  position: absolute;
  left: -200%;
  transform: translateX(50%);
  background-color: #333;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.whatsapp-float:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Diseño responsivo */

/* Tablets grandes (max-width: 1024px) */
@media (max-width: 1024px) {
  .carousel-item {
    flex: 0 0 25%;
    min-width: 220px;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-content p {
    font-size: 1.1rem;
  }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
  header {
    height: 60px;
  }

  .logo img {
    max-width: 120px;
    margin-top: 75px;
  }

  .hamburger {
    display: block;
    transition: transform 0.3s ease-in-out;
  }

  .hamburger.active {
    transform: rotate(90deg); /* Ejemplo de animación para el botón */
  }

  .nav-links {
    position: fixed;
    margin-top: 60px;
    top: 0;
    border-radius: 4px;
    right: -250px;
    height: 40vh;
    width: 150px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 4rem 1.5rem;
    transition: right 0.4s ease-in-out, opacity 0.3s ease-in-out; /* Transición suave para right y opacity */
    z-index: 1000;
    opacity: 0; /* Inicialmente invisible */
  }

  .nav-links.active {
    right: 0;
    opacity: 1; /* Hacerlo visible */
  }

  .nav-links a {
    color: black;
    font-size: 1.2rem;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .carousel-container {
    padding: 0 10px;
    overflow-x: auto; /* Asegurar desplazamiento en móviles */
    scrollbar-width: none; /* Ocultar barra de desplazamiento en Firefox */
  }

  .carousel-container::-webkit-scrollbar {
    display: none; /* Ocultar barra de desplazamiento en Chrome/Safari */
  }

  .carousel-track {
    transition: none; /* Desactivar transición en móviles para mejor UX */
  }

  .carousel-item {
    flex: 0 0 70%; /* Mostrar más de un ítem pero con espacio */
    min-width: 200px;
    margin: 0 0.5rem;
  }

  .carousel-control {
    display: block; /* Asegurar que los controles sean visibles */
  }

  .carousel-control.prev {
    left: 0.5rem;
  }

  .carousel-control.next {
    right: 0.5rem;
  }
  #features {
    grid-template-columns: 1fr;
  }
}

/* Dispositivos móviles (max-width: 480px) */
@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .cta-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.75rem;
    letter-spacing: 1px;
  }

  .carousel-container {
    padding: 0 5px;
    overflow-x: auto;
  }

  .carousel-item {
    flex: 0 0 85%; /* Ocupar más espacio para mejor visibilidad */
    min-width: 180px;
    margin: 0 0.25rem;
  }

  .product-card {
    padding: 0.3rem;
  }

  .product-card img {
    height: 150px; /* Reducir altura de imágenes para ajustarse mejor */
  }

  .carousel-control {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .carousel-control.prev {
    left: 0.25rem;
  }

  .carousel-control.next {
    right: 0.25rem;
  }
}

.whatsapp-float {
  bottom: 60px;
  right: 15px;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

.whatsapp-float::after {
  font-size: 0.8rem;
  left: -180%;
}
