/*
 * Get Estimate - the estimator (js/estimate.js) and the popup it opens in.
 * Used by index.php (popup) and get-estimate.php (inline). Every class is
 * prefixed te- so nothing here meets bootstrap's .row/.btn/.card on index.php.
 */
.te-est,
.te-modal {
  --te-ink: #001f2a;
  --te-deep: #003547;
  --te-brand: #0a3f52;
  --te-muted: #3f5f6b;
  --te-soft: #f1f8fb;
  --te-line: #e3e8ea;
  --te-accent: #fc9400;
  --te-ok: #1e7a46;
  --te-bad: #8a1c12;
  --te-bad-bg: #fdecea;
  --te-teal: #0b6f86;
  --te-go: #12957a; /* pickup pin */
  --te-stop: #e5484d; /* delivery pin */
}

.te-est {
  font-family: inherit;
  color: var(--te-muted);
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

.te-est *,
.te-modal * {
  box-sizing: border-box;
}

.te-hidden {
  display: none !important;
}

/* ---------- popup shell ---------- */

.te-modal {
  position: fixed;
  inset: 0;
  z-index: 100500; /* index.php's header and backdrop sit at 99999 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 31, 42, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.te-modal.te-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease;
}

.te-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 31, 42, 0.35);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.te-modal.te-open .te-dialog {
  transform: none;
}

.te-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--te-line);
}

.te-dialog-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--te-deep);
}

.te-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--te-line);
  border-radius: 50%;
  background: #fff;
  color: var(--te-deep);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.te-close:hover {
  border-color: var(--te-deep);
}

.te-dialog-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 20px 24px 24px;
  /* Scrolls by wheel, touch and keys as usual, with no scrollbar showing. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.te-dialog-body::-webkit-scrollbar {
  display: none;
}

/* Phones: the popup takes the whole screen, like an app sheet. */
@media (max-width: 575px) {
  .te-modal {
    padding: 0;
    align-items: stretch;
  }

  .te-dialog {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
  }

  .te-dialog-head {
    padding: 14px 16px 10px;
  }

  .te-dialog-head h2 {
    font-size: 19px;
  }

  .te-dialog-body {
    padding: 16px;
    /* Clear of the home bar on phones that have one. */
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

body.te-locked {
  overflow: hidden;
}

/* ---------- screens: one step at a time, with Back (the browser Back too) ---------- */

.te-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 14px;
}

.te-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 7px 14px 7px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--te-deep);
  background: #fff;
  border: 1px solid var(--te-line);
  border-radius: 50px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.te-back span {
  font-size: 20px;
  line-height: 0.8;
}

.te-back:hover {
  border-color: var(--te-deep);
  background: var(--te-soft);
}

.te-screen-head {
  margin-bottom: 16px;
}

.te-screen-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--te-deep);
  outline: none;
}

.te-screen-sub {
  margin: 2px 0 0;
  font-size: 14px;
  color: var(--te-muted);
}

/* Forward slides in from the right, Back from the left. */
.te-screen.te-enter {
  animation: te-in-right 0.25s ease both;
}

.te-screen.te-enter-back {
  animation: te-in-left 0.25s ease both;
}

@keyframes te-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes te-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 575px) {
  .te-screen-title {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .te-screen.te-enter,
  .te-screen.te-enter-back {
    animation: none;
  }
}

/* ---------- estimator ---------- */

.te-step-label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--te-muted);
}

.te-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

/* Phones: every choice one under the other. */
@media (max-width: 575px) {
  .te-choices {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }
}

.te-choice {
  display: block;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  font: inherit;
  text-align: left;
  color: var(--te-muted);
  background: var(--te-soft);
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.te-choice:hover {
  border-color: var(--te-line);
}

.te-choice b {
  display: block;
  font-size: 17px;
  color: var(--te-deep);
}

.te-choice small {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.45;
}

.te-choice[aria-pressed="true"] {
  background: #fff;
  border-color: var(--te-ink);
  box-shadow: 0 4px 16px rgba(0, 53, 71, 0.12);
}

/* ---------- vehicle picture cards (Book Truck / Book Tempo) ---------- */

/* The first screen's heading, with a short accent bar over it. */
.te-screen[data-screen="vehicle"] .te-screen-head::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  margin-bottom: 12px;
  border-radius: 4px;
  background: var(--te-go);
}

