/* ==========================================================================
   3D TESTIMONIALS WALL & STATS SECTION — COFFEE LOOP THEME
   - Integrated 3D perspective wall & multi-column bidirectional infinite marquee
   - Custom styled with rich dark roast coffee aesthetics, gold & amber accents
   ========================================================================== */

/* --- CSS TOKENS & VARIABLES --- */
:root,
.loop-testimonials-section {
  /* Brand & Accent Colors */
  --t-color-primary: #D48B38;
  --t-color-primary-electric: #F8B715;
  --t-color-primary-dark: #A86B28;
  --t-color-accent-cyan: #F8B715;
  --t-color-star-gold: #F8B715;

  /* Theme Backgrounds & Surfaces */
  --t-bg-section: #0D0A08;
  --t-bg-card: rgba(22, 18, 15, 0.88);
  --t-bg-card-border: rgba(212, 139, 56, 0.22);
  --t-bg-card-border-hover: rgba(248, 183, 21, 0.6);

  /* Typography Colors */
  --t-text-headline: #FFFFFF;
  --t-text-title: #F7EFE8;
  --t-text-body: #C4B5A8;
  --t-text-muted: #8E7F73;

  /* Typography Fonts */
  --t-font-display: 'Montserrat', sans-serif;
  --t-font-body: 'Montserrat', sans-serif;
  --t-font-accent: 'Montserrat', sans-serif;

  /* 3D Shadows & Lighting */
  --t-shadow-card: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 139, 56, 0.08);
  --t-shadow-card-hover: 0 24px 50px rgba(0, 0, 0, 0.75), 0 0 25px rgba(248, 183, 21, 0.3);
  --t-shadow-stat: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 139, 56, 0.06);
  --t-shadow-stat-hover: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(248, 183, 21, 0.25);

  /* Marquee Configuration */
  --t-marquee-duration: 38s;
  --t-marquee-gap: 1.25rem;
  --t-card-width: 280px;

  /* Animations & Transitions */
  --t-ease-elastic: cubic-bezier(0.16, 1, 0.3, 1);
  --t-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- BASE SECTION CONTAINER --- */
.testimonials-section {
  position: relative;
  padding: 110px 0 100px;
  background-color: var(--t-bg-section);
  color: var(--t-text-title);
  overflow: hidden;
  font-family: var(--t-font-body);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

.testimonials-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 450px;
  background: radial-gradient(ellipse at center, rgba(212, 139, 56, 0.08) 0%, rgba(248, 183, 21, 0.03) 40%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}

.testimonials-section *,
.testimonials-section *::before,
.testimonials-section *::after {
  box-sizing: border-box;
}

.testimonials-section .t-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

/* --- SECTION HEADER --- */
.testimonials-section .section-header-center {
  text-align: center;
  margin-bottom: 36px;
}

.testimonials-section .testimonial-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--t-color-primary-electric);
  background: rgba(248, 183, 21, 0.1);
  border: 1px solid rgba(248, 183, 21, 0.25);
  border-radius: 50px;
  margin-bottom: 14px;
  letter-spacing: 1.5px;
  font-family: var(--t-font-accent);
  text-transform: uppercase;
}

.testimonials-section .testimonial-pill-badge i,
.testimonials-section .testimonial-pill-badge .star-icon {
  color: var(--t-color-star-gold);
}

.testimonials-section .section-title {
  font-family: var(--t-font-display);
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800;
  color: var(--t-text-headline);
  line-height: 1.15;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.testimonials-section .section-subtitle {
  font-size: 1.05rem;
  color: var(--t-text-body);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

.testimonials-section .section-title-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #D48B38, #F8B715);
  border-radius: 2px;
  margin: 18px auto 0;
}

/* ==========================================================================
   3D STAGE & MARQUEE TRACKS
   ========================================================================== */
.testimonials-3d-wrapper {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  height: 540px;
  margin: 30px 0 20px;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 900px;
  user-select: none;
}

.testimonials-3d-stage {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--t-marquee-gap);
  width: max-content;
  transform: translateX(-40px) translateY(-10px) translateZ(-50px) rotateX(18deg) rotateY(-14deg) rotateZ(14deg);
  transform-style: preserve-3d;
  transition: transform 0.6s var(--t-ease-elastic);
  will-change: transform;
}

.testimonials-3d-stage.flat-view {
  transform: translateX(0) translateY(0) translateZ(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg) !important;
}

/* Column Masks & Layout */
.marquee-column {
  display: flex;
  flex-direction: column;
  gap: var(--t-marquee-gap);
  height: 780px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

.marquee-track {
  display: flex;
  flex-direction: column;
  gap: var(--t-marquee-gap);
  flex-shrink: 0;
  will-change: transform;
}

/* Animations */
.marquee-down .marquee-track {
  animation: marquee-down-anim var(--t-marquee-duration) linear infinite;
}

.marquee-up .marquee-track {
  animation: marquee-up-anim var(--t-marquee-duration) linear infinite;
}

.marquee-column:hover .marquee-track,
.testimonials-3d-wrapper.paused .marquee-track {
  animation-play-state: paused !important;
}

@keyframes marquee-down-anim {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(calc(-100% - var(--t-marquee-gap)));
  }
}

@keyframes marquee-up-anim {
  0% {
    transform: translateY(calc(-100% - var(--t-marquee-gap)));
  }
  100% {
    transform: translateY(0);
  }
}

