/* Mobile UX Improvements - Bottom nav + floating CTA buttons */

/* ----------------------------------------------------------------------
   Scroll margin for anchored sections - clear fixed navbar
   ---------------------------------------------------------------------- */
#services,
#doctors,
#contact {
  scroll-margin-top: 5rem;
}

/* ----------------------------------------------------------------------
   Floating CTA buttons: Call + WhatsApp (visible on ALL breakpoints)
   ---------------------------------------------------------------------- */
.float-cta-buttons {
  position: fixed;
  bottom: 24px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9998;
}

.float-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.float-cta-btn:hover,
.float-cta-btn:focus {
  transform: scale(1.05);
}

.float-cta-call {
  background-color: #0d1b4c;
  color: white;
}

.float-cta-call:hover,
.float-cta-call:focus {
  box-shadow: 0 6px 16px rgba(13, 27, 76, 0.5);
}

.float-cta-whatsapp {
  background-color: #25D366;
  color: white;
}

.float-cta-whatsapp:hover,
.float-cta-whatsapp:focus {
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.float-cta-btn svg {
  width: 28px;
  height: 28px;
}

.float-cta-whatsapp svg {
  fill: currentColor;
}

/* ----------------------------------------------------------------------
   Bottom navigation bar
   ---------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
}

@media screen and (max-width: 991px) {
  /* --vh set by JS (Visual Viewport API) fixes iOS address bar resize */
  html {
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: calc(var(--vh, 1vh) * 100);
    -webkit-text-size-adjust: 100%;
  }

  body {
    min-height: 100%;
    min-height: -webkit-fill-available;
    min-height: 100svh;
    min-height: calc(var(--vh, 1vh) * 100);
  }

  /* iOS Safari: fixed bottom nav - use inset for reliable positioning */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 64px;
    background: #0d1b4c;
    align-items: center;
    justify-content: space-around;
    z-index: 9999;
    padding-top: 10px;
    padding-bottom: calc(10px + constant(safe-area-inset-bottom, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-bottom-nav::after {
    content: "";
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background: #0d1b4c;
    pointer-events: none;
    z-index: -1;
  }

  .mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 4px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.2s;
    min-height: 0;
  }

  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav a:focus {
    color: white;
  }

  .mobile-bottom-nav a.active {
    color: #ffcf42;
  }

  .mobile-bottom-nav a svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .mobile-bottom-nav a.active svg {
    stroke: #ffcf42;
  }

  /* Add bottom padding to main content so it's not hidden behind the nav */
  .main-wrapper {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ----------------------------------------------------------------------
   Hide top nav hamburger on mobile (nav moves to bottom bar)
   ---------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
  .navbar2_menu-button,
  .navbar2_menu {
    display: none !important;
  }

  .navbar2_container {
    justify-content: flex-start;
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------------
   Typography fixes - readable font sizes on mobile
   ---------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
  .text-size-medium {
    font-size: 1rem !important;
  }

  .text-size-regular {
    font-size: 1rem !important;
  }
}

@media screen and (max-width: 767px) {
  .text-size-small {
    font-size: 0.875rem !important;
  }

  .text-size-tiny {
    font-size: 0.75rem !important;
  }
}

@media screen and (max-width: 479px) {
  .text-size-regular {
    font-size: 1rem !important;
  }

  .text-size-small {
    font-size: 0.875rem !important;
  }

  .text-size-tiny {
    font-size: 0.75rem !important;
  }
}

/* ----------------------------------------------------------------------
   Section spacing - prevent cramped sections on mobile
   ---------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  .padding-section-small {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .padding-section-medium {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .padding-section-large {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media screen and (max-width: 479px) {
  .padding-section-small {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .padding-section-medium {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .padding-section-large {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

/* ----------------------------------------------------------------------
   Horizontal padding - more breathing room on small screens
   ---------------------------------------------------------------------- */
@media screen and (max-width: 479px) {
  .padding-global {
    padding-left: max(4%, 1rem) !important;
    padding-right: max(4%, 1rem) !important;
  }
}

/* ----------------------------------------------------------------------
   Partners section - continuous horizontal scroll
   ---------------------------------------------------------------------- */
.partners-scroll {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.partners-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: partners-scroll 20s linear infinite;
}

.partners-track:hover {
  animation-play-state: paused;
}

.partners-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.partners-item img {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

@keyframes partners-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media screen and (max-width: 991px) {
  .section_partners {
    overflow-x: hidden;
  }

  .partners-scroll {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
  }

  .partners-track {
    gap: 2rem;
  }

  .partners-item img {
    max-height: 60px;
  }
}

@media screen and (max-width: 479px) {
  .partners-track {
    gap: 1.5rem;
    animation-duration: 15s;
  }

  .partners-item img {
    max-height: 50px;
  }
}

/* ----------------------------------------------------------------------
   Section separation and internal spacing
   ---------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  .layout239_list,
  .faq10_content {
    grid-row-gap: 2rem !important;
    grid-column-gap: 2rem !important;
  }
}

@media screen and (max-width: 479px) {
  .layout239_list,
  .faq10_content {
    grid-row-gap: 1.5rem !important;
    grid-column-gap: 1.5rem !important;
  }
}

/* ----------------------------------------------------------------------
   Quick CTA and floating elements - adequate spacing
   ---------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
  .quick-cta {
    padding: 0.75rem max(4%, 1rem) !important;
  }
}

@media screen and (max-width: 479px) {
  .quick-cta {
    padding: 0.75rem max(4%, 1rem) !important;
  }
}

/* Mobile: position floating buttons above bottom nav */
@media screen and (max-width: 991px) {
  .float-cta-buttons {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    right: 16px;
  }
}