.te-screen[data-screen="vehicle"] .te-screen-title {
  font-size: 24px;
}

/* Two side by side - it is the first, main choice. */
.te-choices.te-vehicles {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 4px;
}

/* Each card has its own tone - green for the truck, blue for the tempo -
   and its own scene behind the vehicle (images/estimate/*-bg): Mumbai's
   seafront road for the truck, a soft skyline for the tempo. */
.te-vehicle {
  --te-tone: var(--te-go);
  --te-tone-soft: #e2f4ef;
  --te-tone-wash: #eaf6f4;
  --te-scene: url("../images/estimate/truck-bg.webp");
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 14px;
  text-align: left;
  background: #fff;
  border: 2px solid var(--te-line);
  border-radius: 20px;
  overflow: hidden;
}

.te-vehicle-tempo {
  --te-tone: #3554d1;
  --te-tone-soft: #e6ebfb;
  --te-tone-wash: #edf2fb;
  --te-scene: url("../images/estimate/tempo-bg.webp");
}

/* The text under the scene keeps off the card's edges. */
.te-vehicle > .te-route-pill,
.te-vehicle > b,
.te-vehicle > small {
  position: relative;
  z-index: 1;
  margin-left: 16px;
  margin-right: 16px;
}

/* A round check in the corner: empty, filled once the card is chosen. */
.te-vehicle-check {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border: 2px solid #cfd9dd;
  border-radius: 50%;
  background: #fff;
  transition: border-color 0.2s, background-color 0.2s;
}

.te-vehicle:hover .te-vehicle-check {
  border-color: var(--te-tone);
}

.te-vehicle[aria-pressed="true"] .te-vehicle-check {
  border-color: var(--te-tone);
  background: var(--te-tone) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* The scene: the background picture with the vehicle standing on its road
   or floor, fading into the white card at the bottom, where the route pill
   sits over it. */
.te-vehicle-img {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  aspect-ratio: 2 / 1;
  margin-bottom: -12px;
  /* Lifts the wheels off the card's edge, onto the road (a share of the
     width, so it keeps the same place at every size). */
  padding-bottom: 6%;
  background: var(--te-tone-wash);
}

/* The scene itself, kept quiet so the vehicle stands out: less colour,
   brighter, and partly see-through onto the card's pale tone. */
.te-vehicle-img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--te-scene) center bottom / cover no-repeat;
  filter: saturate(0.6) brightness(1.08);
  opacity: 0.6;
  pointer-events: none;
}

/* Over the scene, under the vehicle: a light haze, then a road for the
   vehicle to stand on - a soft grey band with a kerb along its top and a
   dashed lane line - fading to white at the very bottom for the text.
   Layers, top first: the white fade, the lane line, the kerb, the road,
   the haze. */
.te-vehicle-img::after {
  content: "";
  position: absolute;
  /* 1px past the bottom, so no sliver of the scene shows under the fade
     when the box lands on a part-pixel height. */
  inset: 0 0 -1px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 45%, #fff 100%) left bottom / 100% 20% no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0 22px, rgba(255, 255, 255, 0) 22px 44px) left bottom 16% / 100% 3px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(205, 214, 219, 0.9)) left bottom 30% / 100% 4px no-repeat,
    linear-gradient(180deg, rgba(150, 163, 171, 0.75) 0%, rgba(176, 187, 194, 0.7) 100%) left bottom / 100% 30% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
  pointer-events: none;
}

.te-vehicle-img picture {
  position: relative;
  z-index: 1;
  display: block;
  /* The images are trimmed to the vehicle, with no empty margin of their
     own. */
  width: 56%;
  filter: drop-shadow(0 10px 10px rgba(0, 31, 42, 0.25));
}

.te-vehicle-img img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

/* The route, as a pill in the card's tone. */
.te-route-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  margin-bottom: 8px;
  padding: 5px 13px 5px 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: var(--te-tone);
  border-radius: 50px;
}

.te-route-pill svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.te-route-pill .te-arrow {
  width: 13px;
  height: 13px;
}

.te-vehicle b {
  font-size: 18px;
  line-height: 1.25;
}

.te-vehicle small {
  font-size: 14px;
}

