/* ============================================================
   REQUEST A TOUR — shared by listing pages that opt in. Paired with /tour.js.

   A listing opts in with:  <body class="has-tour">, a .tour-layout wrapper
   (.tour-main + <aside class="tour" id="tour">), window.TOUR config, and
   <script src="/tour.js">.

   Desktop (>=960px): the panel is a sticky side card.
   Below that: the same panel is a bottom sheet opened from the sticky bar.
   ============================================================ */

/* ---- panel ----
   Until tour.js has initialised (or if it never does) the panel is a plain card
   in the page holding a call/email fallback, so the sticky "Request a Tour" link
   still lands somewhere useful. tour.js adds html.tour-js once it is ready; below
   960px that turns the card into the bottom sheet (closed until opened). */
.tour{--t-green:#00604f;--t-green-d:#004d40;--t-forest:#0f2620;--t-mint:#69b9a6;--t-tint:#f1f7f5;--t-ink:#1c2421;--t-ink2:#3a4642;--t-muted:#5a6661;--t-line:#8a9690;--t-rule:rgba(0,96,79,.18);
  box-sizing:border-box;margin:32px 0 0;padding:20px;border:1px solid var(--t-rule);border-radius:16px;background:#fff;color:var(--t-ink);
  font-family:'IBM Plex Sans',sans-serif}
html.tour-js .tour{position:fixed;left:0;right:0;bottom:0;z-index:90;max-height:92vh;max-height:92dvh;overflow-y:auto;overscroll-behavior:contain;
  margin:0;padding:12px 20px calc(24px + env(safe-area-inset-bottom));border:0;border-radius:20px 20px 0 0;box-shadow:0 -10px 40px rgba(15,38,32,.25);
  transform:translateY(105%);visibility:hidden}
html.tour-js .tour.open{transform:none;visibility:visible}
/* the slide is switched on a frame after init (html.tour-anim) so becoming a sheet at page load isn't itself animated */
html.tour-anim .tour{transition:transform .26s ease,visibility 0s linear .26s}
html.tour-anim .tour.open{transition:transform .26s ease}
.tour *,.tour *::before,.tour *::after{box-sizing:border-box}
.tour-scrim{position:fixed;top:0;left:0;right:0;bottom:0;z-index:85;background:rgba(15,38,32,.55);opacity:0;visibility:hidden;transition:opacity .2s ease,visibility 0s linear .2s}
.tour-scrim.open{opacity:1;visibility:visible;transition:opacity .2s ease}
html.tour-lock,html.tour-lock body{overflow:hidden}
@media (prefers-reduced-motion:reduce){html.tour-anim .tour,html.tour-anim .tour.open,.tour-scrim,.tour-scrim.open{transition:none}}

