/*
 * Shared website components — single source of truth.
 * Scoped by component root IDs so page CSS cannot bleed in/out.
 * Loaded globally with style.css on all website pages.
 */

/* ── FAQs (#im-faqs) ───────────────────────────────────────────── */

#im-faqs .faq-desktop {
  display: none;
}

@media (min-width: 576px) {
  #im-faqs .faq-desktop {
    display: block;
  }
}

#im-faqs .faq-desktop .faq-container {
  display: flex !important;
  align-items: flex-start;
  width: 100%;
  max-width: 70.5rem;
  margin: 0 auto;
  gap: 2rem;
}

#im-faqs .faq-desktop .faq-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

#im-faqs .faq-desktop .faq-card {
  width: 100%;
  max-width: 21.625rem;
  height: 16rem;
  min-height: 16rem;
  min-width: 0;
  overflow: hidden;
  background-color: #F3FAFC;
  padding: 1.5rem;
  border-radius: 0.75rem;
  box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 12px 0px, rgba(0, 0, 0, 0.21) 0px 51px 49px -49px;
  transition: max-height 0.4s ease-in-out, transform 0.3s ease, box-shadow 0.3s ease;
  will-change: max-height;
}

#im-faqs .faq-desktop .faq-card--expanded {
  height: auto !important;
  min-height: 16rem;
}

#im-faqs.im-faqs--compact .faq-desktop .faq-card {
  height: 12.5rem;
  min-height: 12.5rem;
}

#im-faqs.im-faqs--compact .faq-desktop .faq-card--expanded {
  min-height: 12.5rem;
}

@media screen and (min-width: 576px) and (max-width: 991.98px) {
  #im-faqs.im-faqs--compact .faq-desktop .faq-card {
    height: 11rem;
    min-height: 11rem;
  }

  #im-faqs.im-faqs--compact .faq-desktop .faq-card--expanded {
    min-height: 11rem;
  }
}

#im-faqs .faq-desktop .faq-toggle {
  cursor: pointer;
  text-decoration: none;
  border-bottom: none;
}

@media screen and (max-width: 576px) {
  #im-faqs .faq-desktop .faq-card {
    height: 10rem;
    min-height: 10rem;
  }

  #im-faqs .faq-desktop .faq-card .faq-question {
    font-size: 18px;
    line-height: 22px;
  }

  #im-faqs .faq-desktop .faq-card p {
    font-size: 14px;
    line-height: 17px;
  }

  /* Side inset is on .insurance-ninth-section; keep accordion flush inside that. */
  #im-faqs .faqs-accordion {
    padding: 0;
  }
}

/* Mobile accordion — self-contained (must not depend on deferred Bootstrap). */
#im-faqs .faqs-accordion {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#im-faqs .faqs-accordion .accordion-item {
  margin-bottom: 22px;
  overflow: hidden;
  background-color: rgba(243, 250, 252, 1);
  border: 1px solid rgba(74, 74, 74, 0.2);
  border-radius: 12px;
  box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 12px 0px, rgba(0, 0, 0, 0.21) 0px 51px 49px -49px;
}

#im-faqs .faqs-accordion .accordion-header {
  margin: 0;
}

/* No border toggles on the button — those flash a line on open/close. */
#im-faqs .faqs-accordion .accordion-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-weight: 500;
  font-size: 18px;
  line-height: 22px;
  font-family: 'helveticaNeueMedium', Arial, Helvetica, sans-serif;
  padding: 16px 40px 16px 16px;
  border: none !important;
  border-radius: 0 !important;
  color: rgba(0, 0, 0, 1);
  background-color: rgba(243, 250, 252, 1);
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

#im-faqs .faqs-accordion .accordion-button.collapsed,
#im-faqs .faqs-accordion .accordion-button:not(.collapsed) {
  color: rgba(0, 0, 0, 1);
  background-color: rgba(243, 250, 252, 1);
  box-shadow: none;
  border: none !important;
}

