/**
 * FAQ Accordion styles
 */

/* Prevent layout shifts during animations */
.faq, .w-layout-vflex.faq {
  position: relative !important;
  overflow: hidden !important;
  will-change: contents !important;
  contain: layout !important;
  border-bottom: 1px solid var(--content_gray) !important;
  padding-bottom: 0 !important;
  transform: translateZ(0) !important; /* Force GPU acceleration */
}

/* Ensure consistent heights for question containers */
.faq-question-container {
  cursor: pointer;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  min-height: 60px !important; /* Set a consistent height */
  padding: 15px 0 20px 0 !important; /* 10px top, 20px bottom padding */
  box-sizing: border-box !important;
  transform: translateZ(0) !important; /* Force GPU acceleration */
}

/* Default state - Answer is hidden */
.faq-answer:not(.active) {
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), 
              opacity 0.2s ease,
              padding 0.2s ease,
              margin 0.2s ease !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: block !important;
  visibility: visible !important;
  pointer-events: none !important;
  transform: translateZ(0) !important; /* Force GPU acceleration */
}

/* Active state - Answer is visible */
.faq-answer.active {
  max-height: 1000px !important; /* Large enough to accommodate content */
  opacity: 1 !important;
  transition: max-height 0.4s ease-in-out, 
              opacity 0.3s ease,
              padding 0.2s ease,
              margin 0.2s ease !important;
  padding-top: 1em !important;
  padding-bottom: 1em !important;
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateZ(0) !important; /* Force GPU acceleration */
}

/* Toggle icon styling - Create a plus sign */
.faq-toggle-icon {
  position: relative !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
}

/* Create the plus sign */
.faq-toggle-icon:before,
.faq-toggle-icon:after {
  content: "" !important;
  position: absolute !important;
  background-color: white !important;
  transition: transform 0.3s ease !important;
}

/* Horizontal line */
.faq-toggle-icon:before {
  width: 16px !important;
  height: 2px !important;
}

/* Vertical line */
.faq-toggle-icon:after {
  width: 2px !important;
  height: 16px !important;
}

/* When active, hide the vertical line by rotating it */
.faq-toggle-icon.active:after {
  transform: rotate(90deg) !important;
  opacity: 0 !important;
}

/* Optional hover effect */
.faq-question-container:hover {
  opacity: 0.9;
}

/**
 * Treatment Cards Carousel styles
 */

/* Make the flex container a scrollable carousel */
.w-layout-hflex.flex-block-5.treatment-cards {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  gap: 24px;
  padding: 1rem 0;
  -ms-overflow-style: none; /* Hide scrollbar for IE and Edge */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  padding-right: 24px; /* Extra padding to ensure last item is fully visible */
  align-items: stretch; /* Prevent vertical stretching */
  justify-content: flex-start; /* Align items to the start */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.w-layout-hflex.flex-block-5.treatment-cards::-webkit-scrollbar {
  display: none;
}

/* Normalize all cards in the carousel */
.treatment-cards .content-card.card-panel,
.treatment-cards .content-card.card-panel-copy {
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
  flex: 0 0 300px !important;
  height: 400px !important; /* Set a consistent height for all cards */
  min-height: 400px !important;
  max-height: 400px !important;
  margin: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 8px !important; /* Maintain consistent border radius */
  transition: transform 0.3s ease, box-shadow 0.3s ease !important; /* Smooth transition for hover effects */
  cursor: pointer !important; /* Show pointer on hover */
}

/* Bounce/float effect on hover */
.treatment-cards .content-card.card-panel:hover,
.treatment-cards .content-card.card-panel-copy:hover {
  transform: translateY(-10px) !important; /* Move up slightly */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important; /* Add shadow for float effect */
}

/* Ensure inner elements don't cause different sizing */
.treatment-cards .content-card-text {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Fix button positioning to be consistent */
.treatment-cards .content-card .button,
.treatment-cards .content-card .button-disabled {
  align-self: flex-start !important;
  margin-top: auto !important;
}

/* Fix text content to prevent overflow */
.treatment-cards .card-blurb {
  max-height: 120px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 5 !important; /* Limit to 5 lines */
  -webkit-box-orient: vertical !important;
}

/* Carousel navigation */
#carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.carousel-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  border: none;
  touch-action: manipulation; /* Prevent iOS double-tap zoom */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.carousel-nav:hover {
  background-color: var(--surfaces-light);
}

.carousel-nav.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.carousel-nav svg {
  width: 20px;
  height: 20px;
  fill: var(--dark);
}

/* Remove the targeted ID selectors since we're normalizing all cards */
#w-node-_4313f61b-e4a0-ca32-3e16-ae6c26a6a242-dd25cdc8,
#w-node-_8e7948d0-4d7b-8351-9087-4d00364854f0-dd25cdc8,
#w-node-_79e0f7e9-c99e-c497-ec7e-d2663a039e83-dd25cdc8 {
  /* Leave this rule for backwards compatibility but remove the settings */
}

/* Mobile menu */
@media screen and (max-width: 991px) {
  .global_nav {
    height: auto !important;
    overflow: visible !important;
  }

  .global_nav_container {
    grid-template-rows: auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: auto !important;
    min-height: 64px !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }

  .global_nav_menu_group {
    display: none !important;
  }

  .global_nav_menu_group.mobile_expanded {
    display: none !important;
  }

  .icon_hamburger_close {
    display: none !important;
  }

  .global_nav_menu_button_mobile.menu-open .icon_hamburger {
    display: none !important;
  }

  .global_nav_menu_button_mobile.menu-open .icon_hamburger_close {
    display: block !important;
  }

  .hero {
    padding-top: 48px !important;
  }
}

/* Mobile-specific adjustments */
@media screen and (max-width: 767px) {
  /* Remove right padding on toggle icons for mobile */
  .faq {
    padding-right: 0 !important;
    margin-right: 0 !important;
  }
}
