/* Standalone delivery view; map, geocoding and shared site chrome stay unchanged. */
.delivery-page {
  --delivery-max: 1240px;
  --delivery-gutter: clamp(16px, 3.125vw, 40px);
  font-family: var(--premium-font-body);
}

.delivery-main {
  width: min(var(--delivery-max), calc(100% - 2 * var(--delivery-gutter)));
  margin: 0 auto;
  padding: 44px 0 48px;
}

.delivery-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}
.delivery-eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.delivery-intro h1 {
  margin: 0;
  color: var(--ink);
  font: 500 50px/1.15 var(--premium-font-display);
  letter-spacing: 0;
}
.delivery-intro h1 span { color: var(--gold-text); }
.delivery-description { max-width: 90ch; margin: 18px 0 30px; color: var(--muted); font-size: 16px; line-height: 1.7; }

.delivery-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--premium-surface);
  box-shadow: 0 1px 0 var(--premium-highlight) inset, var(--premium-shadow);
}
.delivery-page .delivery-search { gap: 12px; margin: 0 0 18px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.delivery-page .delivery-search label { font-weight: 650; }
.delivery-page .delivery-search-row { gap: 12px; }
.delivery-page .delivery-search input { min-width: 0; font-size: 16px; font-weight: 400; padding: 0 16px; }
.delivery-page .delivery-search button {
  min-width: 140px;
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid var(--tomato);
  border-radius: 8px;
  color: var(--on-primary);
  background: var(--premium-red);
  font: 650 15px/1.4 var(--premium-font-body);
  transform: none;
  box-shadow: 0 1px 0 var(--premium-highlight) inset;
  transition: background-color var(--premium-duration), box-shadow var(--premium-duration);
}
.delivery-page .delivery-search button:active { box-shadow: none; }
.delivery-page .delivery-search button:disabled { color: var(--disabled-ink); background: var(--disabled-bg); border-color: var(--line); cursor: wait; box-shadow: none; }
.delivery-page .delivery-search-result { font-weight: 500; line-height: 1.65; overflow-wrap: anywhere; }

.delivery-page .delivery-map-shell {
  /* Keep a stable map area in normal page flow; the shared resize handler recalculates Leaflet. */
  height: clamp(600px, 65svh, 650px);
  min-height: 0;
  border-color: var(--premium-edge);
  border-radius: 8px;
  box-shadow: none;
}
.delivery-page .delivery-map-hint { right: 10px; bottom: 28px; max-width: min(290px, calc(100% - 20px)); padding: 8px 10px; font-size: 12px; font-weight: 500; }
.delivery-page .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; }
.delivery-page .leaflet-popup-content { max-width: min(220px, calc(100vw - 160px)); max-height: 200px; overflow-y: auto; overflow-wrap: anywhere; }
.delivery-source { display: flex; justify-content: flex-end; margin-top: 12px; }
.delivery-source a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; color: var(--gold-text); font-size: 14px; line-height: 1.5; text-underline-offset: 4px; }
.delivery-source svg { flex: 0 0 18px; }

.delivery-main a:focus-visible,
.delivery-main button:focus-visible,
.delivery-main input:focus-visible { outline: 2px solid var(--premium-focus); outline-offset: 3px; }
.delivery-page .delivery-search input:focus { border-color: var(--gold-text); }
.delivery-page .delivery-map-shell a:focus-visible,
.delivery-page .delivery-map:focus-visible { outline: 2px solid var(--premium-focus); outline-offset: -3px; }

@media (hover: hover) {
  .delivery-page .delivery-search button:hover:not(:disabled) { background: var(--premium-red-hover); }
  .delivery-source a:hover { text-decoration: underline; color: var(--tomato-dark); }
}

@media (max-width: 900px) {
  .delivery-page .delivery-map-shell { height: clamp(460px, 65svh, 600px); }
}

@media (max-width: 600px) {
  .delivery-main { padding: 28px 0 36px; }
  .delivery-intro h1 { font-size: 36px; }
  .delivery-description { margin: 16px 0 24px; font-size: 15px; }
  .delivery-panel { padding: 16px; }
  .delivery-page .delivery-search-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .delivery-page .delivery-search p { font-size: 13px; }
  .delivery-page .delivery-map-shell { height: clamp(380px, 55svh, 500px); }
  .delivery-page .leaflet-popup-content { max-height: 140px; }
}