#im-faqs .faqs-accordion .accordion-button::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: 12px;
  background-position: center;
  transition: transform 0.3s ease;
}

#im-faqs .faqs-accordion .accordion-button.collapsed::after {
  transform: rotate(-90deg);
}

#im-faqs .faqs-accordion .accordion-button:not(.collapsed)::after {
  transform: rotate(0deg);
}

/* Separator lives on the body so it opens/closes with the panel (no sudden flash). */
#im-faqs .faqs-accordion .accordion-body {
  padding: 16px;
  background-color: rgba(243, 250, 252, 1);
  border: none;
  border-top: 1px solid rgba(74, 74, 74, 0.2);
  border-radius: 0;
  color: #4A4A4A;
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  font-family: 'helveticaNeueLight', Arial, Helvetica, sans-serif;
}

/*
 * Reliable mobile expand/collapse.
 * Avoid grid 0fr (leaks one answer line on some phones) and display:none (jerk).
 */
#im-faqs .faqs-accordion .accordion-collapse {
  display: block !important;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
}

#im-faqs .faqs-accordion .accordion-collapse.show {
  max-height: 320px;
}

#im-faqs .faqs-accordion .accordion-item:last-of-type > .accordion-collapse,
#im-faqs .faqs-accordion .accordion-item:last-of-type {
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 12px;
}

#im-faqs .faqs-accordion button:focus:not(:focus-visible),
#im-faqs .faqs-accordion .accordion-button:focus {
  box-shadow: none;
  outline: none;
}

#im-faqs .faqs-accordion .accordion-item:first-of-type > .accordion-header .accordion-button:not(.collapsed),
#im-faqs .faqs-accordion .accordion-item:first-of-type > .accordion-header .accordion-button.collapsed {
  border-top-right-radius: 12px;
  border-top-left-radius: 12px;
}

/* ── Testimonials (#im-testimonials) ───────────────────────────── */

#im-testimonials {
  width: 100%;
  overflow: hidden;
  position: relative;
  margin-top: 4rem;
}

#im-testimonials .testimonials-track {
  display: flex;
  gap: 1.5rem;
  animation: im-scroll-testimonials 30s linear infinite;
}

#im-testimonials .testimonial-card {
  flex: 0 0 calc(25% - 1.5rem);
  min-width: calc(25% - 1.5rem);
}

#im-testimonials .swiper-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  border: 1px solid #4A4A4A;
}

#im-testimonials .avatar-div {
  gap: 1rem;
  margin-bottom: 1rem;
}

#im-testimonials .avatar-img-div {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

#im-testimonials .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#im-testimonials .swiper-title h3 {
  font-size: 1rem;
  font-weight: 600;
}

#im-testimonials .swiper-title p {
  font-size: 0.875rem;
  color: #666;
}

#im-testimonials .swiper-text {
  font-size: 0.875rem;
  line-height: 1.5;
}

#im-testimonials .main-color {
  color: #5A7300 !important;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
}

@keyframes im-scroll-testimonials {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-25% * 4 - 1.5rem * 4));
  }
}

@media (max-width: 768px) {
  #im-testimonials .testimonial-card {
    flex: 0 0 calc(50% - 1.5rem);
    min-width: calc(50% - 1.5rem);
  }

  @keyframes im-scroll-testimonials {
    0% {
      transform: translateX(0);
    }

    100% {
      transform: translateX(calc(-50% * 4 - 1.5rem * 4));
    }
  }
}

@media (max-width: 576px) {
  #im-testimonials .testimonial-card {
    flex: 0 0 calc(100% - 1.5rem);
    min-width: calc(100% - 1.5rem);
  }

  @keyframes im-scroll-testimonials {
    0% {
      transform: translateX(0);
    }

    100% {
      transform: translateX(calc(-100% * 4 - 1.5rem * 4));
    }
  }
}