.te-vehicle:hover {
  border-color: var(--te-tone);
  box-shadow: 0 14px 28px -18px rgba(0, 53, 71, 0.5);
}

.te-vehicle:hover .te-vehicle-img img {
  transform: translateY(-3px) scale(1.03);
}

.te-vehicle[aria-pressed="true"] {
  border-color: var(--te-tone);
  box-shadow: 0 0 0 3px var(--te-tone-soft);
}

/* Phones: one card under the other (truck, then tempo), each a little
   tighter so both read without much scrolling. */
@media (max-width: 575px) {
  .te-dialog-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }

  .te-screen[data-screen="vehicle"]:not(.te-hidden) {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
  }

  .te-screen[data-screen="vehicle"] .te-screen-title {
    font-size: 20px;
  }

  .te-choices.te-vehicles {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 0;
  }

  .te-vehicle {
    padding: 0 0 12px;
  }

  .te-vehicle > .te-route-pill,
  .te-vehicle > b,
  .te-vehicle > small {
    margin-left: 14px;
    margin-right: 14px;
  }

  .te-vehicle-check {
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
  }

  .te-vehicle-img {
    aspect-ratio: 2 / 1;
  }

  .te-vehicle-img picture {
    width: 52%;
    max-width: 220px;
  }

  .te-vehicle b {
    font-size: 17px;
  }

  .te-vehicle small {
    font-size: 13px;
  }
}

.te-est button:focus-visible,
.te-est a:focus-visible,
.te-est input:focus-visible,
.te-est select:focus-visible,
.te-close:focus-visible {
  outline: 3px solid var(--te-accent);
  outline-offset: 2px;
}

.te-note {
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--te-soft);
}

.te-note b {
  color: var(--te-deep);
}

.te-pickup {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--te-line);
  border-radius: 16px;
}

.te-pickup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.te-pickup-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--te-deep);
}

.te-goods-row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.8fr 0.9fr 42px;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

/* Phones and small tablets: each goods row stacks - product (with its remove
   button beside it), size and qty, then weight - and a line parts the rows. */
@media (max-width: 680px) {
  .te-goods-row {
    grid-template-columns: 1fr 1fr 42px;
    grid-template-areas:
      "product product remove"
      "size qty qty"
      "weight weight weight";
    padding-top: 12px;
    border-top: 1px dashed var(--te-line);
  }

  .te-items .te-goods-row:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .te-goods-row .te-field:nth-child(1) { grid-area: product; }
  .te-goods-row .te-field:nth-child(2) { grid-area: size; }
  .te-goods-row .te-field:nth-child(3) { grid-area: qty; }
  .te-goods-row .te-field:nth-child(4) { grid-area: weight; }
  .te-goods-row .te-icon-btn { grid-area: remove; }

  /* A lone row has no remove button: the product takes its place. */
  .te-items.te-single .te-goods-row {
    grid-template-areas:
      "product product product"
      "size qty qty"
      "weight weight weight";
  }
}

.te-field {
  position: relative;
  min-width: 0;
}

.te-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--te-deep);
}

.te-field input,
.te-field select {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 8px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--te-ink);
  background: #fff;
  border: 1px solid #c9d3d7;
  border-radius: 10px;
}

.te-field select:disabled {
  background: #f5f7f8;
}

.te-link {
  padding: 6px 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--te-brand);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

.te-icon-btn {
  width: 42px;
  height: 44px;
  font: inherit;
  font-size: 18px;
  color: var(--te-muted);
  background: none;
  border: 1px solid var(--te-line);
  border-radius: 10px;
  cursor: pointer;
}

.te-icon-btn:hover {
  border-color: #c0392b;
  color: #c0392b;
}

.te-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.te-btn {
  display: inline-block;
  padding: 11px 28px;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--te-ink);
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.te-btn-dark {
  background: var(--te-ink);
  color: #fff;
}

.te-btn-dark:hover {
  background: #fff;
  color: var(--te-ink);
}

.te-btn-light {
  background: #fff;
  color: var(--te-ink);
}

.te-btn-light:hover {
  background: var(--te-brand);
  color: #fff;
  border-color: #fff;
}

.te-btn[disabled] {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 420px) {
  .te-actions .te-btn {
    width: 100%;
  }
}

