/* ══════════════════════════════════════════════════════════════════════════
   Landing page xe (Forester 2.5 / 2.0, Crosstrek)
   Port từ style scoped của subaru-*.astro + Spin360/BentoGallery/KeyVisual.
   Chỉ nạp trên 3 trang landing.
   ══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────── 1. Hero ─────────────────────────── */
.fhero { background: var(--color-bg-dark); line-height: 0; }
.fhero__banner {
  width: 100%; height: auto; object-fit: cover;
  animation: fheroIn 1.2s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes fheroIn {
  from { transform: scale(1.06); opacity: .35; }
  to   { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .fhero__banner { animation: none; } }

/* ─────────────────────────── 2. Trims ─────────────────────────── */
.section--trims { padding-block: 1.25rem 2rem; }
.trims-title {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(1.15rem, 2vw, 1.5rem); text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--color-text-primary);
  text-align: center; margin-bottom: 1rem;
}
.trims { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.trims--3 { grid-template-columns: repeat(3, 1fr); }

.trim {
  position: relative; border: 1px solid var(--color-border);
  border-radius: var(--radius-card); padding: 0.85rem 1.1rem 1rem;
  background: #fff; display: flex; flex-direction: column; gap: 0.4rem;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  will-change: transform;
}
.trim:hover { transform: translateY(-5px); box-shadow: 0 22px 48px -22px rgba(0,48,130,.5); }
.trim--featured {
  border-color: var(--color-accent); box-shadow: var(--shadow-card);
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
}
.trim__tag {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 3;
  background: var(--color-accent); color: #fff; font-size: 0.68rem; font-weight: 700;
  padding: 0.2rem 0.5rem; border-radius: 4px; text-transform: uppercase;
}
.trim__img {
  width: 100%; aspect-ratio: 3/2; object-fit: cover;
  border-radius: 6px; background: #fff;
  transition: transform .5s cubic-bezier(.22,.61,.36,1);
}
.trim:hover .trim__img { transform: scale(1.04); }
.trim__name { font-size: 1.05rem; font-weight: 700; color: var(--color-text-primary); line-height: 1.25; }
.trim__sub { color: var(--color-text-muted); font-size: 0.9rem; margin-top: -0.3rem; }
.trim__price { font-size: 1.2rem; font-weight: 700; color: var(--color-price); }
.trim__specs { list-style: none; display: flex; flex-direction: column; gap: 0.18rem; flex: 1; margin: 0.1rem 0; }
.trim__specs li {
  font-size: 0.82rem; color: var(--color-text-secondary);
  padding-left: 1.1rem; position: relative; line-height: 1.4;
}
.trim__specs li::before { content: '✓'; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }

/* ───────────────────── 3. Section màu xe (360°) ───────────────────── */
.section--colors {
  position: relative;
  background: url('../img/color-section-bg.webp') center center / cover no-repeat;
  padding-block: 2.5rem 1.5rem;
}
.colors-head { text-align: center; margin-bottom: 0.5rem; }
.colors-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: rgba(38,34,28,0.6); margin-bottom: 0.5rem;
}
.colors-heading {
  font-family: var(--font-heading); font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900; color: #2a2620; line-height: 1.15;
  text-shadow: 0 1px 2px rgba(255,255,255,0.35);
}

/* Spin360 viewer */
.s360 { position: relative; width: 100%; overflow: hidden; background: transparent; user-select: none; }
.s360__head {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  padding: 1.5rem 1.5rem 0;
}
.s360__model {
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(0.75rem, 1.4vw, 0.95rem);
  text-transform: uppercase; letter-spacing: 0.12em; color: rgba(255,255,255,0.55);
}
.s360__divider { width: 1px; height: 14px; background: rgba(255,255,255,0.3); }
.s360__colorname {
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  text-transform: uppercase; letter-spacing: 0.1em; color: #fff;
  transition: opacity 0.2s ease;
}
.s360__stage {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 1%; cursor: grab; touch-action: pan-y;
}
.s360__stage.is-grabbing { cursor: grabbing; }
.s360__car {
  display: block; width: 100%; max-width: 1120px; height: auto;
  pointer-events: none; -webkit-user-drag: none;
  transition: opacity 0.35s ease-in-out;
  filter: drop-shadow(0 28px 48px rgba(0,0,0,0.55));
}
.s360__car.is-fading { opacity: 0; }
.s360__shadow {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 70%; max-width: 600px; height: 28px;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(0,0,0,0.5), transparent);
  pointer-events: none;
}
.s360__hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.45rem;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.9); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em; padding: 0.35rem 0.9rem; border-radius: 999px;
  pointer-events: none; transition: opacity 0.4s ease; white-space: nowrap;
}
.s360__hint.is-hidden { opacity: 0; }
.s360__badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.85); border: 1px solid rgba(255,255,255,0.35);
  padding: 0.2rem 0.55rem; border-radius: 4px;
}
.s360__controls {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 0.4rem 1.5rem 0.75rem;
}
.s360__swatches { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.s360__sw {
  position: relative; width: 24px; height: 24px; border-radius: 50%;
  background: var(--c); border: none; padding: 0; cursor: pointer;
  transition: transform 0.2s ease;
  box-shadow: 0 0 0 2px transparent, 0 0 0 4px transparent;
}
.s360__sw:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15), 0 0 0 4px rgba(255,255,255,0.4);
}
.s360__sw.is-active {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(10,18,32,0.6), 0 0 0 5px #fff;
}
.s360__meta {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.55); transition: opacity 0.2s;
}
@media (max-width: 600px) {
  .s360__car { max-width: 100%; }
  .s360__hint { font-size: 0.7rem; }
}

