/*
  ============================================================
  ARCHIVO    : css/base.css
  DESCRIPCIÓN: Estilos base y globales que aplican a todo el sitio.
               Incluye reset de box-sizing, estilos del body,
               clases reutilizables y la notificación de formulario.
  ============================================================

  SECCIONES:
  1. Reset y configuración base
  2. Tipografía global
  3. Clases de utilidad (reutilizables en todo el HTML)
  4. Botones globales
  5. Formularios globales
  6. Sección-título (compartida entre secciones)
  7. Notificación de formulario enviado
*/


/* ----------------------------------------------------------
  1. RESET Y CONFIGURACIÓN BASE
---------------------------------------------------------- */
html {
  box-sizing: border-box;
  font-size: 62.5%; /* 1rem = 10px para facilitar cálculos */
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--fuente-parrafos);
  font-size: var(--texto-base);
  background-color: var(--color-blanco);
  color: var(--color-oscuro);
  line-height: 1.6;
}


/* ----------------------------------------------------------
  2. TIPOGRAFÍA GLOBAL
---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--fuente-titulos);
  line-height: 1.2;
}

p {
  font-family: var(--fuente-parrafos);
  line-height: 1.7;
}

a {
  font-family: var(--fuente-parrafos);
  text-decoration: none;
  transition: var(--transicion);
}

img {
  max-width: 100%;
  display: block;
}


/* ----------------------------------------------------------
  3. CLASES DE UTILIDAD
  Estas clases se pueden usar en cualquier elemento del HTML.
---------------------------------------------------------- */

/* Contenedor centrado con ancho máximo */
.contenedor {
  margin: 0 auto;
  max-width: var(--ancho-contenedor);
  width: 95%;
}

/* Ocultar visualmente pero accesible para lectores de pantalla */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Títulos de sección compartidos (Servicios, Testimonios, etc.) */
.seccion-titulo {
  text-align: center;
  margin-bottom: 5rem;
}

.seccion-titulo h2 {
  font-size: var(--texto-2xl);
  font-weight: 900;
  color: var(--color-oscuro);
  margin-bottom: 1rem;
}

.seccion-titulo p {
  color: var(--color-gris-txt);
  font-size: var(--texto-md);
  max-width: 600px;
  margin: 0 auto;
}

/* Línea decorativa debajo del título */
.titulo-linea {
  width: 60px;
  height: 4px;
  background-color: var(--color-primario);
  border-radius: 2px;
  margin: 1.5rem auto 0;
}


/* ----------------------------------------------------------
  4. BOTONES GLOBALES
  .btn        → clase base (siempre requerida)
  .btn-primario   → fondo dorado (acción principal)
  .btn-secundario → borde blanco (acción alternativa)
  .btn-form   → botón de envío de formularios
---------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 1.4rem 3.2rem;
  border-radius: var(--radio-pill);
  font-size: var(--texto-base);
  font-weight: 700;
  font-family: var(--fuente-parrafos);
  cursor: pointer;
  border: none;
  transition: var(--transicion);
  text-decoration: none;
}

/* Botón principal dorado */
.btn-primario {
  background-color: var(--color-dorado);
  color: var(--color-oscuro);
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.35);
}

.btn-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245, 166, 35, 0.45);
}

/* Botón secundario con borde blanco */
.btn-secundario {
  background-color: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn-secundario:hover {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Botón de formulario (ancho completo) */
.btn-form {
  width: 100%;
  padding: 1.4rem;
  background-color: var(--color-primario);
  color: #fff;
  border: none;
  border-radius: var(--radio-md);
  font-size: 1.7rem;
  font-weight: 700;
  font-family: var(--fuente-parrafos);
  cursor: pointer;
  transition: var(--transicion);
}

.btn-form:hover {
  background-color: var(--color-medio);
  transform: translateY(-1px);
}


/* ----------------------------------------------------------
  5. FORMULARIOS GLOBALES
  Estilos compartidos por los formularios del hero y contacto.
  Estilos específicos de cada formulario van en sus archivos CSS.
---------------------------------------------------------- */
.form-grupo {
  margin-bottom: 1.5rem;
}

.form-grupo label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: var(--texto-sm);
  font-weight: 500;
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
  width: 100%;
  padding: 1.2rem 1.6rem;
  border: 1.5px solid #e0e4ef;
  border-radius: var(--radio-sm);
  font-size: 1.5rem;
  font-family: var(--fuente-parrafos);
  outline: none;
  transition: border-color 0.2s;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
  border-color: var(--color-primario);
}

.form-grupo textarea {
  resize: none;
}


/* ----------------------------------------------------------
  6. NOTIFICACIÓN DE FORMULARIO ENVIADO
  Aparece en la esquina inferior derecha al enviar un formulario.
  Se activa con la clase .visible desde js/app.js
---------------------------------------------------------- */
.notificacion {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  background: #fff;
  border-radius: var(--radio-md);
  padding: 1.8rem 2.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border-left: 4px solid #22c55e;
  z-index: 9999;
  font-size: 1.5rem;
  color: var(--color-oscuro);
  font-weight: 600;
  display: none;             /* oculta por defecto */
  align-items: center;
  gap: 1rem;
}

.notificacion i {
  color: #22c55e;
  font-size: 2rem;
}

/* Clase .visible la agrega js/app.js al enviar formulario */
.notificacion.visible {
  display: flex;
  animation: deslizarEntrada 0.4s ease;
}

@keyframes deslizarEntrada {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


/* ----------------------------------------------------------
  BOTÓN FLOTANTE DE WHATSAPP
  Aparece fijo en la esquina inferior izquierda.
  El número se configura en el href del HTML (index.html).
  Para cambiar la posición, editar bottom/left/right.
  El tooltip aparece al hacer hover sobre el botón.
---------------------------------------------------------- */
.whatsapp-flotante {
  position: fixed;
  bottom: 2.8rem;
  right: 2.8rem;
  z-index: 9998;
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 1.2rem;
  text-decoration: none;
}

/* Círculo verde con ícono de WhatsApp */
.whatsapp-flotante .whatsapp-btn {
  width: 6rem;
  height: 6rem;
  background-color: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  position: relative;
}

.whatsapp-flotante .whatsapp-btn i {
  font-size: 3rem;
  color: #fff;
}

/* Pulso animado alrededor del botón */
.whatsapp-flotante .whatsapp-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(37, 211, 102, 0.5);
  animation: pulsarWhatsapp 2s ease-out infinite;
}

@keyframes pulsarWhatsapp {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Hover del botón */
.whatsapp-flotante:hover .whatsapp-btn {
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(37, 211, 102, 0.6);
}

/* Tooltip con texto "¡Escríbenos!" */
.whatsapp-flotante .whatsapp-tooltip {
  background-color: #fff;
  color: #111;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0.8rem 1.4rem;
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.whatsapp-flotante .whatsapp-tooltip span {
  display: block;
  font-size: 1.2rem;
  font-weight: 400;
  color: #25d366;
}

/* Mostrar tooltip al hacer hover */
.whatsapp-flotante:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Responsive: botón un poco más pequeño en móvil */
@media (max-width: 600px) {
  .whatsapp-flotante {
    bottom: 2rem;
    right: 2rem;
  }

  .whatsapp-flotante .whatsapp-btn {
    width: 5.2rem;
    height: 5.2rem;
  }

  .whatsapp-flotante .whatsapp-btn i {
    font-size: 2.6rem;
  }

  /* Ocultar tooltip en móvil para no invadir pantalla */
  .whatsapp-flotante .whatsapp-tooltip {
    display: none;
  }
}
