/* Estilos generales */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  height: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  min-height: 100%;
  position: relative;
  scroll-behavior: smooth;
}

main {
  overflow: visible;
  position: relative;
  margin-bottom: 4rem;
}

/* Navbar */
.navbar {
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  width: 100%;
  z-index: 9999;
  top: 0;
  left: 0;
  height: 80px;
  display: flex;
  align-items: center;
}

.navbar-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

@media (max-width: 768px) {
  .navbar-container {
    padding: 0 1rem;
  }
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: bold;
  color: #8B1538;
  display: flex;
  align-items: center;
  height: 50px;
  flex-shrink: 0;
}

.navbar-brand img {
  max-height: 60px;
  width: auto;
}

@media (max-width: 768px) {
  .navbar-brand {
    height: 40px;
  }
  
  .navbar-brand img {
    max-height: 50px;
  }
}

.navbar-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

/* Menú hamburguesa para móviles */
.navbar-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.navbar-toggle span {
  width: 25px;
  height: 3px;
  background-color: #8B1538;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
  display: block;
}

.navbar-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

.nav-link {
  color: #8B1538;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  position: relative;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link:hover {
  color: #DC2626;
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #DC2626;
  bottom: 0;
  left: 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #8B1538 0%, #DC2626 100%);
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  padding-top: 5rem;
}

/* Hero Section Compact - Para páginas internas */
.hero-section-compact {
  background: linear-gradient(135deg, #8B1538 0%, #DC2626 100%);
  color: white;
  padding: 4rem 0 3rem;
  margin-top: 80px;
}

/* Secciones comunes */
.section {
  padding: 2rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 5vw, 3.5rem); /* tamaño fluido */
  font-weight: 900;
  text-align: center;
  margin: 1rem 0 3rem;
  color: #8B1538;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Ajuste del espacio superior para el contenido principal */
.main-content {
  padding-top: 4rem;
}

/* Servicios Circulares */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columnas en desktop */
  gap: 1.5rem; /* más compacto */
  max-width: 1000px; /* más centrado */
  margin: 0 auto;
  padding: 2rem;
}

