/**
 * JAYTRA - "Choose on map" (round 5): the page buttons and pin line that checkout, the account's
 * saved sites and /order-by-photo share, and the map sheet of assets/js/sitepin.js. Loaded by
 * includes/header.php on those three pages only. Leaflet's own styles come from
 * assets/vendor/leaflet/1.9.4/leaflet.css, loaded by sitepin.js with the map.
 */

/* ---------- on the page ---------- */
.sp-btns{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.sp-btns[hidden],.sp-open[hidden],.sp-pinline[hidden],[data-sitepin-note][hidden]{display:none}
.sp-btns>[hidden]{display:none!important}
.sp-btns:not(:has(>:not([hidden]))){display:none}
.sp-open .sp-ico,.sp-gpsbtn .sp-ico{flex:none;font-size:18px;line-height:1}
.sp-gpsbtn svg{width:20px;height:20px}
/* "Plus Code 7JWM28F6+5Q · DIGIPIN 3F4 46FC 9LL" (or the coordinates) under "Pin saved" */
.sp-codes{display:block;flex-basis:100%;margin:0;font-size:13.5px;line-height:1.45;color:var(--s-ink-2,#1A1A1A);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.sp-codes:empty{display:none}
[data-sitepin-note]{margin:0;font-size:13px;line-height:1.45;color:var(--s-muted,#666)}
[data-sitepin-note]:empty{display:none}

/* ---------- the sheet: full screen on a phone, a dialog on a wide screen ---------- */
html.sp-lock,html.sp-lock body{overflow:hidden!important}
.sp-sheet{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:stretch;justify-content:center;background:rgba(8,8,8,.62);font-family:var(--s-f,"Poppins",system-ui,sans-serif)}
.sp-sheet[hidden]{display:none}
.sp-panel{position:relative;display:flex;flex-direction:column;width:100%;height:100%;height:100dvh;background:#fff;color:#080808;overflow:hidden}
.sp-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:4px 4px 4px 16px;padding-top:max(4px,env(safe-area-inset-top));background:#080808;color:#fff}
.sp-title{margin:0;font-size:17px;font-weight:600;line-height:1.3;color:#fff}
.sp-x{display:grid;place-items:center;width:48px;height:48px;margin:0;padding:0;border:0;border-radius:6px;background:transparent;color:#fff;cursor:pointer}
.sp-x:hover{background:rgba(255,255,255,.12)}
.sp-x:focus-visible{outline:3px solid #F5A800;outline-offset:-3px}
.sp-help{flex:none;margin:0;padding:8px 16px;background:#FFFCF3;border-bottom:1px solid #E0E0E0;font-size:14px;line-height:1.45;color:#1A1A1A}

.sp-mapwrap{position:relative;flex:1 1 auto;min-height:180px;background:#E9E6DF;outline:none}
.sp-mapwrap:focus-visible{box-shadow:inset 0 0 0 3px #080808}
.sp-map{position:absolute;inset:0}
.sp-map .leaflet-container,.sp-map.leaflet-container{font:inherit;font-size:12px;background:#E9E6DF}
.sp-map .leaflet-control-attribution{font-size:11px;line-height:1.4}
.sp-map .leaflet-control-attribution a{color:#0B57D0}
/* the fixed pin: its tip is the exact middle of the map */
.sp-pin{position:absolute;left:50%;top:50%;z-index:800;width:40px;height:52px;margin:-52px 0 0 -20px;pointer-events:none;filter:drop-shadow(0 2px 2px rgba(0,0,0,.35))}
.sp-pin svg{display:block}
.sp-dot{position:absolute;left:50%;bottom:-3px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:#080808;box-shadow:0 0 0 2px #fff}
.sp-mbtn{display:grid;place-items:center;width:44px;height:44px;margin:0;padding:0;border:1.5px solid #080808;border-radius:6px;background:#fff;color:#080808;cursor:pointer}
.sp-mbtn:hover{background:#FFF4D6}
.sp-mbtn:focus-visible{outline:3px solid #080808;outline-offset:2px}
.sp-zoom{position:absolute;left:10px;top:10px;z-index:800;display:grid;gap:6px}
.sp-zoom .sp-mbtn{box-shadow:0 1px 4px rgba(0,0,0,.25)}
.sp-types{position:absolute;right:10px;top:10px;z-index:800;display:flex;border:1.5px solid #080808;border-radius:6px;overflow:hidden;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.25)}
.sp-types[hidden]{display:none}
.sp-types button{min-width:44px;min-height:44px;margin:0;padding:0 14px;border:0;background:#fff;color:#080808;font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.sp-types button+button{border-left:1.5px solid #080808}
.sp-types button[aria-pressed="true"]{background:#080808;color:#fff}
.sp-types button:focus-visible{outline:3px solid #F5A800;outline-offset:-4px}
.sp-state{position:absolute;inset:0;z-index:900;display:grid;place-items:center;margin:0;padding:24px;background:#E9E6DF;font-size:15px;line-height:1.5;font-weight:500;text-align:center;color:#1A1A1A}
.sp-state[hidden]{display:none}
.sp-state.is-err{background:#FEF3F2;color:#7A1A12}

.sp-foot{flex:none;display:grid;gap:8px;padding:10px 16px 12px;padding-bottom:max(12px,env(safe-area-inset-bottom));border-top:1px solid #E0E0E0;background:#fff}
.sp-read{margin:0;font-size:14px;font-weight:500;line-height:1.45;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.sp-read:empty{display:none}
.sp-note{margin:0;font-size:13.5px;line-height:1.45}
.sp-note.is-warn{color:#7A4F00}
.sp-note[hidden]{display:none}
.sp-msg{margin:0;font-size:13.5px;line-height:1.45;color:#1A1A1A}
.sp-msg:empty{display:none}
.sp-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.sp-nudge{display:flex;gap:6px}
.sp-gps svg{width:20px;height:20px}
.sp-gps[hidden]{display:none}
.sp-sheet.is-failed .sp-tools,.sp-sheet.is-failed .sp-read,.sp-sheet.is-failed .sp-note{display:none}
.sp-actions{display:grid;grid-template-columns:1fr 1.6fr;gap:10px}
.sp-actions .s-btn{width:100%;min-height:48px}
.sp-actions [aria-disabled="true"]{opacity:.55;cursor:not-allowed}

@media (min-width:900px){
  .sp-sheet{align-items:center;padding:24px}
  .sp-panel{width:min(920px,100%);height:min(760px,calc(100vh - 48px));border-radius:12px;box-shadow:0 24px 60px rgba(0,0,0,.45)}
  .sp-head{padding-top:4px}
  .sp-foot{grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:20px;padding:12px 20px}
  .sp-foot>.sp-read,.sp-foot>.sp-note,.sp-foot>.sp-msg{grid-column:1/-1}
  .sp-actions{grid-template-columns:auto auto}
  .sp-actions .s-btn{width:auto;min-width:140px}
}
@media (prefers-reduced-motion:reduce){.sp-sheet *{transition:none!important;animation:none!important}}
@media (forced-colors:active){
  .sp-mbtn,.sp-types,.sp-types button{border:1px solid ButtonText}
  .sp-types button[aria-pressed="true"]{outline:2px solid Highlight}
  .sp-dot{background:CanvasText}
}
@media print{.sp-btns,.sp-open,.sp-sheet,[data-sitepin-note]{display:none!important}}
