/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  color: #fff;
  line-height: 1.6;
  padding-top: 80px;
  min-height: 100vh;

  background-image: url("imagenes/imagen_optimizada.jpg");
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-position: center center;
  background-size: cover;
  background-color: #fff; /* fondo blanco por defecto */
}

/* Desktop: fondo fijo y cover */
@media (min-width: 1024px) {
  body {
    background-attachment: fixed;
  }
}

/* Tablet: imagen específica para tablet */
@media (max-width: 1023px) and (min-width: 671px) {
  body {
    background-image: url("imagenes/1023c.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: scroll;
    background-color: #fff; /* fondo blanco para evitar franjas grises */
  }
}

/* Móvil: imagen específica para mobile */
@media (max-width: 670px) {
  body {
    background-image: url("imagenes/670b.jpg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: scroll;
    background-color: #fff; /* fondo blanco para evitar franjas grises */
  }
}



/* Header translúcido con blur */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* fondo negro translúcido */
  backdrop-filter: blur(10px);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  flex-wrap: wrap;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

header h1 img {
  height: 100px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav ul li a:hover {
  text-decoration: underline;
}

/* Banner */
.banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* SECCIÓN CONTACTO - CORREGIDO Y OPTIMIZADO */
.contacto {
  background-color: rgba(0, 0, 0, 0.25);
  color: white;
  padding: 6rem 2rem 4rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Ajustes para pantallas chicas */
@media (max-width: 768px) {
  .contacto {
    flex-direction: column;
    padding: 5rem 1rem 2rem 1rem;
    min-height: auto; /* permite ajustar altura en móviles */
    align-items: center;
  }
}

/* Ajuste para pantallas medianas-altas (como iPad Pro) */
@media (min-width: 768px) and (max-width: 1200px) and (min-height: 1000px) {
  .contacto {
    align-items: center;         /* centra verticalmente */
    padding-top: 8rem;
    padding-bottom: 2rem;        /* evita espacio excesivo abajo */
  }
}
/* Texto a la izquierda */
.info-contacto {
  flex: 1 1 40%;      /* Menor ancho para más margen */
  max-width: 480px;   /* Limita ancho máximo */
  margin: 0 auto;     /* Centrar dentro de su flex item */
}

/* Formulario a la derecha */
.formulario {
  flex: 1 1 40%;      /* Menor ancho para más margen */
  max-width: 480px;   /* Limita ancho máximo */
  margin: 0 auto;     /* Centrar dentro de su flex item */
}

.formulario form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.formulario input,
.formulario textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.formulario button {
  align-self: flex-end;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  cursor: pointer;
}

/* Contenedor centrado reutilizable */
.contenedor-centrado {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem; /* margen lateral adaptable */
}

/* Secciones que no deben estar sobre la imagen */
.nosotros {
  background-color: white;
  color: #5e5e5e;
  padding: 4rem 0;
}

#especialidades {
  background-color: #bbb2a2;
  color: #5e5e5e;
  padding: 4rem 0;
}

.persona {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center; /* centra horizontalmente */
  gap: 4rem;
  margin: 0 auto 3rem auto;
  max-width: 1000px;
  padding: 0 1rem;
  flex-wrap: wrap; /* permite adaptarse en pantallas chicas */
}

.persona img {
  position: relative;
  width: 150px;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: transparent;
  display: block;
  z-index: 2;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;

  /* Clip para forma ovalada más suave */
  clip-path: ellipse(75% 85% at 50% 50%);
  -webkit-clip-path: ellipse(75% 85% at 50% 50%);

  /* Sombra oscura inicial con drop-shadow */
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Pseudo-elemento para difuminar bordes suavemente */
.persona img::before {
  content: "";
  position: absolute;
  top: -12px;
  left: -12px;
  width: 174px;
  height: 224px;

  /* Mismo clip para que el halo siga la forma */
  clip-path: ellipse(75% 85% at 50% 50%);
  -webkit-clip-path: ellipse(75% 85% at 50% 50%);

  background: rgba(0, 0, 0, 0.12);
  filter: blur(18px);
  z-index: 1;
  pointer-events: none;
  transition: background 0.3s ease, filter 0.3s ease;
}

.persona img:hover {
  transform: scale(1.08);
  /* sombra más oscura e intensa al hover */
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.9));
}

/* También intensificamos el difuminado al hacer hover */
.persona img:hover::before {
  background: rgba(0, 0, 0, 0.18);
  filter: blur(22px);
}

.persona .texto {
  max-width: 600px;
  flex-grow: 1; /* aprovecha el espacio restante */
}

#especialidades {
  background-color: #bbb2a2;
  padding: 4rem 2rem;
  color: #5e5e5e;
}

/* Footer */
footer {
  background-color: #8e7f64;
  color: white;
  text-align: center;
  padding: 2rem;
}

footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

footer ul li a {
  color: white;
  text-decoration: none;
}

footer ul li a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .persona {
    flex-direction: column;
    text-align: center;
  }

  nav ul {
    justify-content: center;
  }

  header {
    gap: 1rem;
  }

  /* Aquí está la corrección para que los íconos queden en fila */
  footer ul {
    flex-direction: row;  /* Fuerza fila en móviles */
    gap: 1rem;            /* Espaciado cómodo */
  }

  /* Ajustes para .contacto en móvil */
  .contacto {
    flex-direction: column;
    padding: 4rem 1.5rem 3rem 1.5rem;
    min-height: auto; /* deja que crezca con contenido */
  }

  .info-contacto,
  .formulario {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}

.contacto h2 {
  font-size: 2.2rem;      /* Tamaño grande para el h2 */
  font-weight: 700;       /* Negrita */
  margin-bottom: 1rem;    /* Espacio debajo */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Tipografía */
}

.contacto h3 {
  font-size: 1.8rem;      /* Tamaño grande para el h3 */
  font-weight: 600;       /* Semi-negrita */
  margin-bottom: 1rem;    /* Espacio debajo */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Tipografía */
}

/* Botones flotantes */
.botones-flotantes {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 999;
}

.btn-wsp,
.btn-subir {
  background-color: #25D366;
  color: white;
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  border-radius: 70%;
  border: none;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease;
}

.btn-subir {
  background-color: #333; /* Botón "subir" en gris oscuro */
}

.btn-wsp:hover {
  background-color: #1ebe5b;
}

.btn-subir:hover {
  background-color: #555;
}

#especialidades {
  background-color: #bbb2a2;
  color: #5e5e5e;
  padding: 6rem 2rem; /* más espacio arriba y abajo */
  text-align: center;
}