/* ── Dealing Revolution (#im-dealing-revolution) ─────────────────
 * "Join the insurance revolution" — shared across Landing, Car,
 * Bike, Travel, Health, Accident. Layout must not depend on
 * deferred Bootstrap or per-page CSS (car-style, etc.).
 * ─────────────────────────────────────────────────────────────── */

#im-dealing-revolution {
  padding: 6.25rem 2.5rem;
}

#im-dealing-revolution .dealing-heading {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

#im-dealing-revolution .dealing-heading span {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem;
  background-color: #F3FAFC;
  border-radius: 1.875rem;
}

#im-dealing-revolution .dealing-img {
  background: #F3FAFC;
  width: 8.75rem;
  height: 8.75rem;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 100%;
}

#im-dealing-revolution .dealing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

#im-dealing-revolution .row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

#im-dealing-revolution .row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

#im-dealing-revolution .justify-content-center {
  justify-content: center !important;
}

#im-dealing-revolution .text-center {
  text-align: center !important;
}

#im-dealing-revolution .d-flex {
  display: flex !important;
}

#im-dealing-revolution .flex-column {
  flex-direction: column !important;
}

#im-dealing-revolution .gap-3 {
  gap: 1rem !important;
}

#im-dealing-revolution .m-0,
#im-dealing-revolution .mb-0 {
  margin: 0 !important;
}

#im-dealing-revolution .col-6 {
  padding-bottom: 2rem;
}

#im-dealing-revolution .dealing-img4,
#im-dealing-revolution .dealing-img5 {
  padding-bottom: 0;
}

/* Desktop grid hidden on mobile — no Bootstrap required */
#im-dealing-revolution .insurance-sixth-desktop,
#im-dealing-revolution .d-sm-block.d-none {
  display: none !important;
}

/* Mobile carousel visible on mobile */
#im-dealing-revolution .insurance-carousel.d-sm-none,
#im-dealing-revolution .landing-dealing-carousel.d-sm-none {
  display: block;
}

@media (min-width: 576px) {
  #im-dealing-revolution .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
  }

  #im-dealing-revolution .insurance-sixth-desktop,
  #im-dealing-revolution .d-sm-block.d-none {
    display: block !important;
  }

  #im-dealing-revolution .insurance-carousel.d-sm-none,
  #im-dealing-revolution .landing-dealing-carousel.d-sm-none {
    display: none !important;
  }
}

@media (min-width: 768px) {
  #im-dealing-revolution .col-md-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }
}

@media screen and (max-width: 576px) {
  #im-dealing-revolution {
    padding: 56px 20px;
  }

  #im-dealing-revolution h2 {
    font-size: 24px;
    line-height: 23px;
  }

  #im-dealing-revolution .dealing-heading {
    margin-bottom: 40px;
  }

  #im-dealing-revolution .dealing-heading span {
    font-size: 12px;
    line-height: 12px;
  }

  #im-dealing-revolution .dealing-img {
    width: 100px;
    height: 100px;
  }

  #im-dealing-revolution .insurance-carousel .dealing-img img,
  #im-dealing-revolution .dealing-img img {
    width: auto;
    height: auto;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
  }

  #im-dealing-revolution .dealing-text h3 {
    font-size: 18px;
    line-height: 22px;
    font-weight: 400;
    font-family: 'helveticaNeueMedium', Arial, Helvetica, sans-serif;
  }

  #im-dealing-revolution .landing-dealing-carousel {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #im-dealing-revolution .landing-dealing-carousel::-webkit-scrollbar {
    display: none;
  }

  #im-dealing-revolution .landing-dealing-carousel__item {
    flex: 0 0 calc(50% - 0.5rem);
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-width: calc(50% - 0.5rem);
  }

  #im-dealing-revolution .landing-dealing-carousel .dealing-card {
    width: 100%;
  }

  #im-dealing-revolution .insurance-carousel .p-carousel-item-start,
  #im-dealing-revolution .insurance-carousel .p-carousel-item-end {
    max-width: none;
    flex: 0 0 50%;
    margin-right: 0;
    margin-left: 0;
  }
}
