/* ========================================================
   MIPSA - Custom Animations, Modal & Navigation Styles
   High-performance, pure vanilla CSS (No bloated WP overhead)
   ======================================================== */

/* Animation Keyframes */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 35px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Animation Classes */
.elementor-invisible {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.animated {
  visibility: visible !important;
  opacity: 1 !important;
  animation-duration: 0.85s;
  animation-fill-mode: both;
}

.fadeInUp {
  animation-name: fadeInUp;
}

.fadeIn {
  animation-name: fadeIn;
}

.fadeInRight {
  animation-name: fadeInRight;
}

.fadeInLeft {
  animation-name: fadeInLeft;
}

/* Modal Popup Styles (#modal-diagnostico) */
.mipsa-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 15px;
  box-sizing: border-box;
}

.mipsa-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mipsa-modal-wrapper {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mipsa-modal-overlay.active .mipsa-modal-wrapper {
  transform: scale(1);
}

.mipsa-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: #f1f5f9;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
  color: #334155;
}

.mipsa-modal-close:hover {
  background: #e2e8f0;
  transform: rotate(90deg);
}

.mipsa-modal-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Floating WhatsApp Button */
.mipsa-whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  z-index: 99999;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease;
  text-decoration: none;
}

.mipsa-whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.6);
}

.mipsa-whatsapp-float svg {
  width: 34px;
  height: 34px;
  fill: #ffffff;
}

/* Mobile Navigation Toggle fixes */
@media (max-width: 1024px) {
  .elementor-nav-menu--dropdown {
    display: none;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 15px 0;
  }
  .elementor-nav-menu--dropdown.active {
    display: block !important;
  }
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Process Slider Enhancements */
.swiper-button-next,
.swiper-button-prev {
  color: #044b34 !important;
}

.swiper-pagination-bullet-active {
  background: #044b34 !important;
}

/* Form success message popup */
.mipsa-alert-success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-family: inherit;
  font-size: 14px;
  display: none;
}

/* Mobile Navigation Dropdown Enhancements */
@media (max-width: 1024px) {
  .elementor-menu-toggle {
    display: flex !important;
  }
  .elementor-nav-menu--main {
    display: none !important;
  }
  .elementor-nav-menu--dropdown {
    display: none;
    background: #022319 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45) !important;
    border-radius: 10px !important;
    padding: 15px 0 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
  }
  .elementor-nav-menu--dropdown.elementor-active,
  .elementor-nav-menu--dropdown.active {
    display: block !important;
  }
  .elementor-nav-menu--dropdown .elementor-item {
    color: #ffffff !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 2px !important;
    display: block !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  .elementor-nav-menu--dropdown .elementor-item:hover,
  .elementor-nav-menu--dropdown .elementor-item.elementor-item-active {
    color: #46FEF1 !important;
    background: rgba(255, 255, 255, 0.05) !important;
  }
}

@media (min-width: 1025px) {
  .elementor-menu-toggle {
    display: none !important;
  }
  .elementor-nav-menu--main {
    display: flex !important;
  }
  .elementor-nav-menu--dropdown {
    display: none !important;
  }
}
