/* =============================================================================
   SPEEDGATE LOGISTICS — Testimonials CSS
   Paste into your existing <style> block in index.html
   (or link as a separate <link rel="stylesheet" href="testimonials-styles.css">)
   ============================================================================= */

/* ── Testimonials grid ───────────────────────────────────────────────────── */
.t-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

/* ── Mobile: force 2 testimonials per row ─────────────────────────────────── */
@media (max-width: 640px) {
  .t-grid {
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-top: 1.5rem;
  }
  .t-card {
    padding: .85rem .8rem .75rem;
    gap: .5rem;
    border-radius: 10px;
  }
  .t-card-head { gap: .55rem; }
  .t-avatar {
    width: 34px; height: 34px;
    font-size: .7rem;
  }
  .t-name { font-size: .78rem; }
  .t-vehicle { font-size: .62rem; }
  .t-star { font-size: .85rem; }
  .t-stars { gap: 1px; }
  .t-body { font-size: .72rem; line-height: 1.45; }
  .t-date { font-size: .58rem; }
}

.t-empty {
  text-align: center;
  color: var(--gray-500, #6b7280);
  font-size: .95rem;
  padding: 2rem 0;
}

/* ── Testimonial card ──────────────────────────────────────────────────────── */
.t-card {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 14px;
  padding: 1.4rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
}
.t-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

.t-card-head {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
}

.t-avatar {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy, #0f2a4a);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .04em;
}

.t-meta { flex: 1; min-width: 0; }
.t-name {
  display: block;
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy, #0f2a4a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-vehicle {
  display: block;
  font-size: .78rem;
  color: var(--gray-500, #6b7280);
  margin-top: .1rem;
}

.t-rating-wrap { margin-left: auto; flex-shrink: 0; }
.t-stars { display: flex; gap: 2px; }
.t-star { font-size: 1.1rem; color: #d1d5db; }
.t-star.filled { color: #f59e0b; }

.t-body {
  font-size: .88rem;
  line-height: 1.65;
  color: var(--gray-700, #374151);
  margin: 0;
  flex: 1;
}

.t-date {
  font-size: .72rem;
  color: var(--gray-400, #9ca3af);
  align-self: flex-end;
}

/* ── CTA under grid ──────────────────────────────────────────────────────── */
.t-cta {
  text-align: center;
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
}
.t-cta p { color: var(--gray-600, #4b5563); font-size: .95rem; margin: 0; }

/* =============================================================================
   Review Modal
   ============================================================================= */
.review-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.review-modal-overlay.open { opacity: 1; pointer-events: auto; }

.review-modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: scale(.94) translateY(8px);
  transition: transform .22s ease;
}
.review-modal-overlay.open .review-modal-card {
  transform: scale(1) translateY(0);
}

.review-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.review-modal-head h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy, #0f2a4a);
  margin: 0;
}
.review-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; line-height: 1;
  color: var(--gray-500, #6b7280);
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.review-modal-close:hover { color: var(--navy, #0f2a4a); background: var(--gray-100, #f3f4f6); }

/* form fields inside modal */
#reviewForm label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
  margin-bottom: .3rem;
  margin-top: .9rem;
}
#reviewForm label:first-of-type { margin-top: 0; }

#reviewForm input,
#reviewForm select,
#reviewForm textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1.5px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  font: inherit;
  font-size: .9rem;
  color: var(--gray-800, #1f2937);
  background: #fff;
  transition: border-color .15s;
  box-sizing: border-box;
}
#reviewForm input:focus,
#reviewForm select:focus,
#reviewForm textarea:focus {
  outline: none;
  border-color: var(--primary, #1d6fde);
}
#reviewForm textarea { resize: vertical; min-height: 100px; }

.rv-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
}
@media (max-width: 400px) {
  .rv-row { grid-template-columns: 1fr; }
}

/* ── Interactive star rating picker ─────────────────────────────────────── */
.rating-picker {
  display: flex; gap: 6px;
  margin-top: .2rem;
}
.rp-star {
  background: none; border: none; cursor: pointer;
  font-size: 1.85rem; line-height: 1;
  color: #d1d5db;
  padding: 0;
  transition: color .12s, transform .1s;
}
.rp-star:hover,
.rp-star.active { color: #f59e0b; }
.rp-star:hover  { transform: scale(1.15); }

/* ── Error message ───────────────────────────────────────────────────────── */
.review-error {
  color: #dc2626;
  font-size: .82rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: .55rem .75rem;
  margin-top: .75rem;
}

/* ── Modal action buttons ────────────────────────────────────────────────── */
.review-modal-actions {
  display: flex; gap: .75rem; justify-content: flex-end;
  margin-top: 1.4rem;
}

/* ── Mobile only: testimonials scroll horizontally in a single row ───────────
   Overrides the 2-column grid + collapse behaviour on phones. Uses the
   #testimonialsGrid id so it wins over the .t-grid class rules.            */
@media (max-width: 640px) {
  #testimonialsGrid.t-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    gap: .75rem !important;
    margin-top: 1.5rem;
    padding-bottom: .6rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  #testimonialsGrid.t-grid > .t-card {
    flex: 0 0 80% !important;
    max-width: 80% !important;
    scroll-snap-align: start;
  }
  /* show every testimonial when scrolling horizontally */
  #testimonialsGrid.t-grid > .t-card.t-hidden { display: flex !important; }
  /* the "View More" button isn't needed in horizontal scroll mode */
  .t-view-more-wrap { display: none !important; }
}