/* ─────────────────── 4. Bảng thông số kỹ thuật ─────────────────── */
.spectable-wrap { overflow-x: auto; border-radius: var(--radius-card); border: 1px solid var(--color-border); }
.spectable { width: 100%; border-collapse: collapse; min-width: 640px; background: #fff; font-size: 0.92rem; }
.spectable th, .spectable td { padding: 0.85rem 1rem; text-align: left; vertical-align: top; }
.spectable thead th { background: var(--color-primary); color: #fff; font-weight: 700; font-size: 0.95rem; }
.spectable thead th span { display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.8; margin-top: 0.15rem; }
.spectable thead th.spectable__hl { background: var(--color-accent); }
.spectable__cat { width: 26%; }
.spectable__group td {
  background: var(--color-bg-light); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 0.78rem; color: var(--color-primary); padding-block: 0.6rem;
}
.spectable tbody tr { border-bottom: 1px solid var(--color-border); }
.spectable__label { font-weight: 600; color: var(--color-text-primary); }
.spectable td.spectable__hl { background: rgba(229, 57, 53, 0.04); }
.spectable tbody td { color: var(--color-text-secondary); }
.spectable__foot { margin-top: 1rem; font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.6; }

/* ─────────────── 5. Tech features (zigzag nền tối) ─────────────── */
.tf-section { background: var(--color-bg-dark); padding-bottom: calc(var(--space-section-y) * 1.25); }
.tf-head { padding-block: var(--space-section-y) 2rem; text-align: center; }
.tf-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--color-accent); margin-bottom: 0.75rem;
}
.tf-heading {
  font-family: var(--font-heading); font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900; color: #fff; line-height: 1.15;
}
.tf-list { display: flex; flex-direction: column; gap: 0; }
.tf-item { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0; position: relative; }
.tf-item--flip .tf-media { order: 2; }
.tf-item--flip .tf-body { order: 1; }
.tf-item:nth-child(even) { margin-top: -2.5rem; }
.tf-media { overflow: hidden; border-radius: var(--radius-card); }
.tf-media img { display: block; width: 100%; height: auto; transition: transform 0.5s cubic-bezier(.4,0,.2,1); }
.tf-item:hover .tf-media img { transform: scale(1.04); }
.tf-body { padding: 2.5rem 3rem; display: flex; flex-direction: column; gap: 0.75rem; }
.tf-item--flip .tf-body { padding-left: 4rem; }
.tf-num {
  font-size: 3.5rem; font-weight: 900; line-height: 1;
  color: rgba(255,255,255,0.07); letter-spacing: -0.02em;
  font-family: var(--font-heading); margin-bottom: -0.5rem;
}
.tf-title {
  font-family: var(--font-heading); font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: #fff; line-height: 1.2;
}
.tf-title::after {
  content: ''; display: block; width: 36px; height: 3px;
  background: var(--color-accent); border-radius: 999px; margin-top: 0.55rem;
}
.tf-desc { font-size: 0.95rem; color: rgba(255,255,255,0.65); line-height: 1.85; max-width: 38ch; }
.tf-item + .tf-item::before {
  content: ''; position: absolute; top: 0; left: 8%; right: 8%;
  height: 1px; background: rgba(255,255,255,0.06);
}
@media (max-width: 768px) {
  .tf-item { grid-template-columns: 1fr; }
  .tf-item--flip .tf-media, .tf-item--flip .tf-body { order: 0; }
  .tf-item:nth-child(even) { margin-top: 0; }
  .tf-body, .tf-item--flip .tf-body { padding: 1.5rem 1rem; }
  .tf-num { font-size: 2.5rem; }
  .tf-desc { max-width: none; }
}

