/* Address-based delivery inside the existing price-list sidebar. */
.price-delivery[hidden],
.price-delivery [hidden] {
  display: none !important;
}

.price-calculator--address,
.price-delivery,
.price-delivery > * {
  min-width: 0;
}

.price-delivery {
  display: grid;
  gap: 12px;
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
}

.price-delivery__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 8px;
  align-items: end;
}

.price-delivery__field {
  display: grid;
  min-width: 0;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.price-delivery__field--address {
  grid-column: 1 / -1;
}

.price-delivery input,
.price-delivery select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #d8dce0;
  border-radius: 10px;
  color: var(--text);
  background-color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
}

.price-delivery input::placeholder { color: #77818b; }
.price-delivery select { padding-right: 24px; }
.price-delivery input[aria-invalid="true"] { border-color: #ae4820; }
.price-delivery :is(button, input, select, a):focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 3px;
}

.price-delivery__submit {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #edbd91;
  border-radius: 10px;
  color: #934609;
  background: #fff3e6;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.price-delivery__submit:hover { background: #ffe7cc; }
.price-delivery__submit:disabled { opacity: .6; cursor: default; }

.price-delivery__status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.price-delivery__status[data-state="error"] { color: #984321; }
.price-delivery__status[data-state="loading"]::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid #efd6be;
  border-top-color: #a35413;
  border-radius: 50%;
  vertical-align: -1px;
  animation: price-delivery-spin .8s linear infinite;
}

.price-delivery__candidates {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.price-delivery__candidate {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8dce0;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.price-delivery__candidate:hover:not(:disabled) { border-color: var(--brand-dark); background: #fff8f0; }
.price-delivery__candidate:disabled { opacity: .65; cursor: default; }

.price-delivery__result { display: grid; gap: 10px; }
.price-delivery__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 12px 2px;
  border: 1px solid #ede2d7;
  border-radius: 14px;
  background: #fffaf5;
}
.price-delivery__metric {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  min-width: 0;
  text-align: center;
}
.price-delivery__metric + .price-delivery__metric { border-left: 1px solid #ede2d7; }
.price-delivery__metric svg { width: 30px; height: 30px; color: #ac5b17; }
.price-delivery__metric strong { color: var(--text); font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.price-delivery__metric span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.price-delivery__fleet { margin: 0; color: var(--text); font-size: 12px; font-weight: 700; text-align: center; }
.price-delivery__cost { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.price-delivery__cost span { font-size: 13px; font-weight: 700; }
.price-delivery__cost strong { color: var(--text); font-size: 15px; max-width: 100%; margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.price-delivery__totals { display: grid; gap: 8px; }
.price-delivery__cost--total { margin-top: 2px; padding-top: 11px; border-top: 1px solid #e3d7cc; }
.price-delivery__cost--total span { font-size: 15px; font-weight: 800; }
.price-delivery__cost--total strong { color: #984908; font-size: 19px; }
.price-delivery__tariff,
.price-delivery__note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.price-delivery-attribution { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.price-delivery-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.price-calculator--address .price-calculator__note { font-size: 12px; color: var(--muted); }
.price-calculator--address .price-calculator__stat { flex-wrap: wrap; }
.price-calculator--address .price-calculator__stat strong { max-width: 100%; margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.price-calculator--address .price-calculator__stat:has([data-order-total]) strong { font-size: 20px; }
.price-calculator--address .price-calculator__stat[hidden] { display: none !important; }
.price-calculator--address .price-calculator__stat--component span { color: var(--muted); font-size: 13px; font-weight: 500; }
.price-calculator--address .price-calculator__stat--component strong { font-size: 16px; }
.price-calculator--address .price-calculator__stat--component .is-pending,
.price-calculator--address .price-calculator__stat [data-order-total].is-pending { color: var(--muted); font-size: 14px; font-weight: 500; }
.price-calculator--address .is-delivery-total { margin-top: 2px; padding-top: 12px; border-top: 1px solid #e3d7cc; }
.price-calculator--address .is-delivery-total strong:not(.is-pending) { color: #984908; }
.price-calculator--address .price-calculator__item { min-width: 0; }
.price-calculator--address .price-calculator__item strong { min-width: 0; overflow-wrap: anywhere; }
.page-shell:has(.price-calculator--address) { overflow-x: clip; overflow-y: visible; }
.price-layout:has(.price-calculator--address) { align-items: start; overflow: visible; }

@media (min-width: 1081px) {
  .price-layout:has(.price-calculator--address) > .price-calculator--address {
    position: sticky;
    top: var(--price-delivery-top, 120px);
    align-self: start;
    max-height: calc(100vh - var(--price-delivery-top, 120px) - 20px);
    max-height: calc(100dvh - var(--price-delivery-top, 120px) - 20px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c8ced2 transparent;
  }
}
@media (max-width: 1080px) {
  .price-layout > .price-calculator--address { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 600px) {
  .price-delivery input, .price-delivery select { font-size: 16px; }
  .price-delivery__field--vehicle { grid-column: 1 / -1; }
  .price-delivery__submit { grid-column: 1 / -1; font-size: 14px; }
}
@media (max-width: 360px) {
  .price-delivery__metric strong { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .price-delivery__status[data-state="loading"]::before { animation: none; }
}
@keyframes price-delivery-spin { to { transform: rotate(360deg); } }
