/* DriveHive — services listing page (light catalogue layout) */

.page-services {
  --svc-bg: #f0f2f6;
  --svc-surface: #ffffff;
  --svc-ink: #12151c;
  --svc-ink-soft: #5c6575;
  --svc-line: rgba(18, 21, 28, 0.1);
  --svc-media: #1a1f28;
  background: var(--svc-bg);
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

/* Visit cart replaces sticky bar — need real space for the bar + home indicator */
.page-services.visit-cart-active {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 768px) {
  .page-services {
    padding-bottom: 0;
  }

  .page-services.visit-cart-active {
    padding-bottom: 0;
  }
}

/* Keep header / drawer / sticky bar identical to homepage (don’t inherit light page text colour) */
.page-services .header {
  color: var(--white);
  background: rgba(6, 6, 8, 0.55);
}

.page-services .header.is-scrolled {
  background: rgba(8, 9, 12, 0.88);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.page-services .nav-drawer,
.page-services .sticky-bar {
  color: var(--white);
}

.svc-main {
  color: var(--svc-ink);
  /* Match fixed header + notch (header uses padding-top: safe-area) */
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  /* Keep dark footer below the fold on short viewports so it doesn’t read as a second header */
  min-height: calc(100svh - var(--header-h) - env(safe-area-inset-top, 0px));
}

.page-services .footer {
  margin-top: 0;
}

@media (max-width: 899px) {
  .svc-main {
    padding-top: calc(var(--header-h-mobile) + env(safe-area-inset-top, 0px));
    min-height: calc(100svh - var(--header-h-mobile) - env(safe-area-inset-top, 0px));
  }
}

/* Hero banner — same photo as homepage */
.svc-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(18rem, 42dvh, 28rem);
  background: var(--black);
}

.svc-hero-bg {
  position: absolute;
  inset: 0;
}

.svc-hero-bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.svc-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(6, 6, 8, 0.55) 0%,
      rgba(6, 6, 8, 0.25) 35%,
      rgba(6, 6, 8, 0.75) 72%,
      rgba(6, 6, 8, 0.92) 100%
    ),
    linear-gradient(90deg, rgba(6, 6, 8, 0.82) 0%, rgba(6, 6, 8, 0.15) 58%);
}

.svc-hero-inner {
  position: relative;
  z-index: 1;
  padding: 2.5rem var(--gutter) 3rem;
  max-width: 42rem;
}

.svc-hero-inner > * {
  opacity: 0;
  transform: translate3d(0, 1rem, 0);
  transition:
    opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-services.is-ready .svc-hero-inner > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.page-services.is-ready .svc-hero-inner > *:nth-child(1) {
  transition-delay: 0.04s;
}

.page-services.is-ready .svc-hero-inner > *:nth-child(2) {
  transition-delay: 0.1s;
}

.page-services.is-ready .svc-hero-inner > *:nth-child(3) {
  transition-delay: 0.16s;
}

.svc-breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(248, 249, 252, 0.85);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.svc-breadcrumb a {
  color: var(--accent-bright);
  text-decoration: none;
}

.svc-breadcrumb a:hover {
  text-decoration: underline;
}

.svc-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--white);
}

.svc-hero-lead {
  margin: 1.25rem 0 0;
  max-width: 38ch;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(248, 249, 252, 0.82);
}

/* Category carousel */
.svc-categories {
  padding: 2rem 0 0;
  background: var(--svc-bg);
}

.svc-categories-inner {
  position: relative;
}

.svc-cat-track-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 0.5rem;
}

.svc-cat-track-wrap::-webkit-scrollbar {
  display: none;
}

.svc-cat-track {
  display: flex;
  gap: 0.85rem;
  width: max-content;
  min-width: 100%;
  padding-bottom: 0.25rem;
}