.te-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 240px;
  margin: 4px 0 0;
  padding: 4px 0;
  overflow: auto;
  list-style: none;
  background: #fff;
  border: 1px solid #c9d3d7;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 53, 71, 0.15);
}

.te-suggest li {
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.te-suggest li:hover,
.te-suggest li.te-active {
  background: var(--te-soft);
}

.te-picked {
  margin-top: 4px;
  font-size: 13px;
  color: var(--te-ok);
}

.te-error {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--te-bad-bg);
  color: var(--te-bad);
}

.te-result {
  margin-top: 22px;
  padding: 22px;
  border-radius: 20px;
  background: var(--te-ink);
  color: #fff;
}

.te-result h3 {
  margin: 0 0 12px;
  font-size: 19px;
  color: #fff;
}

.te-result table {
  width: 100%;
  border-collapse: collapse;
  background: none;
}

.te-result td {
  padding: 9px 0;
  color: #fff;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.te-result td:last-child {
  padding-left: 12px;
  text-align: right;
  white-space: nowrap;
}

.te-result .te-disc td:last-child {
  color: #7fe0a5;
}

.te-result .te-total td {
  padding-top: 14px;
  font-size: 21px;
  font-weight: 700;
  border-bottom: 0;
}

.te-result .te-fine {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.te-result .te-btn {
  margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .te-modal,
  .te-dialog,
  .te-choice,
  .te-btn,
  .te-vehicle-img img {
    transition: none;
  }

  .te-vehicle:hover .te-vehicle-img img {
    transform: none;
  }
}

/* ---------- Get Estimate buttons on index.php ---------- */

.te-cta,
.te-fab {
  --te-btn-bg: #0f2236;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: var(--te-btn-bg);
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.te-cta:hover,
.te-cta:focus,
.te-fab:hover,
.te-fab:focus {
  color: #fff;
  text-decoration: none;
  opacity: 1;
}

.te-cta:hover,
.te-fab:hover {
  background: #001f2a;
  transform: translateY(-2px);
}

.te-cta svg,
.te-fab svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* In the hero, under the intro text. */
.te-cta {
  gap: 12px;
  margin: 0 0 26px;
  padding: 16px 28px;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 14px 28px -14px rgba(0, 31, 42, 0.7);
}

.te-cta:hover {
  box-shadow: 0 18px 32px -14px rgba(0, 31, 42, 0.8);
}

.te-cta-calc {
  width: 22px;
  height: 22px;
  color: #3ddc97;
}

.te-cta-spark {
  width: 22px;
  height: 22px;
  color: #f5c542;
}

/* Fixed in the bottom right corner on every scroll position. */
.te-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9990;
  gap: 10px;
  padding: 13px 14px 13px 20px;
  font-size: 16px;
  border: 3px solid #fff;
  box-shadow: 0 12px 30px -8px rgba(0, 31, 42, 0.55);
}

.te-fab:hover {
  box-shadow: 0 16px 34px -8px rgba(0, 31, 42, 0.65);
}

.te-fab svg {
  width: 20px;
  height: 20px;
  color: #3ddc97;
}

.te-fab-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #22c55e;
  color: #052e16;
  font-size: 12px;
  font-weight: 700;
}

/* The theme's back-to-top button shares the corner: lift it above. */
body .go_top,
body .go_top:hover {
  bottom: 100px;
}

@media (max-width: 575px) {
  .te-cta {
    gap: 10px;
    padding: 14px 22px;
    font-size: 15px;
  }

  .te-fab {
    right: 14px;
    bottom: 14px;
    gap: 8px;
    padding: 10px 10px 10px 16px;
    font-size: 15px;
  }

  body .go_top,
  body .go_top:hover {
    bottom: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .te-cta,
  .te-fab {
    transition: none;
  }

  .te-cta:hover,
  .te-fab:hover {
    transform: none;
  }
}

/* Under the truck goods: running total and the load type it means. */
.te-load-hint {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--te-soft);
  font-size: 14px;
  font-weight: 600;
  color: var(--te-deep);
}

/* Truck drop: a two-way switch (customer address / BST godown), then the list. */
.te-drop-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  background: var(--te-soft);
  border: 1px solid var(--te-line);
  border-radius: 14px;
}

.te-drop-modes .te-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.te-drop-modes .te-choice:hover {
  background: #fff;
}