/* ──────────────────────── 6. Bento gallery ──────────────────────── */
.bg { background: #fff; padding-bottom: var(--space-section-y); }
.bg__head { padding-block: var(--space-section-y) 2rem; }
.bg__label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--color-text-muted); margin-bottom: 0.85rem;
}
.bg__intro { display: flex; gap: 3rem; align-items: flex-start; }
.bg__h2 { flex: 0 0 auto; max-width: 15ch; font-size: clamp(1.45rem, 2.8vw, 2.1rem); font-weight: 800; line-height: 1.15; }
.bg__sub {
  flex: 1; max-width: 46ch; font-size: 0.97rem; line-height: 1.8;
  color: var(--color-text-secondary); padding-top: 0.25rem;
}
.bg__body {
  max-width: 1320px; margin-inline: auto;
  padding-inline: clamp(1.25rem, 3vw, 3rem);
  display: flex; flex-direction: column; gap: 2rem;
}
.bg__row { display: flex; gap: 1.5rem; align-items: flex-start; }
.bg__row--full .bg__cell { flex: 1; }
.bg__row--half .bg__cell { flex: 1 1 0; min-width: 0; }
.bg__cell { display: flex; flex-direction: column; gap: 0.9rem; }
.bg__imgbox { overflow: hidden; border-radius: var(--radius-card); line-height: 0; }
.bg__img { display: block; width: 100%; height: auto; transition: transform 0.5s cubic-bezier(.4,0,.2,1); }
.bg__cell:hover .bg__img { transform: scale(1.03); }
.bg__text { padding-inline: 0.25rem; }
.bg__title { font-size: 1rem; font-weight: 700; color: var(--color-primary); margin-bottom: 0.35rem; }
.bg__desc { font-size: 0.88rem; line-height: 1.78; color: var(--color-text-secondary); }

@media (min-width: 1024px) {
  .bg__row--full .bg__cell { flex-direction: row; gap: 2.5rem; align-items: center; }
  .bg__row--full .bg__imgbox { flex: 0 0 72%; }
  .bg__row--full .bg__text { flex: 1; }
  .bg__row--full .bg__title { font-size: 1.2rem; margin-bottom: 0.6rem; }
  .bg__row--full .bg__desc { font-size: 0.93rem; }
}
@media (max-width: 640px) {
  .bg__intro { flex-direction: column; gap: 0.6rem; }
  .bg__h2 { max-width: none; }
  .bg__row--half { flex-direction: column; }
  .bg__body { gap: 1.5rem; }
}

/* ──────────────────────────── 7. Why us ─────────────────────────── */
.whyus__title {
  text-align: center; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: var(--text-h2); color: #fff; margin-bottom: 2.5rem;
}
.whyus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.whyus__item {
  padding: 1.5rem; border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-card);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.whyus__item:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.04); }
