/* Estilos para el botón de WhatsApp */
#whatsapp_button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background-color: rgb(37, 135, 211);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  animation: shake 1s infinite;
  transition: all 0.3s ease;
}

#whatsapp_button img {
  width: 40px;
  height: 40px;  
}

#whatsapp_button:hover {
  background-color: #128C7E;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

@media (max-width: 768px) {
  #whatsapp_button {
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
  }

  #whatsapp_button img {
    width: 35px;
    height: 35px;
  }
}

/* Mejoras de Accesibilidad */
:focus {
  outline: 3px solid #ff6600 !important;
  outline-offset: 2px !important;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Modo alto contraste - activado con JavaScript o preferencias del sistema */
@media (prefers-contrast: more) {
  body {
    color: #000 !important;
    background-color: #fff !important;
  }
  
  a {
    color: #0000EE !important;
    text-decoration: underline !important;
  }
  
  button, 
  .c-btn__link, 
  input[type="submit"] {
    border: 2px solid #000 !important;
  }
}

/* Soporte para prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  #whatsapp_button {
    animation: none !important;
  }
}

/* Estado offline */
body.offline {
  position: relative;
}

body.offline::before {
  content: "Modo sin conexión";
  display: block;
  background-color: #f44336;
  color: white;
  text-align: center;
  padding: 5px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  font-weight: bold;
}

/* Mejoras adicionales de accesibilidad */

/* Mejora de contraste */
body {
  color: #333; /* Texto más oscuro para mejor contraste */
}

/* Enlaces accesibles */
a:focus-visible {
  outline: 3px solid #ff6600 !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
}

/* Formularios accesibles */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 3px solid #ff6600 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.4);
}

/* Labels de formulario más visibles */
label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5em;
  color: #000000;
}

/* Botones con mejor contraste */
.btn-primary, .c-btn__link--primary-dark {
  background-color: #e65c00 !important; /* Naranja más oscuro para contraste */
  color: #ffffff !important;
  font-weight: bold !important;
  padding: 8px 16px !important;
}

/* Botones hover con contraste adecuado */
.btn-primary:hover, .c-btn__link--primary-dark:hover {
  background-color: #cc5200 !important;
  color: #ffffff !important;
}

/* Enfoque visible en carrusel */
.carousel-control-prev:focus,
.carousel-control-next:focus {
  outline: 3px solid #ff6600 !important;
  outline-offset: 5px !important;
}

/* Enfoque para elementos acordeón */
.accordion-header:focus {
  outline: 3px solid #ff6600 !important;
  border-radius: 4px !important;
}

/* Skip link para navegación por teclado */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #ff6600;
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
} 