/* Switched off (carton under 30 tons cannot go to the customer's door). */
.te-drop-modes .te-choice:disabled,
.te-drop-modes .te-choice:disabled:hover {
  background: transparent;
  opacity: 0.45;
  cursor: not-allowed;
}

.te-carton-note {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 13px;
  line-height: 1.4;
}

.te-drop-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff;
  color: var(--te-deep);
  transition: background-color 0.2s, color 0.2s;
}

.te-drop-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.te-drop-modes .te-choice b {
  font-size: 14px;
  line-height: 1.25;
}

.te-drop-modes .te-choice small {
  margin-top: 1px;
  font-size: 12px;
  line-height: 1.3;
}

/* The picked side: filled dark, like a switch that is on. */
.te-drop-modes .te-choice[aria-pressed="true"] {
  background: var(--te-ink);
  box-shadow: 0 6px 14px -8px rgba(0, 31, 42, 0.6);
}

.te-drop-modes .te-choice[aria-pressed="true"] b {
  color: #fff;
}

.te-drop-modes .te-choice[aria-pressed="true"] small {
  color: rgba(255, 255, 255, 0.72);
}

.te-drop-modes .te-choice[aria-pressed="true"] .te-drop-ico {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* The godown's full address, under its name in the list. */
.te-drop-address {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--te-soft);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--te-deep);
}

@media (max-width: 575px) {
  .te-drop-modes .te-choice {
    gap: 8px;
    padding: 7px 8px;
  }

  .te-drop-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .te-drop-ico svg {
    width: 16px;
    height: 16px;
  }

  .te-drop-modes .te-choice b {
    font-size: 13px;
  }

  .te-drop-modes .te-choice small {
    font-size: 11.5px;
  }
}

/* ---------- modal polish ---------- */

/* Truck form boxes (goods, drop, pickup): a little more air between them. */
[data-form="truck"] .te-pickup {
  margin-bottom: 16px;
}

[data-form="truck"] .te-pickup-head {
  margin-bottom: 10px;
}

/* A lone goods row cannot be removed: no remove button, no empty column. */
.te-items.te-single .te-icon-btn {
  display: none;
}

.te-items.te-single .te-goods-row {
  grid-template-columns: 1.4fr 1.2fr 0.8fr 0.9fr;
}

/* The running total: weight in bold, the load type beside it. */
.te-load-hint {
  margin: 0 0 4px;
  font-weight: 400;
}

.te-load-hint b {
  font-weight: 600;
}

@media (max-width: 680px) {
  /* The 4-column lone-row grid above is for wide screens only. */
  .te-items.te-single .te-goods-row {
    grid-template-columns: 1fr 1fr 42px;
  }
}

/* Last in the file so it wins over the 15px field size above: iPhones zoom
   the whole page into any field under 16px when it is tapped. */
@media (max-width: 575px) {
  .te-field input,
  .te-field select {
    font-size: 16px;
  }
}

/* Narrow phones: the two halves of a drop / pickup switch stack, each on one line. */
@media (max-width: 420px) {
  .te-drop-modes {
    grid-template-columns: 1fr;
  }
}

/* Narrow phones: slimmer boxes, and size gets more room than qty - a size
   like 1200*1800 must show in full. */
@media (max-width: 420px) {
  .te-pickup {
    padding: 12px;
  }

  .te-goods-row,
  .te-items.te-single .te-goods-row {
    grid-template-columns: 1.25fr 0.75fr 42px;
  }
}

/* Place search: the company (or place) name, then its address. */
.te-suggest li b,
.te-picked b {
  display: block;
  font-weight: 600;
  color: var(--te-deep);
}

.te-suggest li small {
  display: block;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--te-muted);
}

.te-suggest li small:empty {
  display: none;
}

.te-picked {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
}

.te-picked span {
  grid-column: 2;
}

/* An on/off option in its own row: name and note, a switch on the right
   (tempo door delivery: labour for unloading). */
.te-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--te-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.te-option:hover {
  border-color: #b9cdd4;
}

.te-option:has(.te-switch:checked) {
  border-color: var(--te-ink);
  background: var(--te-soft);
}

.te-option b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--te-deep);
}

.te-option small {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--te-muted);
}

.te-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: 999px;
  background: #c9d3d7;
  cursor: pointer;
  transition: background-color 0.2s;
}