.service-row-offset {
  grid-column: 2 / span 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Tarjetas circulares */
.flip-card {
  perspective: 1000px;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.flip-card-front {
  background: linear-gradient(135deg, #8B1538 0%, #DC2626 100%);
  color: white;
}

.flip-card-front i {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.flip-card-back {
  background: linear-gradient(135deg, #8B1538 0%, #DC2626 100%);
  color: white;
  transform: rotateY(180deg);
}

.flip-card-back h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.flip-card-back p {
  font-size: 0.875rem;
  line-height: 1.2;
}

/* Formulario de contacto */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #8B1538;
  box-shadow: 0 0 0 2px rgba(139, 21, 56, 0.2);
}

/* Botones */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #8B1538 0%, #DC2626 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #7A1230 0%, #B91C1C 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.3);
}

.btn-white {
  background-color: white;
  color: #8B1538;
  border: 2px solid #8B1538;
}

.btn-white:hover {
  background-color: #8B1538;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 21, 56, 0.3);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #8B1538 0%, #DC2626 100%);
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
}

/* Utilidades */
.pt-24 {
  padding-top: 6rem;
}

/* Timeline Styles */
.timeline-item {
  position: relative;
}

.timeline-circle {
  position: relative;
  z-index: 10;
}


/* Responsive */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .service-row-offset {
    grid-column: 1 / span 2;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .service-row-offset {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
  
  .flip-card {
    width: 180px;
    height: 180px;
  }

  /* Timeline responsive */
  .timeline-mobile {
    flex-direction: column !important;
  }
  
  .timeline-mobile .w-1\/2 {
    width: 100% !important;
    padding: 0 !important;
    text-align: center !important;
  }
  
  .timeline-mobile .w-16 {
    margin: 1rem auto !important;
  }
  
  .timeline-mobile .absolute {
    display: none;
  }

  /* Navegación responsive */
  .navbar-toggle {
    display: flex;
  }
  
  .navbar-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: white;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 2rem 0;
    transition: left 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    gap: 0;
  }
  
  .navbar-links.active {
    left: 0;
  }
  
  .nav-link {
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    display: block;
    color: #8B1538;
    text-decoration: none;
    transition: background-color 0.3s ease;
  }
  
  .nav-link:hover {
    background-color: #f8f9fa;
    color: #DC2626;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
}

/* Ajustes para el carrusel Swiper fotos */
.swiper-container {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
  overflow: hidden;
}

.swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  height: auto;
  padding: 0 10px;
}

.swiper-slide img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.swiper-slide img:hover {
  transform: scale(1.05);
}

/* Ajustes para el carrusel Swiper aseguradoras */
.aseguradoras-swiper {
  overflow: hidden;
  margin: 0 auto;
}

.aseguradoras-swiper .swiper-wrapper {
  align-items: center;
}

.aseguradoras-swiper .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 120px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 15px;
}

.aseguradoras-swiper .swiper-slide:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.aseguradoras-swiper img {
  max-height: 70px;
  max-width: 100%;
  object-fit: contain;
  filter: grayscale(40%);
  transition: transform 0.3s, filter 0.3s;
}

.aseguradoras-swiper img:hover {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.logo-aseguradora {
  transition: transform 0.3s ease, filter 0.3s ease;
}
.logo-aseguradora:hover {
  transform: scale(1.1);
}

.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 20px;
  right: 20px;
  background-color: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.whatsapp-float img {
  width: 35px;
  height: 35px;
}

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


/* Responsive para el carrusel */
@media (max-width: 480px) {
  .swiper-container {
    padding: 10px 0;
  }
  
  .swiper-slide {
    padding: 0 3px;
  }
  
  .swiper-slide img {
    max-height: 200px;
    border-radius: 8px;
  }
  
  .swiper-button-next,
  .swiper-button-prev {
    display: none;
  }
  
  .swiper-pagination {
    bottom: 5px;
  }
}

@media (max-width: 640px) {
  .swiper-container {
    padding: 15px 0;
  }
  
  .swiper-slide {
    padding: 0 5px;
  }
  
  .swiper-slide img {
    max-height: 250px;
  }
  
  .swiper-button-next,
  .swiper-button-prev {
    display: none;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .swiper-slide img {
    max-height: 300px;
  }
  
  .swiper-button-next,
  .swiper-button-prev {
    width: 40px;
    height: 40px;
  }
  
  .swiper-button-next:after,
  .swiper-button-prev:after {
    font-size: 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .swiper-slide img {
    max-height: 350px;
  }
}

@media (min-width: 1025px) {
  .swiper-slide img {
    max-height: 400px;
  }
}

/* Responsive específico para carrusel de aseguradoras */
@media (max-width: 480px) {
  .aseguradoras-swiper .swiper-slide {
    height: 100px;
    padding: 10px;
  }
  
  .aseguradoras-swiper img {
    max-height: 50px;
  }
}

@media (min-width: 481px) and (max-width: 640px) {
  .aseguradoras-swiper .swiper-slide {
    height: 110px;
    padding: 12px;
  }
  
  .aseguradoras-swiper img {
    max-height: 60px;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .aseguradoras-swiper .swiper-slide {
    height: 120px;
    padding: 15px;
  }
  
  .aseguradoras-swiper img {
    max-height: 70px;
  }
}

@media (min-width: 769px) {
  .aseguradoras-swiper .swiper-slide {
    height: 120px;
    padding: 15px;
  }
  
  .aseguradoras-swiper img {
    max-height: 70px;
  }
}

/* Botones de navegación del carrusel */
.swiper-button-next,
.swiper-button-prev {
  color: #8B1538;
  background: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 20px;
}

/* Indicadores de paginación */
.swiper-pagination-bullet {
  background: #8B1538;
  opacity: 0.5;
}

.swiper-pagination-bullet-active {
  background: #DC2626;
  opacity: 1;
}


/* Animaciones */
[data-aos] {
  pointer-events: none;
}

[data-aos].aos-animate {
  pointer-events: auto;
}
