/* CSS */
html,
body {
  height: 100%;
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
}

#map {
  position: relative;
  inset: 0;
  height: 100vh;
  width: 100vw;
}

h1 {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

h2 {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

p {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.row {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.column {
  display: flex;
  flex-direction: column;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  border-radius: 0;
  z-index: 1000;
  align-items: center;
}

.logo {
  letter-spacing: 0.02rem;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #00a0a4;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  margin: 0;
}

.slogan {
  letter-spacing: 0.02rem;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: #00a0a4;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  margin: 0;
  margin-bottom: 2rem;
}

gmpx-place-picker {
  width: clamp(18rem, 44vw, 20rem);
  --gmpx-color-surface: #fff;
  --gmpx-color-on-surface: #111;
  --gmpx-color-primary: #00a0a4;
  --gmpx-font-size-base: clamp(0.8rem, 1.2vw, 1rem);
}

.form-buttons {
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  background-color: #7cbfc8;
  color: white;
  border: none;
  border-radius: 1rem;
  padding: clamp(0.6rem, 1vw, 1rem);
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-buttons:hover {
  background-color: #00a0a4;;
}

.buttons-row {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

#routeBtn {
  max-width: 7rem;
}

#helpBtn {
  max-width: 3rem;
}

#locateBtn {
  max-width: 3rem;
}

#clearBtn {
  max-width: 3rem;
  background-color: #ccc;
}

#clearBtn:hover {
  background-color: #bfbfbf;
}

button#routeBtn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

#routeInfo {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  width: 15.625rem;
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  z-index: 1002;
}

.route-info {
  position: absolute;
  bottom: 1.125rem;
  left: 1.125rem;
  background: rgba(255, 255, 255, 0.97);
  padding: 0.75rem 0.875rem;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1.125rem rgba(0, 0, 0, 0.12);
  z-index: 1000;
  max-width: 20rem;
  font-size: 0.95rem;
}

.route-info .title {
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.route-info .meta {
  color: #333;
}
.route-error {
  color: #b00020;
  font-weight: 600;
  margin-top: 0.375rem;
}

#routeSummary {
  font-size: 0.95rem;
  color: #333;
}

#routeSummary div:first-child {
  font-weight: 600;
  font-size: 1rem;
  color: #00a0a4; /* teal accent for distance & duration */
  margin-bottom: 0.25rem;
}

#routeSummary div:last-child {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.125rem;
}

#routeInfo,
#routeInfo * {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
}

.input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.location-row {
  display: flex;
  justify-content: flex-start;
}

.btn-location {
  padding: 0.5rem 0.75rem;
  border: 0;
  background: #00a0a4;
  color: white;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 160, 164, 0.5);
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  margin-top: 1rem;
  gap: 0.75rem;
}

.parcel-details-row.overlay {
  position: absolute;
  display: none;
  gap: 0.5rem;
  top: 5.6rem;
  left: 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.625rem;
  border-radius: 0.625rem;
  z-index: 1000;
  align-items: center;
}

.parcel-details-row button,
.parcel-details-row input,
.parcel-details-row select {
  flex: 1;
  padding: 0.5rem;
  border: 0.5px solid #ccc;
  border-radius: 0.75rem;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  color: #4d4d4d;
}

.parcel-details-row button.btn-location {
  color: white;
  margin-bottom: 1rem;
}

/* Delivery options container styled link route summary */
#deliveryInfo {
  position: absolute;
  bottom: 22rem;
  left: 1.25rem;
  width: 15.6rem;
  background: white;
  padding: 0.75rem 1rem;
  z-index: 1002;
}

.delivery-info {
  position: absolute;
  bottom: 3.125rem;
  left: 18px;
  background: rgba(255, 255, 255, 0.97);
  padding: 0.75rem 0.875rem;
  z-index: 1000;
  max-width: 20rem;
  font-size: 0.95rem;
}

.delivery-info a {
  text-decoration: none;
  color: #7cbfc8;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  cursor: pointer;
  transition: all 0.3s ease;
}

.delivery-info a:hover {
  color: #00a0a4;
}

.delivery-info .title {
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.delivery-info row {
  display: flex;
  flex-direction: row;
  box-sizing: border-box;
  justify-content: space-between;
}

.accordion-content p {
  color: #333;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 1rem;
}

.estimate-accordion button {
  width: 100%;
  padding: 0.5rem;
  font-weight: bold;
  background: white;
  color: #00a0a4;
  border: 1px solid #00a0a4;
  cursor: pointer;
  outline: none;
  margin-bottom: 0.25rem;
  border-radius: 0.5rem;
  transition: all 0.3ease;
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.estimate-accordion button:hover {
  background-color: aliceblue;
}

.estimate-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  background-color: rgba(192, 231, 234, 0.3);
  border-radius: 0 0 0.5rem 0.5rem;
  text-align: left;
  color: #4d4d4d;
  box-sizing: border-box;
}

.accordion-button.active + .accordion-content {
  padding: 1rem;
}

.location-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-sizing: border-box;
  border: none;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  transform: translateY(100%);
  opacity: 0;

  /* Transition for smooth slide/fade */
  transition: transform 0.3s ease;
  align-items: center;
}

.location-card.visible {
  transform: translateY(0);
  opacity: 1;
}

.location-card button {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.location-card h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

#originNoBtn {
  background-color: #ccc;
}

#originNoBtn:hover {
  background-color: #bfbfbf;
}

@media (max-width: 767px) {
  .overlay {
    flex-direction: column;
    align-items: stretch;
  }

  .overlay gmpx-place-picker,
  .overlay button {
    width: 100%;
    font-size: 0.9rem;
  }

  .parcel-details-row.overlay {
    flex-direction: column;
    align-items: stretch;
    top: 10rem;
  }

  /* Shrink the gmpx input fields */
  .overlay gmpx-place-picker {
    width: 90%;
    --gmpx-font-size-base: 0.85rem;
    max-width: 18.75rem;
  }


  /* Parcel details row */
  .parcel-details-row.overlay {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
  }

  .parcel-details-row input,
  .parcel-details-row select {
    font-size: 0.85rem;
    padding: 0.4rem;
  }

  #routeInfo {
    display: none;
  }

  .delivery-info {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 1rem;
    z-index: 1001;
    box-sizing: border-box;
    overflow-x: hidden;
    border-radius: 0 !important;
  }
}