/* Testimonials - ISOLATED from other blocks */
.apcu-testimonial {
  position: relative;
  padding: 24px 20px;
  display: block;
  visibility: visible;
  opacity: 1;
  /* Isolate from sales gallery */
  isolation: isolate;
}

/* Prevent testimonials styles from leaking to sales gallery */
.apcu-sales-gallery .apcu-testimonial,
.apcu-testimonial .apcu-sales-gallery {
  /* These should never nest, but just in case */
  all: revert;
}

/* Horizontal Alignment */
.apcu-testimonial--h-left {
  text-align: left;
}

.apcu-testimonial--h-center {
  text-align: center;
}

.apcu-testimonial--h-right {
  text-align: right;
}

.apcu-testimonial__header {
  margin-bottom: 24px;
}

.apcu-testimonial__header-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apcu-testimonial-header-color, #dc2626);
  font-family: inherit;
}

.apcu-testimonial__main {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  display: block;
  visibility: visible;
  min-height: 50px;
}

.apcu-testimonial-navigation {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  justify-content: center;
}

.apcu-testimonial-navigation button {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  background: transparent;
  border: none;
  transition: opacity 0.2s;
  color: #333;
}

.apcu-testimonial-navigation button:hover {
  opacity: 0.8;
}

.apcu-testimonial-navigation button svg {
  width: 32px;
  height: 32px;
}