.te-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 31, 42, 0.3);
  transition: transform 0.2s;
}

.te-switch:checked {
  background: var(--te-ink);
}

.te-switch:checked::after {
  transform: translateX(18px);
}

.te-switch:focus-visible {
  outline: 3px solid var(--te-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .te-option,
  .te-switch,
  .te-switch::after {
    transition: none;
  }
}

/* The labour row stands on its own below the pickup box, above the total. */
[data-form="tempo"] > .te-option {
  margin: 0 0 12px;
}

/* Fireworks when an estimate comes in: over everything, popup included,
   but never in the way of a click. */
.te-fireworks {
  position: fixed;
  inset: 0;
  z-index: 100600;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- booking wizard: head, steps, addresses with the route map ---------- */

.te-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The lists behind the pickers (js attachSelectPicker): never shown, and the
   godown address shows in the picked card instead. */
.te-src-select,
[data-picker] .te-drop-address {
  display: none !important;
}

/* A booking open in the popup: wider, for the map beside the addresses. */
.te-dialog.te-wide {
  max-width: 1060px;
}

.te-head-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  /* The site's own styles centre text on phones; the head stays left. */
  text-align: left;
}

.te-head-img {
  flex: none;
  width: 86px;
}

.te-head-img img {
  display: block;
  width: 100%;
  height: auto;
}

/* Before a vehicle is picked: the Get Estimate icon (a picture of its own
   rounded tile), a line, then the title and its line of help. */
.te-head-img.te-head-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  box-shadow: 0 8px 16px -8px rgba(0, 53, 71, 0.6);
}

.te-head-icon picture,
.te-head-icon img {
  display: block;
  width: 100%;
  height: 100%;
}

.te-head-icon + div {
  padding-left: 16px;
  border-left: 1px solid var(--te-line);
}

.te-dialog.te-wide .te-dialog-head {
  padding: 12px 24px 10px;
}

.te-dialog.te-wide .te-dialog-head h2 {
  font-size: 24px;
}

.te-dialog.te-wide .te-dialog-body {
  padding-top: 14px;
}

.te-dialog.te-wide .te-nav {
  margin: -2px 0 10px;
}

.te-head-sub {
  margin: 2px 0 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--te-muted);
}

.te-step:not(.te-hidden) {
  animation: te-fade 0.25s ease both;
}

@keyframes te-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Step 1: the addresses on the left, the map on the right. */
.te-route-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 26px;
  align-items: stretch;
}

/* Pickup, then delivery: each with its pin, joined by a dashed line. */
.te-end {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
}

.te-end + .te-end {
  margin-top: 24px;
}

.te-end-pickup::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: -20px;
  left: 16px;
  border-left: 2px dashed #b4c9d0;
}

.te-end-pin {
  display: flex;
  justify-content: center;
  color: var(--te-go);
}

.te-end-drop .te-end-pin {
  color: var(--te-stop);
}

.te-end-pin svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  stroke: none;
}

.te-end-body h3 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--te-ink);
}

/* The title row: the title, and a button at its right (BST Godown). */
.te-end-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* BST Godown: an outline pill, filled while the godown is the drop. */
.te-godown-btn {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 6px;
  margin-top: 2px;
  padding: 6px 13px 6px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--te-teal);
  background: #fff;
  border: 1.5px solid var(--te-teal);
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.te-godown-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.te-godown-btn:hover {
  background: var(--te-soft);
}

.te-godown-btn[aria-pressed="true"] {
  color: #fff;
  background: var(--te-teal);
}

.te-end-hint {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--te-muted);
}

.te-end .te-drop-modes {
  margin-bottom: 10px;
}

[data-step="2"] .te-carton-note {
  margin: 0 0 10px;
}

/* A search box: magnifier inside, its suggestions right under it. */
.te-search {
  position: relative;
}

.te-search > svg {
  position: absolute;
  top: 25px;
  left: 15px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--te-muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.te-field .te-search input {
  height: 50px;
  padding-left: 44px;
  border-color: #cfd9dd;
  border-radius: 12px;
}

.te-field .te-search input:focus {
  outline: none;
  border-color: var(--te-teal);
  box-shadow: 0 0 0 3px rgba(11, 111, 134, 0.15);
}

.te-suggest li.te-suggest-none,
.te-suggest li.te-suggest-none:hover {
  color: var(--te-muted);
  background: transparent;
  cursor: default;
}

.te-locate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  margin-top: 10px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--te-ink);
  background: var(--te-soft);
  border: 1px solid #d7e6eb;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.te-locate:hover {
  background: #e6f2f5;
  border-color: #b9cdd4;
}

