/**
 * Styles for Truck Sequence + Services Section Overlay
 */

.truck-sequence {
  position: relative;
  height: 450vh;
  background-color: #ffffff;
  z-index: 2;
}

.truck-sequence__sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Upper track area (White background where truck moves) */
.truck-track-zone {
  position: relative;
  width: 100%;
  height: 32vh;
  min-height: 220px;
  max-height: 340px;
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* Giant background typography ("OUR SERVICES") */
.truck-bg-text {
  position: absolute;
  top: 50%;
  left: 5%;
  transform: translate3d(0, -50%, 0);
  font-family: 'Syne', sans-serif;
  font-size: clamp(4.31rem, 12.08vw, 12.94rem);
  font-weight: 800;
  color: rgba(0, 0, 0, 0.07);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  user-select: none;
  will-change: transform;
}

/* Truck Visual Wrapper */
.truck-visual-wrapper {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 92%;
  aspect-ratio: auto; /* Let the image dictate width */
  z-index: 10;
  will-change: transform;
}

/* Static Truck Image */
#truck-image {
  position: relative;
  height: 100%;
  width: auto;
  max-width: none;
  pointer-events: none;
  display: block;
}

/* Tire Styles */
.truck-tire {
  position: absolute;
  height: 27%; /* Increased height to match real tires */
  width: auto;
  max-width: none;
  aspect-ratio: 1/1;
  pointer-events: none;
  will-change: transform;
  transform: translateX(-50%); /* Center the tire on its left coordinate */
  transform-origin: 50% 50%;
}

/* Approximate tire positions based on standard tractor-trailer */
.front-tire { bottom: 0.2%; left: 84.5%; }
.back-tire-1 { bottom: 0.2%; left: 67.5%; }
.back-tire-2 { bottom: 0.2%; left: 59.5%; }
.back-tire-3 { bottom: -0.5%; left: 33.5%; }
.back-tire-4 { bottom: -0.5%; left: 26.5%; }
.back-tire-5 { bottom: -0.5%; left: 19.5%; }

/* Lower content area (Dark black background) */
.truck-content-zone {
  flex: 1;
  background-color: #0c0c0c;
  color: #ffffff;
  padding: 3.5rem 0 2.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 1px solid #1a1a1a;
}

.truck-content-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Horizontal Sliding Services Track (Right-to-Left motion on scroll) */
.truck-services-overflow {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 1rem;
}

.truck-services-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

/* Hero Statement Card (Shown when truck starts moving) */
.truck-hero-card {
  flex: 0 0 clamp(420px, 38vw, 620px);
  width: clamp(420px, 38vw, 620px);
  padding: 0 3.5rem 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.truck-orbit-icon {
  margin-bottom: 1.25rem;
}

.truck-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.55rem, 2.76vw, 2.42rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}

.truck-heading__main {
  color: #ffffff;
  display: block;
}

.truck-heading__sub {
  color: #4a4a4a;
  display: block;
  margin-top: 0.15em;
}