.svc-cat-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 7.5rem;
  padding: 1.15rem 0.85rem;
  border: 1px solid var(--svc-line);
  border-radius: var(--radius-lg);
  background: var(--svc-surface);
  color: var(--svc-ink);
  cursor: pointer;
  transition:
    border-color 0.22s var(--ease),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.svc-cat-card:hover,
.svc-cat-card.is-active {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.svc-cat-card.is-active .svc-cat-icon {
  color: var(--accent);
}

.svc-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  color: var(--svc-ink);
  background: rgba(245, 158, 11, 0.1);
  border-radius: 12px;
}

.svc-cat-icon svg {
  width: 2.35rem;
  height: 2.35rem;
}

.svc-cat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.svc-cat-nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.svc-cat-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--svc-line);
  border-radius: 50%;
  background: var(--svc-surface);
  color: var(--svc-ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.svc-cat-arrow:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: #fffbeb;
}

/* Toolbar & grid */
.svc-results {
  padding: 1.75rem 0 4rem;
}

.svc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.svc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.svc-filter {
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--svc-ink-soft);
  background: var(--svc-surface);
  border: 1px solid var(--svc-line);
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s;
}

.svc-filter:hover {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--svc-ink);
}

.svc-filter.is-active {
  color: var(--black);
  background: var(--accent);
  border-color: var(--accent);
}

.svc-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--svc-ink-soft);
}

.svc-sort-select {
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--svc-ink);
  background: var(--svc-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%235c6575' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 0.65rem center;
  border: 1px solid var(--svc-line);
  border-radius: 999px;
  appearance: none;
  cursor: pointer;
}

.svc-count {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--svc-ink-soft);
}

.svc-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .svc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .svc-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .svc-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.svc-card {
  display: flex;
  flex-direction: column;
  background: var(--svc-surface);
  border: 1px solid var(--svc-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s ease,
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.svc-card-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: var(--svc-media);
}

.svc-card-icon {
  display: flex;
  color: rgba(248, 249, 252, 0.9);
}

.svc-card-icon svg {
  width: 4rem;
  height: 4rem;
  opacity: 0.92;
}

.svc-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--accent-bright);
  border-radius: 4px;
  transform: rotate(8deg);
}

.svc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.2rem 1.25rem;
}

.svc-card-rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}

.svc-stars {
  display: inline-flex;
  gap: 1px;
  color: #d1d5db;
}

.svc-star.is-filled {
  color: var(--accent);
}

.svc-reviews {
  color: var(--svc-ink-soft);
  font-weight: 500;
}

.svc-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.svc-card-price {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.svc-card-blurb {
  margin: 0.5rem 0 0;
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--svc-ink-soft);
}

.svc-card--in-visit {
  box-shadow: 0 0 0 2px var(--amber);
}

.svc-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.svc-card-add {
  flex: 1;
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
}

.svc-card-add.is-added {
  background: #1e4620;
  color: #fff;
  border-color: #1e4620;
}

.svc-card-add.is-added:hover {
  background: #163a18;
  border-color: #163a18;
}

.svc-card-btn {
  flex: 1;
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
}

.svc-card-btn-secondary {
  flex: 0 0 auto;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--svc-ink);
  border-color: var(--svc-line);
  background: transparent;
}

.svc-card-btn-secondary:hover {
  background: var(--svc-bg);
  border-color: rgba(18, 21, 28, 0.2);
}

.page-services .btn-primary {
  color: var(--black);
}

