/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background-color: #f9fafb;
  color: #1e3a8a;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.8rem;
  font-weight: bold;
}

.logo img {
  height: 50px;
  width: auto;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: #1e3a8a;
  font-weight: 500;
  transition: opacity 0.3s;
}

nav a:hover {
  opacity: 0.8;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #1e3a8a;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  background: url('Servicio_tecnico_a_domicilio_rapi_tecnicos.jpg') no-repeat center center;
  background-size: cover;
  min-height: 80vh;
  padding: 8rem 0;
  text-align: left;
  position: relative;
  color: white;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2));
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  width: 100%;
}

.hero-text {
  max-width: 500px;
  margin-right: auto;
}

.hero-text h1 {
  font-size: 2.5rem;
  color: white;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-text .subtitle {
  font-size: 1.5rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-text p {
  font-size: 1.1rem;
  color: #f0f9ff;
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Galería de Servicios (Carrusel) */
.services-gallery {
  background: #f9fafb;
  padding: 5rem 0;
}

.gallery-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.gallery-grid {
  display: flex;
  overflow-x: hidden; /* Oculta el scroll horizontal */
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: nowrap;
  width: max-content; /* Se expande para contener todas las imágenes */
}

.gallery-item {
  flex-shrink: 0;
  width: 250px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 1rem;
  cursor: pointer;
  z-index: 10;
  font-size: 1.5rem;
  border-radius: 50%;
  transition: background-color 0.3s;
  user-select: none;
}

.gallery-nav:hover {
  background: rgba(0,0,0,0.7);
}

.gallery-nav.prev {
  left: 10px;
}

.gallery-nav.next {
  right: 10px;
}

/* Animación de carrusel */
@keyframes carousel-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%); /* Se mueve el 50% del total (la mitad del contenido duplicado) */
  }
}

.carousel-active .gallery-grid {
  animation: carousel-scroll 30s linear infinite; /* 30 segundos de duración */
}

.gallery-wrapper:hover .gallery-grid {
  animation-play-state: paused;
}

/* Secciones comunes */
section {
  padding: 5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  color: #1e3a8a;
  margin-bottom: 1rem;
}

.section-title p {
  font-size: 1.2rem;
  color: #6b7280;
  max-width: 700px;
  margin: 0 auto;
}

/* Servicios */
.services {
  background: white;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: #f9fafb;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.service-icon img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.service-title {
  font-size: 1.4rem;
  color: #1e3a8a;
  margin-bottom: 1rem;
  font-weight: bold;
}

.service-desc {
  color: #4b5563;
  line-height: 1.6;
}

/* Por qué elegirnos */
.why-us {
  background: #eff6ff;
}

.why-us-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  text-align: center;
}

.why-item {
  padding: 2rem;
}

.why-icon {
  background: #1e40af;
  color: white;
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem;
}

.why-title {
  font-size: 1.5rem;
  color: #1e3a8a;
  margin-bottom: 1rem;
  font-weight: bold;
}

.why-desc {
  color: #4b5563;
}

/* Nosotros */
.about {
  background: white;
}

.about-content {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: center;
  justify-content: center;
}

.about-content img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 1rem;
  object-fit: cover;
}

.about-text h2 {
  font-size: 2.5rem;
  color: #1e3a8a;
  margin-bottom: 1.5rem;
}

.about-text p {
  font-size: 1.1rem;
  color: #4b5563;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.mission {
  background: #eff6ff;
  padding: 1.5rem;
  border-radius: 1rem;
  border-left: 4px solid #1e40af;
}

.mission h3 {
  color: #1e3a8a;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

/* Testimonios */
.testimonials {
  background: #f9fafb;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.testimonial-quote {
  font-size: 2.5rem;
  color: #bfdbfe;
  margin-bottom: 0.5rem;
  line-height: 0.5;
}

.testimonial-text {
  font-style: italic;
  color: #4b5563;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.testimonial-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: #dbeafe;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #1e40af;
  font-size: 1.2rem;
}

.user-info h4 {
  font-weight: bold;
  color: #1e3a8a;
}

.user-info p {
  font-size: 0.9rem;
  color: #6b7280;
}

/* Footer */
footer {
  background: #1f2937;
  color: #e5e7eb;
  padding: 3rem 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-column h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: #d1d5db;
  transition: color 0.3s;
}

.footer-column a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #374151;
  color: #9ca3af;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1e40af;
    padding: 1rem 0;
    border-radius: 0.5rem;
  }

  nav.active {
    display: block;
  }

  nav ul {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  nav a {
    color: white;
  }

  .logo {
    order: 1;
  }
  
  .mobile-menu-btn {
    display: block;
    order: 2;
  }

  .hero {
    min-height: 60vh;
    background-position: center bottom;
  }

  .hero-content {
    justify-content: center;
  }

  .hero::before {
    background: rgba(0, 0, 0, 0.6);
  }

  .hero-text {
    text-align: center;
  }

  .hero-text h1 {
    font-size: 1.8rem;
  }

  .about-content img {
    margin: 0 auto;
  }
}