#especialidades h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
  font-family: 'Segoe UI', sans-serif;
}

#especialidades ul {
  list-style: none;
  padding: 0;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.2rem;
  line-height: 1.8;
}

#especialidades ul li {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Animación inicial (oculto y desplazado) */
.especialidad-item {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Cuando entra en pantalla */
.especialidad-visible {
  opacity: 1;
  transform: translateY(0);
}

.titulo-nosotros {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  color: #5e5e5e;
  font-family: 'Segoe UI', sans-serif;
}

.descripcion-nosotros {
  font-size: 1.2rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto 3rem auto;
  line-height: 1.8;
  color: #5e5e5e;
  padding: 0 2rem;
  margin-bottom: 5rem;
}

@media (max-width: 1024px) {
  .contenedor-centrado {
    padding: 0 1rem;
  }

  .persona {
    gap: 2rem;
    padding: 0;
  }

  #especialidades ul {
    padding: 0 1rem;
  }
}

@media (max-width: 768px) {
  header {
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .persona {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .persona img {
    width: 120px;
    height: 160px;
  }

  .persona .texto {
    max-width: 100%;
    padding: 0 1rem;
  }

  .descripcion-nosotros {
    padding: 0 1rem;
    font-size: 1.1rem;
  }

  #especialidades h2 {
    font-size: 2rem;
  }

  #especialidades ul {
    font-size: 1rem;
  }

  /* El footer con los íconos siempre en fila */
  footer ul {
    flex-direction: row;
    gap: 1rem;
  }

  .botones-flotantes {
    right: 10px;
    bottom: 10px;
  }

  .btn-wsp,
  .btn-subir {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    line-height: 45px;
  }
}

@media (max-width: 480px) {
  header h1 img {
    height: 70px;
  }

  .titulo-nosotros {
    font-size: 2rem;
  }

  .descripcion-nosotros {
    font-size: 1rem;
  }

  #especialidades h2 {
    font-size: 1.8rem;
  }

  #especialidades ul li {
    font-size: 0.95rem;
  }

  .formulario input,
  .formulario textarea {
    font-size: 0.95rem;
  }

  .formulario button {
    font-size: 0.95rem;
  }
}

@media (max-width: 1200px) {
  .info-contacto h3,
  .info-contacto p {
    display: none;
  }
}

@media (max-width: 1200px) {
  .info-contacto {
    display: none;
  }

  .formulario {
    flex: 1 1 480px; /* que tome hasta 480px como base, y pueda crecer/shrink */
    max-width: 480px; /* límite máximo */
    margin-left: auto;
    margin-right: auto; /* centrado horizontal */
  }
}

/* Por defecto, ocultamos el botón hamburguesa */
.btn-hamburguesa {
  display: none;
  font-size: 2.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  z-index: 1100; /* por encima del header */
}

/* Header fijo con logo a la izquierda y botón hamburguesa a la derecha */
header {
  display: flex;
  justify-content: space-between; /* logo a la izquierda, botón a la derecha */
  align-items: center;
  padding: 1rem 2rem;
  flex-wrap: nowrap;  /* evita salto de línea */
  position: fixed;
  top: 0; left: 0; width: 100%;
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  color: white;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

header h1 {
  margin: 0;
}

/* Menú nav visible solo >1200px */
nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Estilos para pantallas <= 1200px */
@media (max-width: 1200px) {
  /* Botón hamburguesa visible */
  .btn-hamburguesa {
    display: block;
  }

  /* Menú oculto por defecto */
  nav ul {
    display: none;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.9);
    position: fixed;
    top: 80px; /* debajo del header */
    right: 20px;
    width: auto;
    min-width: 200px;
    max-width: 280px;
    height: auto; /* <-- esta línea es clave */
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 1200;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* Cuando está abierto (usando clase .open) */
  nav ul.open {
    display: flex;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }

  nav ul li {
    margin-bottom: 1rem;
  }

  nav ul li:last-child {
    margin-bottom: 0;
  }

  nav ul li a {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.3s ease;
  }

  nav ul li a:hover {
    color: #ddd;
  }
}

.redes-sociales {
  list-style: none;
  display: flex;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

.redes-sociales li {
  display: inline-block;
}

.icono-red-social {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: filter 0.3s ease;
}

.icono-red-social:hover {
  filter: brightness(0.8);
  cursor: pointer;
}

@media (min-width: 1200px) {
  .contacto {
    padding-top: 10rem; /* antes tenías 6rem, ahora más espacio arriba */
  }
}