:root {
  --brand-primary: #ffa000;
  --brand-bg: #fff3e0;
  --text-dark: #333;
  --text-mid: #555;
  --radius: 8px;
  --transition: 0.3s ease;
}

/* Reset & base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Section wrapper */
#live-dynamic-section {
  background: var(--brand-bg);
  padding: clamp(2rem, 5vw, 4rem) 0;
  margin-top: 50px;

}

/* Center container */
.sp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  font-family: Poppins, sans-serif;
}

.sp-header {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 2rem;
}

/* Grid of testimonial + live feed */
.social-proof-wrapper {
  display: grid;
  gap: 1.5rem;
  /* mobile-first: one column */
  grid-template-columns: 1fr;
}

/* Tablet & up: two columns (2fr / 3fr) */
@media (min-width: 768px) {
  .social-proof-wrapper {
    grid-template-columns: 2fr 3fr;
  }
}

/* Left side: fading testimonial cards */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition), transform var(--transition);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Testimonial carousel area */
.social-proof-left {
  position: relative;
  overflow: hidden;
  min-height: 20rem;
}

/* Each card */
.testimonial-card {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-left: 4px solid var(--brand-primary);
  cursor: grab;
  touch-action: pan-y;
  transition: transform var(--transition);
}
.testimonial-card:hover {
  transform: scale(1.02);
}
.testimonial-card.active {
  z-index: 1;
}

/* Avatar + content */
.avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.stars .material-icons {
  font-size: 1rem;
  color: var(--brand-primary);
}
.stars .empty {
  color: #ccc;
}

.review-text {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

.testimonial-content p {
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}
.testimonial-content p .product {
  font-weight: 600;
}
.testimonial-content p .city {
  font-style: italic;
  color: var(--text-mid);
}

.testimonial-date {
  font-size: 0.75rem;
  color: var(--text-mid);
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: #2a9d8f;
  color: #fff;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Buy button */
.btn-buy {
  display: inline-block;
  background-color: var(--btn-bg);
  color: var(--btn-color);
  padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 4vw, 1.5rem);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 400;
  border-radius: 25px;
  text-decoration: none;
  text-align: center;
  transition: background-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-buy:hover,
.btn-buy:focus {
  background-color: var(--btn-color);
  color: var(--btn-bg);
  transform: translateY(-2px);
}

/* Sliding & floating animations */
@keyframes slide-in {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}
.testimonial-card.slide-in {
  animation: slide-in 0.6s ease both;
}

.star {
  position: absolute;
  font-size: 1.25rem;
  color: var(--brand-primary);
  opacity: 0.8;
  animation: starFloat 1.6s ease-out forwards;
}
@keyframes starFloat {
  to {
    transform: translateY(-50px) scale(1.4);
    opacity: 0;
  }
}

/* Right side: live feed */
.social-proof-right {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}
.social-proof-right h3 {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.live-feed-list {
  display: grid;
  row-gap: 1rem;
  overflow-y: auto;
  max-height: 20rem;
}

.live-sale-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  padding: 0.75rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform var(--transition);
}
.live-sale-card:hover {
  transform: scale(1.02);
}

.live-sale-card img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.live-info {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-dark);
}
.live-info .product {
  font-weight: 600;
}
.live-info .city {
  font-style: italic;
  color: var(--text-mid);
}
.live-info .price {
  display: block;
  margin: 0.25rem 0;
  color: var(--brand-primary);
  font-weight: 600;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px green;
  }
  50% {
    box-shadow: 0 0 15px green;
  }
  100% {
    box-shadow: 0 0 5px green;
  }
}

.live-sale-card .badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background-color: green;
  color: #fff;
  border-radius: var(--radius);
  animation: glow 1.5s infinite ease-in-out;
}

.live-sale-card .btn-buy {
  display: inline-block;
  background-color: var(--btn-bg);
  color: var(--btn-color);
  padding: clamp(0.5rem, 2vw, 0.75rem) clamp(1rem, 4vw, 1.5rem);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 400;
  border-radius: 25px;
  text-decoration: none;
  text-align: center;
  transition: background-color var(--transition), color var(--transition), transform var(--transition);
}
.live-sale-card .btn-buy:hover,
.live-sale-card .btn-buy:focus {
  background-color: var(--btn-color);
  color: var(--btn-bg);
  transform: translateY(-2px);
}

/* Large screens: allow a bit more width */
@media (min-width: 1200px) {
  .sp-container {
    max-width: 1400px;
  }
}

/* Medium small: tighten everything up under 600px */
@media (max-width: 600px) {
  #live-dynamic-section {
    padding: clamp(1rem, 4vw, 2rem) 0;
  }
  .sp-container {
    padding: 0 0.5rem;
  }
  .social-proof-wrapper {
    grid-template-columns: 1fr;
  }
  .testimonial-card {
    flex-direction: column;
    text-align: center;
  }
  .avatar {
    width: 50px;
    height: 50px;
  }
  .stars .material-icons {
    font-size: 0.9rem;
  }
  .testimonial-content p {
    font-size: 0.95rem;
  }
  .btn-buy {
    width: 100%;
    justify-content: center;
  }
  .live-feed-list {
    max-height: 14rem;
  }
  .live-sale-card {
    flex-direction: column;
    text-align: center;
  }
  .live-sale-card img {
    width: 40px;
    height: 40px;
  }
  .live-sale-card .btn-buy {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Extra‑small: under 480px, punch it down just a bit more */
@media (max-width: 480px) {
  .sp-header {
    font-size: clamp(1.5rem, 5vw, 1.75rem);
  }
  .social-proof-wrapper {
    gap: 1rem;
  }
  .testimonial-card {
    padding: 0.75rem;
  }
  .avatar {
    width: 40px;
    height: 40px;
  }
  .stars .material-icons {
    font-size: 0.8rem;
  }
  .testimonial-content p {
    font-size: 0.9rem;
  }
  .btn-buy {
    padding: 0.4rem 0.8rem;
  }
  .live-sale-card img {
    width: 30px;
    height: 30px;
  }
  .live-sale-card {
    padding: 0.5rem;
  }
  .live-info {
    font-size: 0.8rem;
  }
  .live-feed-list {
    max-height: 12rem;
  }
}