@media (max-width: 359px) {
  .delivery-intro h1 { font-size: 31px; }
  .delivery-panel { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .delivery-page .delivery-search button, .delivery-page .delivery-map-hint { transition: none; }
}

.delivery-stage { position: relative; }
.map-actions {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; gap: 6px;
}
.map-actions[hidden], .map-actions .map-theme, .map-actions .close-icon { display: none; }
.map-tool {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 6px;
  background: var(--panel); color: var(--ink); box-shadow: var(--premium-shadow); cursor: pointer;
}
.map-tool:hover { background: var(--surface-chip); }
.map-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

html.delivery-expanded, html.delivery-expanded body { overflow: hidden; overscroll-behavior: none; }
.delivery-panel.is-expanded {
  --map-top: max(10px, env(safe-area-inset-top));
  --map-right: max(10px, env(safe-area-inset-right));
  --map-left: max(10px, env(safe-area-inset-left));
  position: fixed; inset: var(--map-vtop, 0px) 0 auto; z-index: 10000;
  width: 100%; height: 100vh; height: var(--map-vheight, 100dvh);
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden;
  background: var(--surface); isolation: isolate;
}
.is-expanded .delivery-stage { display: contents; }
.is-expanded .delivery-source, .is-expanded .expand-icon { display: none; }
.is-expanded .close-icon { display: block; }
.is-expanded .map-theme { display: grid; }
.is-expanded .map-actions { top: var(--map-top); right: var(--map-right); z-index: 3; }
.delivery-panel.is-expanded .delivery-map-shell {
  position: absolute; inset: 0; height: 100%; min-height: 0; border: 0; border-radius: 0;
}
.is-expanded .delivery-map { touch-action: none; }
.delivery-panel.is-expanded .delivery-search {
  position: absolute; z-index: 2; left: var(--map-left); top: var(--map-top);
  width: 364px; max-height: calc(100% - var(--map-top) - 12px); overflow: auto;
  padding: 16px; margin: 0; gap: 9px; overscroll-behavior: contain;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--premium-shadow);
}
.is-expanded .delivery-search-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.is-expanded .delivery-search input { min-height: 44px; padding-inline: 10px; }
.is-expanded .delivery-search button { min-width: 0; min-height: 44px; padding: 8px 14px; }
.is-expanded .delivery-search p { font-size: 13px; line-height: 1.4; }
.is-expanded .delivery-search-result { padding: 8px 10px; font-size: 14px; line-height: 1.45; }
.is-expanded .leaflet-top.leaflet-left { top: calc(var(--map-top) + 50px); left: auto; right: calc(var(--map-right) - 10px); }
.is-expanded .leaflet-bottom.leaflet-right { right: env(safe-area-inset-right); bottom: env(safe-area-inset-bottom); }
.is-expanded .delivery-map-hint { bottom: calc(28px + env(safe-area-inset-bottom)); }

@media (max-width: 900px) {
  .delivery-panel.is-expanded { display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .delivery-panel.is-expanded .delivery-map-shell { grid-row: 2; position: relative; height: 100%; }
  .delivery-panel.is-expanded .delivery-search {
    position: static; width: 100%; max-height: calc(var(--map-vheight, 100dvh) * .48);
    padding: var(--map-top) var(--map-right) 10px var(--map-left);
    border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; gap: 6px;
  }
  .is-expanded .delivery-search label { display: flex; align-items: center; min-height: 44px; margin-right: 102px; line-height: 1.2; }
  .is-expanded .delivery-search-result { max-height: 6.8em; overflow: auto; }
  .is-expanded .leaflet-top.leaflet-left { left: calc(var(--map-left) - 10px); right: auto; top: 0; }
  /* With a keyboard or a short landscape window, leave the scrollable form unobstructed. */
  .is-expanded.map-short .delivery-stage { display: block; position: relative; min-height: 0; }
  .is-expanded.map-short .map-actions { top: 8px; }
  .is-expanded.map-short .delivery-search label { min-height: 0; margin-right: 0; }
}
