/* ===== VARIABLES DE COLOR (fácil de ajustar) ===== */
:root {
  --bg-primary: #1a2e2e;
  --bg-secondary: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #ddd8d8;
  --accent: #eda35d;
  --card-bg: #224156;
  --border-color: #333;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: var(--accent);
}

/* ===== FUENTE DE GOOGLE ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* ===== HEADER ===== */
header {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo {
  height: 65px;
  width: auto;
  border-radius: 30%;
  display: block;
}

.logo:hover {
  transform: rotate(360deg);
}

.rotating-logo {
  animation: rotateLogo 20s linear infinite;
  will-change: transform;
}

@keyframes rotateLogo {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  background: linear-gradient(to right, #fff, #ccc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitulo {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== SELECTOR DE IDIOMA (ícono + dropdown) ===== */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
  font-size: 14px;
}

.lang-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-icon {
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .lang-text {
    display: none;
  }
  .lang-icon {
    font-size: 1.2rem;
  }
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  font-size: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  list-style: none;
  padding: 8px 0;
  margin: 8px 0 0;
  min-width: 140px;
  z-index: 1000;
  display: none;
  color: var(--text-primary);
}

.lang-dropdown.show {
  display: block;
}

.lang-dropdown a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.lang-dropdown a:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

/* ===== SERVICIOS ===== */
.servicios {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.8rem;
  padding: 10px;
  max-width: 90%;
  margin: 0 auto 3rem;
}

@media (min-width: 768px) {
  .servicios {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .servicios {
    grid-template-columns: repeat(4, 1fr);
  }
}

.servicio {
  position: relative;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.8rem 1.2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.servicio:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.servicio-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.15;
}

.servicio-contenido {
  position: relative;
  z-index: 2;
  padding: 5px;
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  backdrop-filter: blur(2px);
}

.icono {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  display: block;
}

.servicio h2 {
  font-size: 1.3rem;
  margin: 0.8rem 0;
  color: var(--text-primary);
}

.servicio p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.btn {
  display: inline-block;
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
}

.btn:hover {
  background: var(--accent);
  color: #000;
}

/* ===== FOOTER ===== */
footer {
  background-color: var(--card-bg);
  padding: 1rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-info,
.legal-section,
.qr-section {
  flex: 1;
  min-width: 220px;
}

.legal-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-align: center;
}

.legal-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.legal-section li {
  margin: 0;
  width: 100%;
  max-width: 220px;
}

.footer-link,
.modal-trigger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  transition: color 0.2s;
  justify-content: center;
  cursor: pointer;
  width: 100%;
  max-width: 220px;
  text-align: center;
  text-decoration: none;
}

.footer-link:hover,
.modal-trigger:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* QR */
.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 120px;
  gap: 0.6rem;
}

.footer-qr {
  width: 110px;
  height: auto;
  border: 1px solid #ddd;
  padding: 6px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.qr-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 1.8rem;
    text-align: center;
  }

  .footer-info,
  .legal-section,
  .qr-section {
    width: 100%;
    align-items: center;
  }

  .footer-info p,
  .footer-info {
    text-align: center;
  }

  .legal-section ul {
    align-items: center;
  }

  .legal-section li {
    width: auto;
  }
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.modal-content {
  position: relative;
  margin: 5% auto;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem 1.5rem;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.8rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #000;
}

#pdf-iframe {
  flex: 1;
  width: 100%;
  border: none;
}

#html-content {
  color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-align: justify;
}

#html-content p {
  margin: 0 0 1rem 0;
}

#html-content h2 {
  font-size: 1.5rem;
  margin-top: 0;
  margin-bottom: 1.2rem;
  color: #1a1a1a;
  text-align: center;
}


/*  ===============  whatsap y contactos ===========*/
/* ===== CONTACTO RÁPIDO: QR + WHATSAPP ===== */
.contact-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 300px;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.contact-icon {
  width: 110px;
  height: auto;
  border: none;
  padding: 6px;
  background: transparent;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: block;
  text-align: center;
}

.contact-icon img {
  width: 100%;
  height: auto;
  display: block;
}

.contact-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

/* Asegurar que el enlace de WhatsApp no herede estilos no deseados */
.contact-item a {
  color: inherit;
  text-decoration: none;
}

.contact-item a:hover {
  opacity: 0.9;
}

/* Animación tipo veleta / indicador de viento */
@keyframes windVane {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(12deg); }   /* inclinación derecha */
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(-12deg); }  /* inclinación izquierda */
  100% { transform: rotate(0deg); }
}

/* Aplicar al ícono de WhatsApp */
.whatsapp-icon img,
.whatsapp-icon svg,
.whatsapp-icon i {
  animation: windVane 3s ease-in-out infinite;
  transform-origin: bottom center; /* pivota desde la base (como una veleta) */
  will-change: transform;
}

/* ===== CORRECCIÓN PARA PDF EN DISPOSITIVOS MÓVILES ===== */
@media (max-width: 768px) {
  .modal-content {
    width: 95vw; /* usa vw para evitar desbordamiento */
    height: 90vh;
    padding: 1.2rem 1rem 1rem;
    max-width: 100%; /* asegura que no sobrepase el viewport */
  }

  #pdf-iframe {
    width: 100% !important;
    height: calc(100% - 20px) !important; /* espacio para el botón de cerrar o padding */
    min-height: 70vh;
    border: none;
    overflow: hidden;
  }

  /* Fuerza que el contenedor no permita scroll horizontal */
  .modal-content,
  #pdf-iframe {
    overflow-x: hidden !important;
  }

  /* Si usas Google Docs viewer o similar, esto ayuda */
  #pdf-iframe {
    transform: scale(1);
    transform-origin: top left;
  }
}
/* ===== FIN ===== */