/* Branch detail pages: storefront photography, contact facts and workshop views.
   Shared brand colors and type remain owned by styles.css. */
.branch-page .section {
  padding-block: 48px;
}

.branch-page .home-section-head {
  margin-bottom: 24px;
}

.branch-page .home-section-head h2 {
  max-width: none;
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.branch-page .branch-hero {
  padding-top: 30px;
  padding-bottom: 24px;
  border-bottom: 0;
}

.branch-page .branch-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
}

.branch-page .branch-hero h1 {
  max-width: 19ch;
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 3.6vw, 3.1rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.branch-page .branch-hero .hero-text {
  max-width: 52ch;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.branch-page .hero-actions {
  gap: 10px;
}

.branch-page .hero-actions .btn {
  min-height: 46px;
  padding: 11px 15px;
  border-radius: 6px;
  font-size: 14px;
}

.branch-hero-photo picture {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--soft);
}

.branch-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* a navy card: the branch on Google Maps on the left, address, phone, hours and e-mail on the right */
.branch-page .branch-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  margin-top: 28px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  color: var(--white);
  background: var(--navy);
  box-shadow: none;
}

.branch-page .branch-summary-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 28px 32px;
  padding: 36px 40px;
}

.branch-page .branch-summary-list a {
  color: var(--white);
}

.branch-page .branch-summary-list a:hover {
  color: var(--orange-2);
}

.branch-page .branch-map {
  min-height: 320px;
  background: var(--navy-2);
}

.branch-page .branch-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
}

.branch-page .branch-summary-list div {
  padding: 0;
  border: 0;
}

.branch-page .branch-summary-list dt {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 400;
}

.branch-page .branch-summary-list dd {
  color: var(--white);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.branch-page .branch-gallery-section,
.branch-page .branch-related {
  background: var(--white);
}

/* Photograph groups share a clean edge, without captions or decorative card shells. */
.branch-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.branch-photos--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.branch-photo {
  min-width: 0;
  margin: 0;
}

.branch-photo picture {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  background: var(--soft);
}

.branch-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.branch-photo--portrait img {
  object-position: center 58%;
}

.branch-page .branch-process {
  color: var(--white);
  background: var(--navy);
}

.branch-page .branch-process h2 {
  color: var(--white);
}

.branch-process-flow {
  position: relative;
}

.branch-process-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.branch-process-track path {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.branch-track-base { stroke: #3b526d; }
.branch-track-progress { stroke: #f4511e; }

.branch-process-car {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

.branch-process-flow.is-ready .branch-track-progress {
  transition: stroke-dashoffset 1.5s ease-in-out;
}

.branch-process-flow.is-ready .branch-process-car {
  transition: transform 1.5s ease-in-out, opacity 0.2s;
}

.branch-process-flow.is-moving .branch-process-car { opacity: 1; }
.branch-process-flow.is-resetting .branch-track-progress,
.branch-process-flow.is-resetting .branch-process-car { transition: none; }

.branch-process-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.branch-process-list li {
  min-width: 0;
  padding-right: 28px;
}

.branch-step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  border: 1px solid #738398;
  border-radius: 50%;
  color: #e3e8f0;
  background: var(--navy);
  font-size: 16px;
  font-weight: 600;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}

.branch-process-list li.is-current .branch-step-number {
  border-color: #f4511e;
  color: #fff;
  background: #b83b16;
  box-shadow: 0 0 0 6px rgba(244, 81, 30, 0.15);
}

.branch-process-list li.is-complete .branch-step-number {
  border-color: #f4511e;
  color: #ffb297;
}

.branch-process-list h3 {
  margin: 0 0 8px;
  color: var(--white);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
}

.branch-process-list p {
  margin: 0;
  color: #d5dce6;
  font-size: 14px;
  line-height: 1.65;
}

@media (max-width: 700px) {
  .branch-process-list { grid-template-columns: 1fr; gap: 30px; }
  .branch-process-list li { display: flex; align-items: start; gap: 20px; padding: 0; }
  .branch-step-number { flex: 0 0 40px; margin: 0; }
  .branch-step-copy { padding-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .branch-step-number,
  .branch-process-flow.is-ready .branch-track-progress,
  .branch-process-flow.is-ready .branch-process-car { transition: none; }
  .branch-process-car { display: none; }
}

.branch-page .faq-list p {
  font-size: 15px;
}

.branch-page .branch-related .bayi-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

/* a real photo of the branch (or the workshop for a district card) above each card */
.branch-page .branch-related .bayi-card-media {
  display: block;
  margin-bottom: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: #f4f6f9;
}

.branch-page .branch-related .bayi-card-media picture,
.branch-page .branch-related .bayi-card-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.branch-page .branch-related .bayi-card-media img {
  object-fit: cover;
  transition: transform 0.8s ease;
}

.branch-page .branch-related .bayi-card-media:hover img {
  transform: scale(1.03);
}

.branch-page .branch-related .bayi-name {
  font-size: 16px;
  font-weight: 600;
}

.branch-page .branch-related .bayi-card p {
  font-size: 13px;
  line-height: 1.6;
}

.branch-page .branch-related .bayi-card .bayi-detail {
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: var(--white);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  transition: border-color 160ms ease, background 160ms ease;
  box-shadow: none;
}

.branch-page .branch-related .bayi-card .bayi-detail:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: #f4f6f9;
  transform: none;
}

/* side by side but narrow: one column of details so the e-mail never breaks */
@media (min-width: 901px) and (max-width: 1100px) {
  .branch-page .branch-summary-list {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 900px) {
  .branch-page .branch-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .branch-page .branch-summary {
    grid-template-columns: 1fr;
  }

  /* details first, the map underneath */
  .branch-page .branch-summary-list {
    order: -1;
    gap: 18px 28px;
    padding: 26px 22px;
  }

  .branch-page .branch-map,
  .branch-page .branch-map iframe {
    min-height: 280px;
  }

  .branch-photos {
    gap: 14px;
  }

}

@media (max-width: 600px) {
  .branch-page .section {
    padding-block: 30px;
  }

  .branch-page .home-section-head {
    margin-bottom: 18px;
  }

  .branch-page .branch-hero {
    padding-top: 24px;
  }

  .branch-page .hero-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .branch-page .hero-actions .btn {
    width: auto;
  }

  .branch-page .branch-summary-list {
    grid-template-columns: 1fr;
  }

  .branch-photos,
  .branch-photos--three {
    grid-template-columns: 1fr;
    gap: 14px;
  }

}

.branch-process-flow.is-paused .branch-track-progress,
.branch-process-flow.is-paused .branch-process-car {
  transition: none;
}
