/*
==========================================
  MG Herbal Skincare - Testimonials Page
==========================================
*/

/* --- Hero --- */
.tm-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: url('../images/testimonials/hero.png') center/cover no-repeat;
  overflow: hidden;
}

.tm-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(47,79,79,0.85) 0%, rgba(47,79,79,0.6) 50%, rgba(0,0,0,0.4) 100%);
}

.tm-hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  color: var(--text-light);
  animation: fadeInDown 1s ease-out;
}

.tm-hero-stars {
  font-size: 2.5rem;
  color: #FFD700;
  letter-spacing: 6px;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tm-hero-content h1 {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.15;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}

.tm-hero-sub {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
  line-height: 1.6;
}

.tm-hero-trust {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2rem;
  backdrop-filter: blur(4px);
}

.tm-hero-trust i {
  color: var(--accent-color);
}

/* --- Testimonial Cards --- */
.tm-testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 30px;
}

.tm-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--accent-color);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.tm-card.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

.tm-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.tm-card-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.tm-avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-color);
}

.tm-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--primary-color);
  margin-bottom: 2px;
}

.tm-location {
  font-size: 0.82rem;
  color: #888;
}

.tm-location i {
  color: var(--accent-color);
  margin-right: 4px;
}

.tm-stars {
  color: #FFD700;
  font-size: 1.1rem;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.tm-review {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  font-style: italic;
  margin-bottom: 12px;
}

.tm-product {
  display: inline-block;
  background: #F7F3E9;
  color: #8B5A2B;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 50px;
}

.tm-product i {
  color: #C98A1A;
  margin-right: 5px;
}

/* --- Results Gallery (NEW) --- */
.tm-gallery-section {
    padding: 80px 0;
    background-color: #F7F3E9;
}

.tm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    margin-top: 40px;
}

.tm-gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 1/1;
    cursor: pointer;
    background: #fff;
}

.tm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tm-gallery-item:hover img {
    transform: scale(1.1);
}

.tm-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(139, 90, 43, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tm-gallery-item:hover .tm-gallery-overlay {
    opacity: 1;
}

.tm-gallery-info {
    color: #fff;
}

.tm-gallery-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: #FFD978;
}

.tm-gallery-info p {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* --- Trust Strip (compact horizontal bar) --- */
.tm-trust-strip {
  background: var(--primary-color);
  padding: 28px 0;
}

.tm-trust-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.tm-trust-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-light);
}

.tm-trust-badge i {
  font-size: 1.5rem;
  color: var(--accent-color);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  flex-shrink: 0;
}

.tm-trust-badge div {
  display: flex;
  flex-direction: column;
}

.tm-trust-badge strong {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--accent-color);
  line-height: 1.2;
}

.tm-trust-badge span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}

/* --- Video Gallery --- */
.tm-video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.tm-video-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.tm-video-card.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

.tm-video-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.tm-video-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  cursor: pointer;
  overflow: hidden;
  background: #1a1a1a;
}

.tm-video-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease, opacity 0.3s ease;
  background: #000;
}

.tm-video-card:hover .tm-video-thumb img {
  transform: scale(1.05);
}

.tm-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 62px;
  height: 62px;
  background: rgba(201, 138, 26, 0.9);
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 25px rgba(0,0,0,0.35);
}

.tm-video-play i {
  color: #fff;
  font-size: 1.3rem;
  margin-left: 3px;
}

.tm-video-card:hover .tm-video-play {
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(201, 138, 26, 1);
  box-shadow: 0 6px 30px rgba(0,0,0,0.5);
}

.tm-video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Video playing state — iframe replaces thumbnail */
.tm-video-playing .tm-video-thumb {
  cursor: default;
}

.tm-video-playing .tm-video-thumb video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border-radius: inherit;
}

.tm-video-info {
  padding: 18px 20px;
}

.tm-video-info h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.tm-video-info p {
  font-size: 0.85rem;
  color: #777;
  font-style: italic;
  margin: 0;
}

/* --- Scrolling Carousel --- */
.tm-carousel-wrapper {
  overflow: hidden;
  padding: 10px 0 20px;
}

.tm-carousel-track {
  display: flex;
  gap: 25px;
  animation: tm-scroll 30s linear infinite;
  width: max-content;
}

.tm-carousel-track:hover {
  animation-play-state: paused;
}

.tm-carousel-slide {
  flex-shrink: 0;
  width: 300px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  border-top: 3px solid var(--accent-color);
  transition: box-shadow 0.3s ease;
}

.tm-carousel-slide:hover {
  box-shadow: var(--shadow-lg);
}

.tm-carousel-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-color);
  margin: 0 auto 10px;
}

.tm-carousel-stars {
  color: #FFD700;
  font-size: 1rem;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.tm-carousel-slide p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #555;
  font-style: italic;
  margin-bottom: 10px;
}

.tm-carousel-slide strong {
  color: var(--primary-color);
  font-size: 0.85rem;
}

@keyframes tm-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- CTA --- */
.tm-cta-section {
  position: relative;
  padding: 80px 0;
  background: url('../images/testimonials/hero.png') center/cover no-repeat;
  text-align: center;
  overflow: hidden;
}

.tm-cta-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(47,79,79,0.92) 0%, rgba(26,46,46,0.88) 100%);
}

.tm-cta-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
  margin: 0 auto;
}

.tm-cta-content h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.tm-cta-content p {
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.8rem;
}

.tm-cta-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .tm-hero-content h1 {
    font-size: 2.2rem;
  }

  .tm-hero-stars {
    font-size: 1.8rem;
  }

  .tm-hero {
    min-height: 400px;
    padding: 40px 0;
  }

  .tm-testimonials-grid {
    grid-template-columns: 1fr;
  }

  .tm-trust-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    justify-items: start;
  }

  .tm-video-grid {
    grid-template-columns: 1fr;
  }

  .tm-cta-content h2 {
    font-size: 1.8rem;
  }

  .tm-cta-buttons {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .tm-trust-row {
    grid-template-columns: 1fr;
  }

  .tm-carousel-slide {
    width: 260px;
  }
}
