.tfm-delivery-box {
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #102033;
}

.tfm-delivery-box * {
  box-sizing: border-box;
}

.tfm-freight-panel {
  padding: 18px;
  border: 1px solid rgba(90, 160, 255, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 14px 35px rgba(30, 80, 140, 0.08), 0 0 0 6px rgba(58, 145, 255, 0.035);
}

.tfm-delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tfm-delivery-head h3 {
  margin: 0;
  color: #0e2033;
  font-size: 20px;
  line-height: 1.15;
  font-weight: 950;
}

.tfm-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #0d5dab;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.tfm-route-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.tfm-route-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #31465c;
  font-size: 13px;
  font-weight: 850;
}

.tfm-route-meta span {
  display: inline-flex;
  align-items: center;
}

.tfm-route-meta span + span::before {
  content: "•";
  margin: 0 8px 0 0;
  color: rgba(49, 70, 92, 0.45);
}

.tfm-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  margin-left: auto;
  padding: 4px;
  border: 1px solid rgba(20, 63, 103, 0.10);
  border-radius: 14px;
  background: rgba(236, 244, 255, 0.72);
}

.tfm-mode-button {
  appearance: none;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  color: #31465c;
  font-size: 12px;
  line-height: 1;
  font-weight: 850;
  cursor: pointer;
  box-shadow: none;
}

.tfm-mode-button.is-active {
  background: linear-gradient(90deg, #57a7f4 0%, #3068f0 100%);
  border-color: rgba(48, 104, 240, 0.4);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(35, 119, 213, 0.16);
}

.tfm-delivery-form {
  display: block;
  margin: 0;
}

.tfm-status-label {
  display: block;
  min-height: 19px;
  margin: 0 0 8px;
  color: #1c2e42;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

.tfm-status-label .tfm-inline-price {
  color: #12623c;
  font-weight: 950;
}

.tfm-status-label .tfm-inline-copy {
  color: #60758a;
  font-weight: 750;
}

.tfm-status-label .tfm-inline-error {
  color: #b42318;
  font-weight: 850;
}

.tfm-postcode-row {
  display: flex;
  align-items: stretch;
  gap: 9px;
}

.tfm-postcode-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 63, 103, 0.22);
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  font-weight: 650;
  text-transform: uppercase;
  outline: none;
}

.tfm-postcode-input:focus {
  border-color: rgba(35, 119, 213, 0.72);
  box-shadow: 0 0 0 4px rgba(35, 119, 213, 0.11);
}

.tfm-quote-button.button,
button.tfm-quote-button {
  min-height: 44px;
  padding: 10px 15px;
  border-radius: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.tfm-collection-status {
  margin-top: 12px;
  padding: 0;
  color: #60758a;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
}

.tfm-collection-status strong {
  color: #12623c;
  font-weight: 950;
}

.tfm-collection-status span {
  color: #60758a;
  font-weight: 750;
}

.tfm-delivery-result {
  display: none !important;
}

.tfm-mode-collection .tfm-delivery-form {
  display: none !important;
}

.tfm-mode-delivery .tfm-collection-status {
  display: none !important;
}

@media (max-width: 640px) {
  .tfm-delivery-head {
    display: block;
  }

  .tfm-mini-badge {
    margin-top: 8px;
  }

  .tfm-route-toolbar {
    display: block;
  }

  .tfm-route-meta {
    margin-bottom: 10px;
  }

  .tfm-mode-switch {
    display: flex;
    width: 100%;
    margin-left: 0;
  }

  .tfm-mode-button {
    flex: 1 1 0;
  }

  .tfm-postcode-row {
    flex-direction: column;
  }

  .tfm-quote-button.button,
  button.tfm-quote-button {
    width: 100%;
  }
}


/* v0.3.1: show collection message and keep delivery box compact */
.tfm-delivery-box,
.tfm-freight-panel {
  align-self: flex-start !important;
  height: auto !important;
  min-height: 0 !important;
}

.tfm-collection-status[hidden] {
  display: none !important;
}

.tfm-mode-collection .tfm-collection-status {
  display: block !important;
  margin-top: 12px;
  padding: 0;
  color: #60758a;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
}

.tfm-mode-collection .tfm-collection-status strong {
  color: #12623c;
  font-weight: 950;
}

.tfm-mode-collection .tfm-collection-status span {
  color: #60758a;
  font-weight: 750;
}

.tfm-mode-collection .tfm-delivery-form {
  display: none !important;
}


/* v0.3.2: tighten collection message + postcode input height */
.tfm-mode-collection .tfm-collection-status {
  margin-top: 26px;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 750;
}

.tfm-mode-collection .tfm-collection-status strong {
  display: inline !important;
  color: #12623c;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 950;
}

.tfm-mode-collection .tfm-collection-status span {
  display: inline !important;
  color: #60758a;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 750;
}

.tfm-postcode-input {
  height: 40px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.tfm-quote-button.button,
button.tfm-quote-button {
  min-height: 40px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

.tfm-postcode-row {
  align-items: center;
}


/* v0.3.4: natural-height fix — stop freight/price boxes stretching each other */
.tfm-delivery-box,
.tfm-freight-panel,
.tlm-listing-magnifier-wrap,
.tlm-price-magnifier {
  align-self: flex-start !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.tfm-freight-panel {
  overflow: visible !important;
  padding-bottom: 18px !important;
}

/* keep collection state compact and in the same visual rhythm as delivery price */
.tfm-mode-collection .tfm-delivery-form {
  display: none !important;
}

.tfm-mode-collection .tfm-collection-status {
  display: block !important;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  color: #60758a;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 750;
}

.tfm-mode-collection .tfm-collection-status strong {
  display: inline !important;
  color: #12623c;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 950;
}

.tfm-mode-collection .tfm-collection-status span {
  display: inline !important;
  color: #60758a;
  font-size: 13px !important;
  line-height: 1.25 !important;
  font-weight: 750;
}

/* compact postcode row so delivery state doesn't make the card tall */
.tfm-postcode-input {
  height: 38px !important;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

.tfm-quote-button.button,
button.tfm-quote-button {
  min-height: 38px !important;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

.tfm-postcode-row {
  align-items: center !important;
}

/* remove older fixed-height/absolute positioning attempts if cached CSS order allows */
.tfm-delivery-form,
.tfm-collection-status {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}
