/* ============================================================
   iDEALCAR — HOMEPAGE
   ============================================================ */

/* ── Hero gallery ── */
.hero-gallery {
  position: relative;
  width: 100%;
  height: 62vh;
  min-height: 380px;
  max-height: 640px;
  overflow: hidden;
}
.gallery-track { display: flex; height: 100%; transition: transform 0.6s cubic-bezier(0.4,0,0.2,1); }
.gallery-slide { position: relative; min-width: 100%; height: 100%; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
}
.slide-caption {
  position: absolute; left: 6%; bottom: 14%; color: #fff; z-index: 2; max-width: 480px;
}
.slide-caption-label { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #ff9b91; margin-bottom: 8px; font-weight: 700; }
.slide-caption h2 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; line-height: 1.15; }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.2); color: #fff; font-size: 22px;
  z-index: 3; backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.gallery-arrow:hover { background: rgba(255,255,255,0.35); }
.gallery-arrow.prev { left: 20px; }
.gallery-arrow.next { right: 20px; }

.gallery-dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.gallery-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); border: none; transition: all var(--transition); }
.gallery-dot.active { background: #fff; width: 24px; border-radius: 5px; }

/* ── About strip ── */
.about-strip {
  max-width: var(--max-width);
  margin: 70px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: center;
}
.about-strip-left p { color: var(--color-text-muted); margin: 16px 0 26px; font-size: 15px; }
.about-strip-right { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.about-stat { background: var(--color-bg-soft); border-radius: var(--radius-md); padding: 24px 18px; text-align: center; }
.about-stat-num { font-size: 2.1rem; font-weight: 800; color: var(--color-red); }
.about-stat-label { font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; }

/* ── Featured products carousel ── */
.featured-section { max-width: var(--max-width); margin: 70px auto; padding: 0 24px; }
.featured-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; flex-wrap: wrap; gap: 16px; }

.products-grid-home {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.product-card {
  flex: 1 1 260px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden;
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease), border-color 0.35s var(--ease);
  background: #fff;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-6px); border-color: transparent; }
.product-card-img { height: 190px; overflow: hidden; background: var(--color-bg-soft); cursor: zoom-in; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.product-card:hover .product-card-img img { transform: scale(1.07); }
.product-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.product-card-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.product-card-desc {
  font-size: 13px; color: var(--color-text-muted); margin-bottom: 14px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-footer { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.product-card-footer .quote-btn { flex: 1; min-width: 0; padding: 10px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card-footer .learn-more-btn { flex: 1; min-width: 0; padding: 10px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Service overview gallery ── */
.overview-section { max-width: var(--max-width); margin: 70px auto; padding: 0 24px; text-align: center; }
.overview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 30px; }
.overview-cell { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; cursor: pointer; }
.overview-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.overview-cell-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition); color: #fff;
}
.overview-cell-overlay svg { width: 24px; height: 24px; }
.overview-cell:hover img { transform: scale(1.08); }
.overview-cell:hover .overview-cell-overlay { opacity: 1; }

/* ── Brand Partners strip (fully admin-editable) ── */
.brands-strip { max-width: var(--max-width); margin: 60px auto; padding: 0 24px; }
.brands-track {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 40px; margin-top: 24px;
}
.brand-logo { display: flex; align-items: center; justify-content: center; height: 44px; }
.brand-logo img {
  max-height: 100%; max-width: 140px; width: auto; object-fit: contain;
  filter: grayscale(1); opacity: 0.6; transition: filter var(--transition), opacity var(--transition);
}
.brand-logo:hover img { filter: grayscale(0); opacity: 1; }

/* ── Customer testimonials ── */
.testimonials-section { max-width: var(--max-width); margin: 70px auto; padding: 0 24px; }
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 34px; }
.testimonial-card {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 28px 26px 26px;
  text-align: left; background: var(--color-bg); box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.testimonial-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.testimonial-stars { color: #f5a623; font-size: 16px; margin-bottom: 14px; letter-spacing: 3px; }
.testimonial-text { font-size: 14.5px; color: var(--color-text); margin-bottom: 22px; font-style: italic; line-height: 1.7; word-wrap: break-word; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.author-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--color-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.author-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.author-role { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

.testimonials-social {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 40px; flex-wrap: wrap; text-align: center;
}
.testimonials-social span { font-size: 13.5px; font-weight: 600; color: var(--color-text-muted); }
.testimonials-social-icons { display: flex; gap: 14px; }
.testimonials-social-icons img { height: 24px; width: 24px; transition: transform var(--transition); }
.testimonials-social-icons a:hover img { transform: translateY(-3px); }

/* ── FAQ accordion ── */
.faq-section { max-width: 820px; margin: 70px auto; padding: 0 24px; }
.faq-list { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden;
  background: var(--color-bg); transition: box-shadow var(--transition), border-color var(--transition);
}
.faq-item.open { border-color: var(--color-red); box-shadow: var(--shadow-sm); }
.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; min-height: 56px; background: none; border: none; text-align: left;
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--color-text); line-height: 1.4;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.faq-question:hover { color: var(--color-red); }
.faq-question:focus-visible { outline: 2px solid var(--color-red); outline-offset: -2px; }
.faq-icon { flex-shrink: 0; transition: transform var(--transition); color: var(--color-red); }
.faq-item.open .faq-icon { transform: rotate(180deg); }
/* Grid-row trick: animates to the answer's real height instead of a guessed
   max-height, so long answers never get clipped on small screens. */
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer p { min-height: 0; overflow: hidden; padding: 0 22px 20px; font-size: 14px; color: var(--color-text-muted); line-height: 1.7; word-wrap: break-word; }

@media (max-width: 768px) {
  .testimonials-section,
  .faq-section { margin: 48px auto; }
  .testimonial-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 26px; }
  .testimonial-card { padding: 22px 20px; }
  .testimonial-card:hover { transform: none; }
  .faq-list { margin-top: 22px; gap: 10px; }
}

@media (max-width: 560px) {
  .brands-track { gap: 26px; }
  .brand-logo { height: 34px; }
  .brand-logo img { max-width: 100px; }
  .faq-question { padding: 16px 18px; min-height: 52px; font-size: 14px; }
  .faq-answer p { padding: 0 18px 18px; font-size: 13.5px; }
  .testimonial-text { font-size: 14px; }
}

@media (max-width: 900px) {
  .about-strip { grid-template-columns: 1fr; gap: 30px; }
  .product-card { flex-basis: calc(50% - 12px); max-width: calc(50% - 12px); }
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .hero-gallery { height: 48vh; min-height: 300px; }
  .product-card { flex-basis: 100%; max-width: 340px; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .about-strip-right { grid-template-columns: 1fr 1fr; }
  .gallery-arrow { width: 38px; height: 38px; font-size: 18px; }
}