.apcu-testimonial__item {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Horizontal alignment for item content */
.apcu-testimonial--h-left .apcu-testimonial__item {
  align-items: flex-start;
}

.apcu-testimonial--h-center .apcu-testimonial__item {
  align-items: center;
}

.apcu-testimonial--h-right .apcu-testimonial__item {
  align-items: flex-end;
}

.apcu-testimonial__quote {
  width: 100%;
}

/* Quote Text Typography - Hardcoded */
.apcu-testimonial .apcu-testimonial__quote-text,
.apcu-testimonial__quote-text,
.wp-block-agentpoint-custom-ui-testimonial .apcu-testimonial__quote-text {
  margin: 0;
  color: var(--apcu-testimonial-quote-color, #1e293b);
  max-width: 100%;
  font-family: "Feature Display Web", sans-serif !important;
  font-weight: 500 !important;      /* Medium */
  font-style: normal !important;
  font-size: 22px !important;
  line-height: 28px !important;
  letter-spacing: 1% !important;   /* 2% ≈ 0.02em */
  text-align: center !important;
  font-variant-numeric: lining-nums proportional-nums !important;
}

/* DESKTOP */
@media (min-width: 768px) {
  .apcu-testimonial .apcu-testimonial__quote-text,
  .apcu-testimonial__quote-text,
  .wp-block-agentpoint-custom-ui-testimonial .apcu-testimonial__quote-text {
    font-size: 28px !important;
    line-height: 36px !important;
    letter-spacing: 0.02em !important;
    text-align: left !important;
  }
}

/* Author Typography - Hardcoded */
.apcu-testimonial .apcu-testimonial__author,
.apcu-testimonial__author,
.wp-block-agentpoint-custom-ui-testimonial .apcu-testimonial__author {
  color: var(--apcu-testimonial-author-color, #64748b);
  margin: 0;
  font-family: "Inter", sans-serif !important;
  font-weight: 400 !important;       /* Regular */
  font-style: normal !important;
  font-size: 14px !important;
  line-height: 22px !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  leading-trim: none !important;
}

/* DESKTOP */
@media (min-width: 768px) {
  .apcu-testimonial .apcu-testimonial__author,
  .apcu-testimonial__author,
  .wp-block-agentpoint-custom-ui-testimonial .apcu-testimonial__author {
    font-size: 18px !important;
    line-height: 28px !important;
    letter-spacing: 0 !important;
    text-align: left !important;
  }
}

.apcu-testimonial__unavailable {
  padding: 40px;
  text-align: center;
  color: #999;
}

.apcu-testimonial__unavailable p {
  margin: 0;
  font-size: 16px;
}

/* Pagination dots */
.apcu-testimonial-pagination {
  width: 58px;
  height: 20px;
  background: #EDEFF0;
  border-radius: 5px;
  display: flex;
  justify-content: center; /* center dots horizontally */
  align-items: center;     /* center dots vertically */
  margin: 0 !important;
  padding: 0 8px; /* Equal padding on left and right */
  list-style: none;
  gap: 4px; /* Gap between dots */
  box-sizing: border-box;
}

/* Pagination wrapper - handles margins */
.apcu-testimonial-pagination-wrapper {
  margin-top: 20px !important;
  margin-bottom: 40px !important;
}

/* Pagination position - Desktop: always left, Mobile: always center */
@media (min-width: 768px) {
  .apcu-testimonial-pagination-wrapper {
    justify-content: flex-start !important;
  }
  
  .apcu-testimonial-pagination {
    justify-content: flex-start !important;
  }
}

.apcu-testimonial-pagination-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #D9D9D9 !important;
  /* Inactive: white */
  border: 1px solid #D9D9D9 !important;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  opacity: 1;
}

.apcu-testimonial-pagination-bullet-active {
  background-color: #071C2D !important; /* Active: #071C2D */
  border-color: #071C2D !important;
  opacity: 1;
}

/* Swiper container styles - SCOPED to testimonials only */
.apcu-testimonial swiper-container {
  width: 100%;
  height: auto;
  --swiper-slides-per-view: 1;
  display: block;
  visibility: visible;
  min-height: 100px;
}

.apcu-testimonial swiper-slide {
  height: auto;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  visibility: visible;
}

/* Vertical alignment for slides */
.apcu-testimonial--v-top swiper-slide {
  align-items: flex-start;
}

.apcu-testimonial--v-center swiper-slide {
  align-items: center;
}

.apcu-testimonial--v-bottom swiper-slide {
  align-items: flex-end;
}

/* Hide Swiper's default pagination if we're using custom - SCOPED to testimonials */
.apcu-testimonial swiper-container::part(pagination) {
  display: none;
}

/* Mobile Responsive Styles - ISOLATED from sales gallery */
@media (max-width: 767.98px) {
  /* CRITICAL: Ensure testimonials is isolated from sales gallery mobile styles */
  .apcu-testimonial {
    padding: 20px 16px !important;
    /* Reset any potential sales gallery overrides */
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Protect testimonials swiper from sales gallery styles */
  .apcu-testimonial swiper-container {
    /* Ensure sales gallery mobile styles don't affect testimonials */
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .apcu-testimonial swiper-slide {
    /* Ensure sales gallery mobile styles don't affect testimonials */
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .apcu-testimonial__header {
    margin-bottom: 20px;
  }

  .apcu-testimonial__header-text {
    font-size: 12px;
  }

  .apcu-testimonial .apcu-testimonial__quote-text,
  .apcu-testimonial__quote-text,
  .wp-block-agentpoint-custom-ui-testimonial .apcu-testimonial__quote-text {
    font-size: 22px !important;
    line-height: 28px !important;
    font-family: "Feature Display Web", sans-serif !important;
    font-weight: 500 !important;
    font-style: normal !important;
    letter-spacing: 1% !important;
    text-align: center !important;
    font-variant-numeric: lining-nums proportional-nums !important;
  }

  .apcu-testimonial .apcu-testimonial__author,
  .apcu-testimonial__author,
  .wp-block-agentpoint-custom-ui-testimonial .apcu-testimonial__author {
    font-size: 14px !important;
    line-height: 22px !important;
    font-family: "Inter", sans-serif !important;
    font-weight: 400 !important;
    font-style: normal !important;
    letter-spacing: 0 !important;
    text-align: center !important;
    leading-trim: none !important;
  }

  /* Force single column on mobile - override Swiper settings */
  .apcu-testimonial swiper-container {
    width: 100% !important;
    overflow: hidden !important;
    --swiper-slides-per-view: 1 !important;
  }

  .apcu-testimonial swiper-container::part(wrapper) {
    width: 100% !important;
  }

  .apcu-testimonial swiper-slide {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    flex-shrink: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Target Swiper's internal wrapper */
  .apcu-testimonial swiper-container .swiper-wrapper,
  .apcu-testimonial swiper-container::part(wrapper) {
    display: flex !important;
    width: 100% !important;
    transform: translate3d(0px, 0, 0) !important;
  }

  /* Force each slide to take full width */
  .apcu-testimonial swiper-container .swiper-slide,
  .apcu-testimonial swiper-container swiper-slide {
    width: 100% !important;
    flex-basis: 100% !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
  }

  .apcu-testimonial__item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .apcu-testimonial__quote {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Navigation arrows - smaller on mobile */
  .apcu-testimonial-navigation {
    gap: 8px;
    margin-bottom: 12px;
  }

  .apcu-testimonial-navigation button {
    width: 40px;
    height: 40px;
  }

  .apcu-testimonial-navigation button svg {
    width: 24px;
    height: 24px;
  }

  /* Pagination dots - adjust spacing and force center on mobile */
  .apcu-testimonial-pagination {
    margin-top: 30px !important;
    margin-bottom: 60px !important;
    width: 58px;
    height: 20px;
    background: #EDEFF0;
    border-radius: 5px;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 8px !important; /* Equal padding on left and right */
    gap: 4px !important; /* Gap between dots */
    box-sizing: border-box !important;
  }

  .apcu-testimonial-pagination-bullet {
    width: 6px;
    height: 6px;
  }

  /* Force center alignment on mobile for all content */
  .apcu-testimonial {
    text-align: center !important;
  }

  .apcu-testimonial__item {
    align-items: center !important;
  }

  .apcu-testimonial__quote-text {
    text-align: center !important;
  }


  .apcu-testimonial__header-text {
    text-align: center !important;
  }

  .apcu-testimonial-navigation {
    justify-content: center !important;
  }

  /* SCOPED to testimonials only */
  .apcu-testimonial swiper-slide {
    align-items: center !important;
  }

  /* Mobile: ALWAYS center pagination */
  .apcu-testimonial-pagination-wrapper {
    justify-content: center !important;
  }
  
  .apcu-testimonial-pagination,
  [class*="apcu-testimonial-pagination"] {
    justify-content: center !important;
  }
  
  /* General rule: All Feature Display Web elements on mobile get 1% letter-spacing */
  [style*="Feature Display Web"],
  [style*="feature display web"] {
    letter-spacing: 1% !important;
  }
}