.te-locate:disabled {
  opacity: 0.7;
  cursor: progress;
}

.te-locate svg {
  width: 18px;
  height: 18px;
  fill: var(--te-teal);
}

/* The chosen pickup / delivery: icon, name and address, x to change it. */
.te-picked-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px 14px 16px;
  background: var(--te-soft);
  border: 1px solid #d7e6eb;
  border-radius: 14px;
}

.te-picked-ico {
  display: flex;
  flex: none;
}

.te-picked-ico svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--te-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.te-picked-text {
  flex: 1;
  min-width: 0;
}

.te-picked-text b {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--te-ink);
}

.te-picked-text small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--te-muted);
}

.te-picked-text small:empty {
  display: none;
}

.te-picked-clear {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--te-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.te-picked-clear:hover {
  color: var(--te-ink);
  background: #fff;
}

.te-picked-clear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* The map, with distance and time in a card over its corner. */
.te-map-wrap {
  position: relative;
  /* As tall as the screen leaves room for (head, Back, padding), so the
     addresses step fits without scrolling. */
  height: clamp(300px, calc(100vh - 230px), 470px);
  height: clamp(300px, calc(100dvh - 230px), 470px);
  overflow: hidden;
  background: #e9eef0;
  border: 1px solid var(--te-line);
  border-radius: 18px;
}

.te-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.te-est .leaflet-container {
  font: inherit;
  font-size: 12px;
}

.te-map-info {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  gap: 12px;
  padding: 14px 18px 14px 14px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px -12px rgba(0, 31, 42, 0.4);
}

.te-map-ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--te-teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.te-map-info small {
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--te-muted);
}

.te-map-info b {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--te-ink);
}

.te-map-info b:last-child {
  margin-bottom: 0;
}

.te-map-empty {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 500;
  margin: 0;
  padding: 10px 14px;
  font-size: 13.5px;
  text-align: center;
  color: var(--te-deep);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
}

.te-pin {
  background: none;
  border: 0;
}

.te-pin svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.3));
}

.te-pin-pickup {
  color: var(--te-go);
}

.te-pin-drop {
  color: var(--te-stop);
}

/* Under each step: its button on the right. On the addresses it lines up
   with the map. */
.te-step-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.te-step-actions .te-btn {
  padding: 13px 28px;
  border-radius: 14px;
}

.te-ends {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.te-ends .te-step-actions {
  margin-top: auto;
  padding-top: 18px;
}

.te-ends .te-error {
  margin-top: 16px;
}

.te-step[data-step="1"] .te-step-actions .te-btn {
  width: 100%;
}

.te-step .te-btn-dark {
  background: var(--te-teal);
  border-color: var(--te-teal);
}

.te-step .te-btn-dark:hover {
  background: #fff;
  color: var(--te-teal);
}

/* Step 3: the route the estimate is for. */
.te-route-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px;
  background: var(--te-soft);
  border: 1px solid var(--te-line);
  border-radius: 14px;
}

.te-route-summary:empty {
  display: none;
}

.te-rs-end {
  position: relative;
  flex: 1 1 180px;
  min-width: 0;
  padding-left: 16px;
}

.te-rs-end::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 9px;
  height: 9px;
  background: var(--te-go);
  border-radius: 50%;
}

.te-rs-drop::before {
  background: var(--te-stop);
}

.te-rs-end small {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--te-muted);
}

.te-rs-end b {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  color: var(--te-ink);
}

/* The arrow from pickup to delivery: a round white badge, like the km pill. */
.te-rs-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  color: var(--te-teal);
  background: #fff;
  border: 1px solid var(--te-line);
  border-radius: 50%;
  /* A little to the left of centre, nearer the pickup name. */
  transform: translateX(-24px);
}

.te-rs-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.te-rs-km {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--te-ink);
  background: #fff;
  border: 1px solid var(--te-line);
  border-radius: 50px;
}

.te-step[data-step="3"] .te-result {
  margin-top: 16px;
}