.tour-grab{width:40px;height:4px;margin:0 auto 12px;border-radius:2px;background:#c9d6d1}
.tour-head{display:flex;align-items:center;gap:14px}
.tour-avatar{flex:none;width:56px;height:56px;border-radius:50%;object-fit:cover}
.tour-who{flex:1;min-width:0}
.tour-name{font-size:15px;font-weight:600}
.tour-role{font-size:12px;color:var(--t-muted)}
.tour-close{flex:none;display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin:-6px -10px 0 0;border:0;border-radius:8px;background:transparent;color:var(--t-ink2);cursor:pointer}
.tour h2{margin:18px 0 16px;font-family:'Archivo',sans-serif;font-size:26px;font-weight:800;letter-spacing:-.02em;line-height:1.1;color:var(--t-forest)}
.tour-label{margin:0 0 8px;font-size:13px;font-weight:600}
.tour-label span{font-weight:400;color:var(--t-muted)}
.tour-group{margin-bottom:18px}
.tour-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.tour-row{display:flex;gap:8px}

/* buy / lease cards */
.tour-opt{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;min-height:64px;margin:0;padding:11px 12px 11px 14px;border:1px solid var(--t-line);border-radius:10px;background:#fff;color:var(--t-ink);text-align:left;font:inherit;cursor:pointer}
.tour-opt b{display:block;font-family:'Archivo',sans-serif;font-size:15px;font-weight:700}
.tour-opt small{display:block;margin-top:2px;font-size:12px;color:var(--t-ink2)}
.tour-opt i{flex:none;width:18px;height:18px;border:1.5px solid var(--t-line);border-radius:50%}
.tour-modes .tour-opt:last-child:nth-child(odd){grid-column:1/-1}
.tour-opt[aria-pressed="true"]{border-color:var(--t-green);box-shadow:0 0 0 1px var(--t-green);background:var(--t-tint)}
.tour-opt[aria-pressed="true"] i{border-color:var(--t-green);background:var(--t-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat}

/* size / time pills */
.tour-pill{height:44px;margin:0;padding:0 10px;border:1px solid var(--t-line);border-radius:100px;background:#fff;color:var(--t-ink);font:500 13px 'IBM Plex Sans',sans-serif;cursor:pointer}
.tour-row .tour-pill{flex:1;min-width:0}
.tour-pill[aria-pressed="true"]{border-color:var(--t-green);background:var(--t-green);color:#fff;font-weight:600}
.tour-hint{display:flex;align-items:center;gap:8px;margin:10px 0 0;font-size:12px;color:var(--t-ink2)}
.tour-hint i{flex:none;width:16px;height:16px;border-radius:50%;background:var(--t-mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2620' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/10px no-repeat}

/* day chips */
.tour-day{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;height:60px;margin:0;padding:0;border:1px solid var(--t-line);border-radius:10px;background:#fff;color:var(--t-ink);font:inherit;cursor:pointer}
.tour-day span{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--t-muted)}
.tour-day b{font-family:'Archivo',sans-serif;font-size:20px;font-weight:800}
.tour-day[aria-pressed="true"]{border-color:var(--t-green);background:var(--t-green);color:#fff}
.tour-day[aria-pressed="true"] span{color:#d9efe9}

/* fields */
.tour-field{margin-bottom:12px}
.tour label{display:block;margin:0 0 6px;font-size:13px;font-weight:600}
.tour input[type=text],.tour input[type=tel],.tour input[type=email]{display:block;width:100%;height:48px;margin:0;padding:0 14px;border:1px solid var(--t-line);border-radius:8px;background:#fff;color:var(--t-ink);font:400 16px 'IBM Plex Sans',sans-serif}
.tour input[aria-invalid="true"]{border-color:#b42318;box-shadow:0 0 0 1px #b42318}
.tour-hp{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;opacity:0!important}
.tour-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}
.tour [hidden]{display:none!important}
.tour-actions{margin-top:6px}
.tour-link{display:block;height:44px;margin:0 0 10px;padding:0;border:0;background:transparent;color:var(--t-green);font:600 13px 'IBM Plex Sans',sans-serif;text-decoration:underline;cursor:pointer}
.tour-err{margin:0 0 12px;padding:10px 12px;border-radius:8px;background:#fdecea;color:#8a1c12;font-size:13px;line-height:1.45}
.tour-submit{display:block;width:100%;height:54px;margin:0;border:0;border-radius:12px;background:var(--t-green);color:#fff;font:800 16.5px 'Archivo',sans-serif;box-shadow:0 10px 24px rgba(0,96,79,.3);cursor:pointer}
.tour-submit:hover{background:var(--t-green-d)}
.tour-submit[disabled]{opacity:.7;cursor:progress}
.tour-micro{margin:10px 0 0;font-size:12px;line-height:1.5;color:var(--t-muted);text-align:center}
.tour-micro a{color:var(--t-green);font-weight:600}

/* keyboard focus */
.tour button:focus-visible,.tour input:focus-visible,.tour a:focus-visible,.tour h2:focus-visible,.tour h3:focus-visible{outline:2px solid var(--t-green);outline-offset:2px}

/* confirmation */
.tour-done{padding:8px 0 0;text-align:center}
.tour-ok{display:flex;align-items:center;justify-content:center;width:72px;height:72px;margin:6px auto 16px;border-radius:50%;background:var(--t-mint);color:var(--t-forest)}
.tour-done h3{margin:0 0 8px;font-family:'Archivo',sans-serif;font-size:24px;font-weight:800;letter-spacing:-.01em;line-height:1.1}
.tour-done p{margin:0 0 18px;font-size:14px;line-height:1.6;color:var(--t-ink2)}
.tour-sum{margin:0 0 18px;padding:4px 16px;border:1px solid var(--t-rule);border-radius:10px;background:#fff;text-align:left}
.tour-sum div{padding:11px 0;border-bottom:1px solid rgba(0,96,79,.09)}
.tour-sum div:last-child{border-bottom:0}
.tour-sum dt{margin:0 0 3px;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--t-muted)}
.tour-sum dd{margin:0;font-size:14px;font-weight:600}
.tour-btn{display:flex;align-items:center;justify-content:center;gap:8px;height:52px;margin:0 0 10px;border-radius:10px;font-size:15px;font-weight:600;text-decoration:none}
.tour-btn.out{border:1px solid var(--t-green);color:var(--t-green)}
.tour-btn.mint{background:var(--t-mint);color:var(--t-forest)}

/* before /tour.js runs (and if it can't) the aside holds a plain call/email fallback */
.tour-fallback p{margin:0;font-size:14px;line-height:1.6;color:var(--t-ink2)}

/* tablet: keep the sheet a comfortable width, centred */
@media (min-width:600px){
  html.tour-js .tour{max-width:560px;margin:0 auto}
}

/* ============================================================
   Listing-page layout when body.has-tour
   ============================================================ */

/* price block: sale + lease side by side */
.has-tour .price-set{display:flex;flex-wrap:wrap;align-items:flex-end;gap:16px 0}
.has-tour .price-blk+.price-blk{margin-left:20px;padding-left:20px;border-left:1px solid var(--rule)}
.has-tour .price-k{margin-bottom:8px;font:700 11px 'Archivo',sans-serif;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.has-tour .price-set .price{font-size:clamp(28px,3.4vw,40px)}
/* (the no-photo brand panel and the rest of the listing layout are styled in each listing page) */

/* sticky bar: Request a Tour + call (below the desktop breakpoint) */
@media (max-width:959.98px){ /* .98 so a fractional width (browser zoom) can't fall between this and the 960px rules */
  .has-tour .stickybar{display:flex;gap:10px}
  .has-tour .stickybar a.tour-open{flex:1;width:auto}
  .has-tour .stickybar a.tour-call{flex:none;width:54px;padding:0}
  .has-tour footer.site{padding-bottom:110px}
}

/* desktop: two columns, sticky tour card */
@media (min-width:960px){
  /* the layout wrapper also carries the site's .wrap (max-width + gutters) */
  .has-tour .tour-layout{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:48px;align-items:start}
  .has-tour .stickybar{display:none}
  /* the site header isn't sticky; max-height keeps the whole card on screen */
  .tour,html.tour-js .tour{position:sticky;top:24px;left:auto;right:auto;bottom:auto;z-index:1;max-width:none;margin:0;max-height:calc(100vh - 48px);overflow-y:auto;padding:24px;border:1px solid var(--t-rule);border-radius:16px;box-shadow:0 1px 2px rgba(15,38,32,.06),0 14px 34px rgba(15,38,32,.08);transform:none;visibility:visible;transition:none}
  /* the button stays pinned to the card's bottom edge if the card has to scroll (short screens);
     scroll-padding keeps a field that just got focus from landing underneath it */
  html.tour-js .tour{scroll-padding-bottom:150px;padding-bottom:0}
  .tour-done{padding-bottom:24px}
  .tour-actions{position:sticky;bottom:0;z-index:1;margin:6px -24px 0;padding:12px 24px 24px;background:#fff}
  .tour-actions::before{content:"";position:absolute;left:0;right:0;top:-16px;height:16px;background:linear-gradient(to top,#fff,rgba(255,255,255,0));pointer-events:none}
  .tour-grab,.tour-close,.tour-scrim{display:none}
}