.truck-service-card {
  flex: 0 0 clamp(320px, 26vw, 420px);
  width: clamp(320px, 26vw, 420px);
  padding: 0 2.25rem 0 2rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.truck-service-card:first-child {
  border-left: none;
  padding-left: 0;
}

.truck-service-icon {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  height: 44px;
}

.truck-service-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(0.99rem, 1.46vw, 1.33rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 1rem 0;
}

.truck-service-desc {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.76rem;
  line-height: 1.55;
  color: #8c8c8c;
  margin: 0;
}

.truck-footer {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn--pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  font-family: 'Syne', sans-serif;
  font-size: 0.69rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.25s ease;
  background: transparent;
}

.btn--pill:hover {
  border-color: #ffffff;
  background-color: #ffffff;
  color: #0c0c0c;
  transform: translateY(-2px);
}

/* Responsive tweaks */
@media (max-width: 991px) {
  .truck-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .truck-track-zone {
    height: 18vh;
    min-height: 120px;
  }
}

@media (max-width: 768px) {
  .truck-track-zone {
    height: 18vh;
    min-height: 120px;
  }

  .truck-visual-wrapper {
    height: 65px !important;
  }

  .truck-heading {
    font-size: clamp(1.55rem, 5.18vw, 2.42rem);
  }

  .truck-body {
    font-size: 0.82rem;
  }
}

/* Truck Visual Wrapper restored */
.truck-visual-wrapper {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 92%;
  aspect-ratio: auto;
  z-index: 10;
  will-change: transform;
}

/* Straight Road Top-Down Truck Sequence */
.topdown-road-sequence {
  position: relative;
  width: 100%;
  height: 250vh; /* Tall section for scroll duration */
  background-color: #ffffff; /* White sides as requested */
  z-index: 2;
}

.topdown-road-container {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  max-width: 100%;
  /* Removed overflow: hidden so the truck can drive onto the ship */
  display: flex;
  justify-content: center;
}

.straight-road-bg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40vw;
  max-width: 175px; /* Slightly zoomed in road */
  height: 100%;
  background-color: #0c0c0c; /* Solid dark road */
  background-image: url('../Assets/read-sides.svg');
  background-repeat: repeat-y; 
  background-position: center;
  background-size: 100% auto; /* Road texture fits exactly to width */
  will-change: background-position;
}

.topdown-truck-assembly {
  position: absolute;
  top: -15vh; /* JS will control this */
  left: 50%;
  margin-left: -25px; /* Exactly half of width 50px to center it */
  width: 50px; /* Slightly zoomed in truck */
  z-index: 2;
  will-change: top;
}

.topdown-truck-assembly .truck-container-part {
  width: 100%; 
  height: auto;
  display: block;
  position: absolute;
  top: 0; /* Align to the top edge (rear) of the flatbed */
  left: 0;
  z-index: 2; /* Container goes over the flatbed */
}

.topdown-truck-assembly .truck-head-part {
  width: 100%;
  height: auto;
  display: block;
  position: relative; /* Gives the assembly intrinsic height */
  z-index: 1; /* Head goes under the container */
}

/* Layout Positioning for Text Panels */
.topdown-left-sticky {
  position: absolute;
  top: 50%;
  left: 5%;
  transform: translateY(-50%);
  width: 35%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 10;
}

.topdown-right-scrolling {
  position: absolute;
  top: 0;
  right: 5%;
  width: 35%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  z-index: 10;
  padding: 10vh 0;
}

/* Typography styles matching screenshot */
.topdown-speed {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.69rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.topdown-main-heading {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: clamp(1.55rem, 3.02vw, 2.59rem); /* Reduced from 2.5rem-4.5rem */
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
  margin-bottom: 2rem; /* Reduced from 4rem */
}

.topdown-main-heading .heading-gray {
  color: #a3a3a3;
}

.topdown-main-heading .heading-black {
  color: #111111;
}

.topdown-desc {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #111;
  font-weight: 600;
  max-width: 350px;
}

.right-feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 320px;
}

.feature-heading {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: clamp(1.03rem, 1.73vw, 1.55rem);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  color: #111;
  margin-bottom: 1rem;
}

.feature-desc {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.74rem;
  line-height: 1.4;
  color: #333;
}

.feature-divider {
  width: 100%;
  height: 1px;
  background-color: #eaeaea;
  margin: 0;
}

@media (max-width: 768px) {
  /* Truck Sequence Mobile Layout */
  .straight-road-bg {
    left: 0;
    transform: none;
    width: 70px;
  }
  
  .topdown-truck-assembly {
    left: 35px;
    margin-left: -17px;
    width: 34px;
  }
  
  .topdown-left-sticky {
    display: none !important;
  }

  .topdown-mobile-heading {
    display: block !important;
    margin-bottom: 4rem;
  }
  
  .topdown-right-scrolling {
    right: auto;
    left: 90px;
    width: calc(100% - 110px);
    padding: 10vh 0 50vh 0;
  }
  
  .topdown-main-heading {
    font-size: 1.73rem;
    margin-bottom: 1rem;
  }
  
  .right-feature-item {
    margin-bottom: 2rem;
  }
}