/* Back to top */
.svc-top {
  position: fixed;
  right: 1rem;
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  box-shadow: 0 8px 28px var(--amber-glow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    visibility 0.25s;
}

.svc-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (min-width: 768px) {
  .svc-top {
    bottom: 1.5rem;
  }
}

/* Visit cart — sticky hand-off to booking */
.visit-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(4.5rem + env(safe-area-inset-bottom));
  z-index: 95;
  padding: 0.75rem var(--gutter);
  background: rgba(12, 14, 18, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
}

.visit-cart-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.visit-cart-summary {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
}

.page-services.visit-cart-active .sticky-bar {
  display: none;
}

@media (max-width: 767px) {
  /* Sticky Call/Book row is hidden — dock visit cart to the bottom (no dead gap) */
  .page-services.visit-cart-active .visit-cart-bar {
    bottom: 0;
    padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
  }

  .page-services.visit-cart-active .svc-top {
    bottom: calc(6.25rem + env(safe-area-inset-bottom));
  }
}

@media (min-width: 768px) {
  .visit-cart-bar {
    bottom: 0;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }

  .page-services.visit-cart-active .svc-top {
    bottom: 5.5rem;
  }
}

/* Catalogue → booking hand-off */
.svc-book-bridge {
  background: linear-gradient(180deg, var(--svc-bg) 0%, #12151c 100%);
  padding: 1rem 0 0.5rem;
  text-align: center;
}

.page-services .section-book {
  padding-block: clamp(1.25rem, 4vw, 2.75rem);
  border-top: none;
}

.page-services .book-header--compact {
  margin-bottom: 1rem;
}

@media (max-width: 767px) {
  .page-services .book-header--compact {
    margin-bottom: 0.75rem;
  }

  .page-services .book-header-aside {
    display: none;
  }

  .page-services .book-header-main .book-lead,
  .page-services .book-header-main .book-signin-hint {
    display: none;
  }

  .page-services .book-header-main .display {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    margin-bottom: 0;
  }

  .page-services .book-header-main .eyebrow {
    margin-bottom: 0.35rem;
  }
}

@media (min-width: 768px) {
  .page-services .book-header--compact {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
  }
}

.svc-book-bridge-inner {
  max-width: 22rem;
  margin-inline: auto;
}

.svc-book-bridge-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(248, 249, 252, 0.88);
}

.svc-book-bridge-text--active {
  color: var(--white);
}

.svc-book-bridge-text--active [data-bridge-job-title] {
  color: var(--amber-bright);
}

.svc-book-bridge-signin {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.85;
}

.svc-book-bridge-signin a {
  color: var(--amber-bright);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (min-width: 768px) {
  .svc-book-bridge-signin {
    display: none;
  }
}

.svc-book-bridge-icon {
  display: block;
  margin: 0 auto 0.5rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--amber-bright);
}

.svc-book-bridge-icon--bounce {
  animation: svc-bridge-bounce 1.25s ease-in-out infinite;
}

@keyframes svc-bridge-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(8px);
    opacity: 0.85;
  }
}

.svc-book-bridge.is-bridge-active .svc-book-bridge-icon:not(.svc-book-bridge-icon--bounce) {
  opacity: 0.35;
}

.page-services .book-signin-hint {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
  color: rgba(248, 249, 252, 0.65);
}

.page-services .book-signin-hint a {
  color: var(--amber-bright);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-services .book-signin-hint a:hover {
  color: var(--amber);
}

.svc-book-cta {
  background: linear-gradient(165deg, #1a1f28 0%, var(--black) 100%);
  color: var(--white);
  padding: clamp(2rem, 5vw, 3rem) 0;
  border-top: 1px solid var(--line);
}

.svc-book-cta-inner {
  text-align: center;
  max-width: 28rem;
  margin-inline: auto;
}

.svc-book-cta-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
}

.svc-book-cta-text {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(248, 249, 252, 0.75);
}

@media (hover: hover) and (pointer: fine) {
  .svc-card:hover {
    transform: translateY(-4px);
    border-color: rgba(18, 21, 28, 0.14);
    box-shadow: 0 18px 44px rgba(18, 21, 28, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .svc-hero-inner > *,
  .page-services.is-ready .svc-hero-inner > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .svc-card {
    transition: none;
  }

  .svc-card:hover {
    transform: none;
    box-shadow: none;
  }

  .svc-cat-card {
    transition: none;
  }

  .svc-cat-card:hover,
  .svc-cat-card.is-active {
    transform: none;
  }
}