/* ==========================================================================
   TESTIMONIAL CARD (LUXURY 3D CARD)
   ========================================================================== */
.testimonial-card {
  width: var(--t-card-width);
  background: var(--t-bg-card);
  border: 1px solid var(--t-bg-card-border);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: var(--t-shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.35s var(--t-ease-elastic);
  cursor: pointer;
  position: relative;
  text-align: left;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.testimonial-card:hover {
  border-color: var(--t-bg-card-border-hover);
  background: rgba(28, 22, 18, 0.95);
  transform: scale(1.05) translateZ(40px);
  box-shadow: var(--t-shadow-card-hover);
  z-index: 10;
}

.card-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--t-color-primary-electric);
  background-color: rgba(248, 183, 21, 0.1);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-family: var(--t-font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--t-text-title);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.country-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(248, 183, 21, 0.12);
  color: var(--t-color-primary-electric);
  border: 1px solid rgba(248, 183, 21, 0.25);
  font-family: var(--t-font-accent);
  text-transform: uppercase;
}

.user-handle {
  font-size: 11.5px;
  color: var(--t-text-muted);
  font-weight: 500;
}

.star-rating {
  color: var(--t-color-star-gold);
  font-size: 13px;
  letter-spacing: 2px;
  margin-top: -2px;
}

.card-quote {
  font-size: 13px;
  line-height: 1.55;
  color: var(--t-text-body);
  font-weight: 400;
  margin: 0;
}

/* ==========================================================================
   EDGE FADE GRADIENTS
   ========================================================================== */
.edge-gradient {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

.gradient-top {
  top: 0;
  left: 0;
  right: 0;
  height: 25%;
  background: linear-gradient(to bottom, var(--t-bg-section) 0%, rgba(13, 10, 8, 0.8) 40%, transparent 100%);
}

.gradient-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: 25%;
  background: linear-gradient(to top, var(--t-bg-section) 0%, rgba(13, 10, 8, 0.8) 40%, transparent 100%);
}

.gradient-left {
  top: 0;
  bottom: 0;
  left: 0;
  width: 18%;
  background: linear-gradient(to right, var(--t-bg-section) 0%, transparent 100%);
}

.gradient-right {
  top: 0;
  bottom: 0;
  right: 0;
  width: 18%;
  background: linear-gradient(to left, var(--t-bg-section) 0%, transparent 100%);
}

/* ==========================================================================
   TESTIMONIAL STATS GRID
   ========================================================================== */
.testimonials-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  margin: 36px auto 0;
}

.testimonial-stat-card {
  background: var(--t-bg-card);
  border: 1px solid var(--t-bg-card-border);
  padding: 24px 20px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--t-shadow-stat);
  transition: transform 0.3s var(--t-ease-elastic), box-shadow 0.3s ease, border-color 0.3s ease;
  backdrop-filter: blur(10px);
}

.testimonial-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--t-shadow-stat-hover);
  border-color: var(--t-bg-card-border-hover);
}

.t-stat-num {
  font-family: var(--t-font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--t-color-primary-electric);
  margin-bottom: 4px;
  line-height: 1.15;
  letter-spacing: 0.5px;
}

.t-stat-label {
  font-size: 0.88rem;
  color: var(--t-text-body);
  font-weight: 600;
  line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Tablets Landscape (<= 1024px) */
@media (max-width: 1024px) {
  :root {
    --t-card-width: 240px;
  }

  .testimonials-section {
    padding: 85px 0 75px;
  }

  .testimonials-3d-wrapper {
    height: 460px;
  }

  .testimonials-3d-stage {
    transform: translateX(-20px) translateY(0px) translateZ(-50px) rotateX(14deg) rotateY(-8deg) rotateZ(8deg);
  }

  .testimonials-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Tablets Portrait & Large Mobile (<= 768px) */
@media (max-width: 768px) {
  :root {
    --t-card-width: 210px;
    --t-marquee-gap: 0.85rem;
  }

  .testimonials-section {
    padding: 70px 0 60px;
  }

  .testimonials-3d-wrapper {
    height: 400px;
  }

  .testimonials-3d-stage {
    transform: translateX(-10px) translateY(0px) rotateX(10deg) rotateY(-4deg) rotateZ(4deg);
    gap: 0.85rem;
  }

  .marquee-column:nth-child(4) {
    display: none;
  }

  .card-quote {
    font-size: 12px;
  }

  .testimonials-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
  }

  .testimonial-stat-card {
    padding: 18px 14px;
  }

  .t-stat-num {
    font-size: 1.8rem;
  }

  .t-stat-label {
    font-size: 0.8rem;
  }
}

/* Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  :root {
    --t-card-width: 175px;
    --t-marquee-gap: 0.75rem;
  }

  .testimonials-section {
    padding: 55px 0 45px;
  }

  .testimonials-3d-wrapper {
    height: 340px;
  }

  .marquee-column:nth-child(3) {
    display: none;
  }

  .testimonials-3d-stage {
    transform: translateX(0) translateY(0) rotateX(6deg) rotateY(-2deg) rotateZ(2deg);
  }

  .testimonial-card {
    padding: 14px 15px;
    border-radius: 16px;
    gap: 8px;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
  }

  .user-name {
    font-size: 13px;
  }

  .country-badge {
    font-size: 8.5px;
  }

  .user-handle {
    font-size: 10.5px;
  }

  .card-quote {
    font-size: 11px;
    line-height: 1.45;
  }

  .testimonials-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