.whyus__item h3 { color: #fff; font-size: var(--text-h4); margin-bottom: 0.5rem; }
.whyus__item p { color: rgba(255,255,255,0.7); font-size: 0.9rem; line-height: 1.6; }

/* ─────────────────────── 8. Lead section ─────────────────────── */
.leadwrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.5rem; align-items: start; }
.leadwrap__info p { color: var(--color-text-secondary); line-height: 1.8; }
.leadwrap__list {
  margin: 1rem 0; padding-left: 1.2rem; color: var(--color-text-secondary);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.leadwrap__hot { font-weight: 600; }
.leadwrap__hot a { color: var(--color-accent); font-size: 1.2rem; }
.leadwrap__form {
  background: var(--color-bg-light); padding: 1.5rem; border-radius: var(--radius-card);
  box-shadow: 0 26px 64px -34px rgba(0,32,90,.4); border: 1px solid var(--color-border);
}

/* ──────────────────────────── 9. FAQ ─────────────────────────── */
.faqwrap { max-width: 820px; }
.faq { display: flex; flex-direction: column; gap: 0.6rem; }
.faq__item {
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-card); padding: 0.5rem 1.2rem;
  transition: border-color .2s ease, box-shadow .25s ease;
}
.faq__item[open] { border-color: var(--color-primary); box-shadow: 0 12px 30px -20px rgba(0,48,130,.4); }
.faq__item summary {
  cursor: pointer; font-weight: 600; padding: 0.6rem 1.6rem 0.6rem 0;
  list-style: none; position: relative;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+'; position: absolute; right: 0; top: .5rem;
  font-size: 1.3rem; line-height: 1; color: var(--color-accent);
  transition: transform .25s ease;
}
.faq__item[open] summary { color: var(--color-primary); }
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { color: var(--color-text-secondary); padding-bottom: 0.75rem; line-height: 1.7; }

/* ─────────────────────── 10. Key visuals ─────────────────────── */
.kv { background: var(--color-bg-dark); }
.kv__head { padding-block: 2rem 1.25rem; text-align: center; }
.kv__head span {
  display: inline-block; color: #fff; text-transform: uppercase;
  letter-spacing: 0.12em; font-weight: 700; font-size: clamp(1.1rem, 2.5vw, 1.6rem);
}
.kv__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.kv__cell { margin: 0; overflow: hidden; aspect-ratio: 3 / 2; }
.kv__cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.45s ease; }
.kv__cell:hover img { transform: scale(1.05); }
@media (max-width: 900px) { .kv__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .kv__grid { grid-template-columns: repeat(2, 1fr); gap: 1px; } }

/* ────────────────────── 11. Sticky buy bar ────────────────────── */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
  border-top: 1px solid var(--color-border);
}
.buybar[hidden] { display: none; }
@media (min-width: 1025px) { .buybar { display: none !important; } }
.buybar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.6rem; }
.buybar__info { display: flex; flex-direction: column; line-height: 1.2; }
.buybar__info strong { font-size: 0.95rem; }
.buybar__info span { color: var(--color-price); font-weight: 700; }
.buybar__from { font-style: normal; font-size: 0.7rem; font-weight: 400; color: var(--color-text-secondary); display: block; }
.buybar__btns { display: flex; gap: 0.5rem; }
.buybar__btn {
  padding: 0.55rem 1.1rem; border-radius: var(--radius-btn);
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.buybar__btn--phone { border: 1px solid var(--color-primary); color: var(--color-primary); }
.buybar__btn--primary { background: var(--color-accent); color: #fff; }

/* ──────────────────── 12. Scroll reveal ──────────────────── */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
}
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-d="1"] { transition-delay: .09s; }
[data-reveal][data-d="2"] { transition-delay: .18s; }
[data-reveal][data-d="3"] { transition-delay: .27s; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ──────────────────── 13. Responsive chung ──────────────────── */
@media (max-width: 900px) {
  .trims, .trims--3, .leadwrap { grid-template-columns: 1fr; }
  .whyus { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .whyus { grid-template-columns: 1fr; }
}
