/* ==========================================================================
   Variables de Marca (Inmedi-k)
   ========================================================================== */
:root {
  --primary-color: #8125d0;      /* Morado Medio */
  --secondary-color: #4c157a;    /* Morado Oscuro */
  --accent-color: #f2f2f2;       /* Gris Claro */
  
  --text-dark: #333333;
  --text-muted: #8b8b8b;         /* Gris Medio */
}

/* ==========================================================================
   Estilos Generales
   ========================================================================== */
html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-dark);
  background-color: #ffffff;
  padding-top: 85px; /* Altura aproximada de la navbar fija */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--secondary-color);
}

/* Tipografía de utilidad (Grosor variable según brief) */
.fw-semibold { font-weight: 600 !important; }
.fw-extrabold { font-weight: 800 !important; }
.ls-tight { letter-spacing: -0.03em; }

/* ==========================================================================
   Utilidades de Color
   ========================================================================== */
.text-primary-custom { color: var(--primary-color) !important; }
.text-secondary-custom { color: var(--secondary-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; color: #fff; }
.bg-secondary-custom { background-color: var(--secondary-color) !important; color: #fff; }
.bg-accent-custom { background-color: var(--accent-color) !important; }

/* ==========================================================================
   Botones Personalizados (Bordes Completamente Redondeados .rounded-pill)
   ========================================================================== */
.btn-primary-custom {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: all 0.3s ease;
}

.btn-primary-custom:hover, 
.btn-primary-custom:focus {
  background-color: #6b1db3; /* Morado medio oscurecido para hover */
  border-color: #6b1db3;
  color: #fff;
  box-shadow: 0 4px 6px rgba(129, 37, 208, 0.3);
}

.btn-white-custom {
  background-color: #fff;
  border-color: #fff;
  color: var(--secondary-color);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1rem, 2.2vw, 2.5rem);
  padding: 1vw 4vw;
  border-radius: clamp(12px, 1.2vw, 20px) !important;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-white-custom:hover, 
.btn-white-custom:focus {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--secondary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary-custom {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: all 0.3s ease;
}

.btn-secondary-custom:hover, 
.btn-secondary-custom:focus {
  background-color: #3a0f5e;
  border-color: #3a0f5e;
  color: #fff;
}

.btn-whatsapp {
  background-color: #25D366;
  border-color: #25D366;
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
  background-color: #128C7E;
  border-color: #128C7E;
  color: #fff;
  box-shadow: 0 4px 6px rgba(37, 211, 102, 0.3);
}

/* ==========================================================================
   Componentes Específicos
   ========================================================================== */
/* Navbar */
.navbar {
  transition: background-color 0.3s ease;
}
.navbar-brand {
  letter-spacing: -0.5px;
}

/* Hero Section */
.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  /* El background URL se ajusta por HTML o en una clase específica posterior */
  background-color: var(--secondary-color);
  color: #fff;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(76, 21, 122, 0.85); /* Overlay morado oscuro sobre imagen */
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Tarjetas Interactivas Flip-Card (Hover para revelar servicios)
   ========================================================================== */
.flip-card {
  perspective: 1000px;
  height: 320px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

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

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

/* Cara Frontal: Morado medio + ícono + título */
.flip-card-front {
  background-color: #8125d0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 12px rgba(76, 21, 122, 0.15);
}

.flip-card-front .card-icon {
  font-size: 3rem;
  color: #f2f2f2;
  opacity: 0.7;
  margin-bottom: auto;
  margin-top: auto;
}

.flip-card-front .card-label {
  background-color: var(--secondary-color);
  color: #fff;
  width: 100%;
  padding: 1rem 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}

/* Cara Trasera: Lista de servicios */
.flip-card-back {
  background-color: #ffffff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 2px solid var(--primary-color);
}

.flip-card-back h4 {
  font-size: 1.1rem;
  color: var(--secondary-color);
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.flip-card-back ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flip-card-back ul li {
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-dark);
}

/* Ajustes responsivos para evitar que las tarjetas se deformen en pantallas pequeñas */
@media (max-width: 768px) {
  .flip-card {
    height: 350px; /* Un poco más alta en mobile para listas largas */
  }
}

/* ==========================================================================
   Sucursales Interactivas y Optimización Móvil
   ========================================================================== */
.branch-item {
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 1.5rem;
  margin: -1rem -1rem 1rem -1rem; /* Ajuste para hover padding */
  border-radius: 12px;
}

.branch-item:hover {
  background-color: var(--accent-color);
  transform: translateX(5px);
}

.branch-item.active {
  background-color: #f0e6ff; /* Morado muy claro para resaltar */
  border-left: 4px solid var(--primary-color);
  box-shadow: 0 4px 12px rgba(129, 37, 208, 0.1);
}

.branch-item h4 {
  transition: color 0.3s ease;
}

.branch-item:hover h4, 
.branch-item.active h4 {
  color: var(--secondary-color) !important;
}

/* Link invisible sobre el mapa para móviles */
.mobile-map-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}

@media (max-width: 430px) {
  /* Ocultar la columna de la lista de sucursales */
  #sucursales .col-lg-5 {
    display: none !important;
  }
  
  /* Asegurar que el mapa ocupe el ancho completo */
  #sucursales .col-lg-7 {
    width: 100%;
  }

  /* Activar el link sobre el mapa */
  .mobile-map-overlay {
    display: block;
  }
}

/* ==========================================================================
   Botón Flotante de WhatsApp
   ========================================================================== */
.whatsapp-float {
  display: none; /* Oculto por defecto */
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 30px;
  left: 30px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 3px #999;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
  background-color: #128c7e;
  color: #fff;
  transform: scale(1.1);
}

@media (max-width: 430px) {
  /* ... previos estilos móviles ... */
  
  .whatsapp-float {
    display: flex; /* Mostrar solo en <= 430px */
  }
}

@keyframes pulse-whatsapp {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}