/* Short laptop screens: a tighter addresses step, so it still fits without
   scrolling - the hints under the titles go, boxes get slimmer. */
@media (min-width: 861px) and (max-height: 700px) {
  .te-dialog.te-wide .te-dialog-head {
    padding: 8px 24px 8px;
  }

  .te-dialog.te-wide .te-dialog-head h2 {
    font-size: 21px;
  }

  .te-dialog.te-wide .te-head-img {
    width: 66px;
  }

  .te-dialog.te-wide .te-dialog-body {
    padding-top: 10px;
    padding-bottom: 16px;
  }

  .te-end-hint {
    display: none;
  }

  .te-end-body h3 {
    margin-bottom: 8px;
  }

  /* With the hint gone, the BST Godown button is the tallest thing in its
     title row: keep a 2px gap between it and the box under it. */
  .te-end-head:has(> .te-godown-btn:not(.te-hidden)) {
    margin-bottom: 2px;
  }

  .te-end-head:has(> .te-godown-btn:not(.te-hidden)) h3 {
    margin-bottom: 0;
  }

  .te-end + .te-end {
    margin-top: 14px;
  }

  .te-end-pickup::after {
    bottom: -12px;
  }

  .te-field .te-search input {
    height: 44px;
  }

  .te-search > svg {
    top: 22px;
  }

  .te-locate {
    height: 38px;
    margin-top: 8px;
  }

  .te-picked-card {
    padding: 10px 12px;
  }

  .te-ends .te-step-actions {
    padding-top: 12px;
  }

  .te-step-actions .te-btn {
    padding: 11px 24px;
  }
}

/* Tablets: the map goes under the addresses. */
@media (max-width: 860px) {
  .te-route-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .te-map-wrap {
    height: 300px;
  }

  .te-step[data-step="1"] .te-step-actions .te-btn {
    width: 100%;
  }
}

@media (max-width: 575px) {
  .te-head-main {
    gap: 10px;
  }

  .te-head-img {
    width: 64px;
  }

  .te-head-img.te-head-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .te-head-icon + div {
    padding-left: 10px;
  }

  .te-dialog.te-wide .te-dialog-head h2 {
    font-size: 19px;
  }

  .te-dialog-head .te-head-sub {
    font-size: 12.5px;
  }

  .te-end-body h3 {
    font-size: 17px;
  }

  .te-end-hint {
    font-size: 13px;
  }

  .te-map-wrap {
    height: 240px;
  }

  .te-map-info {
    top: 10px;
    right: 10px;
    padding: 10px 12px 10px 10px;
  }

  .te-map-info b {
    font-size: 15px;
  }

  .te-step-actions .te-btn {
    width: 100%;
  }

  .te-rs-arrow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .te-step:not(.te-hidden) {
    animation: none;
  }
}

/* Product / size: our own dropdown (js attachDropdown). Its list opens right
   under the box and never wider than it, on a phone too. */
.te-dd {
  position: relative;
}

.te-dd-src {
  display: none !important;
}

.te-dd-btn {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 8px 36px 8px 12px;
  overflow: hidden;
  font: inherit;
  font-size: 15px;
  line-height: 26px;
  color: var(--te-ink);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f5f6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 14px no-repeat;
  border: 1px solid #c9d3d7;
  border-radius: 10px;
  cursor: pointer;
}

.te-dd-btn.te-dd-empty {
  color: var(--te-muted);
}

.te-dd-btn:disabled {
  color: var(--te-muted);
  background-color: #f5f7f8;
  cursor: not-allowed;
}

.te-dd-btn[aria-expanded="true"] {
  border-color: var(--te-teal);
  box-shadow: 0 0 0 3px rgba(11, 111, 134, 0.15);
}

.te-dd-list li.te-dd-on {
  font-weight: 600;
  color: var(--te-teal);
}

/* The map's OpenStreetMap credit: required by its licence, kept small and faint. */
.te-est .te-map .leaflet-control-attribution {
  margin: 0;
  padding: 0 6px;
  font-size: 9px;
  line-height: 16px;
  background: rgba(255, 255, 255, 0.55);
  border-top-left-radius: 6px;
  opacity: 0.7;
}

.te-est .te-map .leaflet-control-attribution a {
  color: var(--te-muted);
  text-decoration: none;
}
