/* =========================================================
   Lab: Brightwater locator demo
   The demo wears a client's brand (light, teal), framed in a browser,
   so it reads as a real client site inside the Kev's Atelier page.
   ========================================================= */

.demo-section { padding: 0 0 clamp(72px, 10vw, 128px); }
.demo-wrap { width: min(100% - (var(--gutter) * 2), 1360px); margin-inline: auto; }

/* ---------- Browser frame ---------- */
.browser {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 40px 100px -40px rgba(232, 200, 115, 0.35), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  background: #e9eef0;
}
.browser-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #1b1a17;
  border-bottom: 1px solid #2a2722;
}
.browser-bar > i { width: 11px; height: 11px; border-radius: 50%; background: #3a3630; flex: none; }
.browser-bar > i:nth-child(1) { background: #e0675a; }
.browser-bar > i:nth-child(2) { background: #e3b64f; }
.browser-bar > i:nth-child(3) { background: #6fbf63; }
.url {
  flex: 1; min-width: 0;
  margin-left: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #0d0c0a;
  color: #d9d2c2;
  font: 500 0.85rem/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.url::before { content: "🔒 "; filter: grayscale(1); opacity: 0.6; }

/* ---------- Brightwater app ---------- */
.bw-app {
  --bw-ink: #0b2a33;
  --bw-text: #29434a;
  --bw-muted: #5f7b82;
  --bw-teal: #0b7a85;
  --bw-teal-deep: #075761;
  --bw-aqua: #36bfd0;
  --bw-sun: #ffc845;
  --bw-bg: #f5f9fa;
  --bw-card: #ffffff;
  --bw-line: #d6e4e7;
  --bw-water: #d7eaf0;
  --bw-land: #eef3f1;
  --bw-open: #13844d;
  --bw-soon: #b26a00;
  --bw-closed: #a33b2b;
  color-scheme: light;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--bw-text);
  background: var(--bw-bg);
  font-size: 15px;
  line-height: 1.5;
}
.bw-app a { color: var(--bw-teal); }
.bw-app button { font-family: inherit; }
.bw-app :focus-visible { outline: 2px solid var(--bw-teal); outline-offset: 2px; }

.bw-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 18px;
  background: var(--bw-ink);
  color: #fff;
}
.bw-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.bw-logo svg { width: 26px; height: 26px; }
.bw-logo small { font-weight: 400; opacity: 0.7; font-size: 0.85rem; }
.bw-head nav { display: none; gap: 22px; font-size: 0.92rem; opacity: 0.85; }
.bw-head nav span.on { color: var(--bw-sun); }
@media (min-width: 760px) { .bw-head nav { display: flex; } }

.bw-body { display: grid; height: min(78vh, 780px); min-height: 560px; }
@media (min-width: 900px) { .bw-body { grid-template-columns: 400px 1fr; } }
@media (min-width: 1200px) { .bw-body { grid-template-columns: 440px 1fr; } }

.bw-panel { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--bw-line); background: var(--bw-bg); }
.bw-tools { padding: 16px 16px 10px; border-bottom: 1px solid var(--bw-line); background: #fff; display: grid; gap: 12px; }

/* Search */
.bw-search { position: relative; display: flex; gap: 8px; }
.bw-field { position: relative; flex: 1; min-width: 0; }
.bw-field svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--bw-muted); pointer-events: none; }
#bw-q {
  width: 100%;
  padding: 12px 36px 12px 38px;
  border: 1.5px solid var(--bw-line);
  border-radius: 10px;
  background: #fff;
  color: var(--bw-ink);
  font: 500 1rem/1.2 inherit;
  font-family: inherit;
}
#bw-q:focus { outline: none; border-color: var(--bw-teal); box-shadow: 0 0 0 3px rgba(11, 122, 133, 0.15); }
#bw-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--bw-muted); font-size: 1.2rem; cursor: pointer; }
#bw-clear:hover { background: var(--bw-bg); }
#bw-locate {
  flex: none; display: grid; place-items: center;
  width: 46px; border: 1.5px solid var(--bw-line); border-radius: 10px; background: #fff; color: var(--bw-teal); cursor: pointer;
}
#bw-locate svg { width: 20px; height: 20px; }
#bw-locate:hover { border-color: var(--bw-teal); }
.bw-shake { animation: bw-shake 400ms; }
@keyframes bw-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
#bw-sugg {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--bw-line); border-radius: 12px;
  box-shadow: 0 18px 40px -16px rgba(11, 42, 51, 0.35);
}
#bw-sugg li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
#bw-sugg li[aria-selected="true"], #bw-sugg li:hover { background: var(--bw-bg); }
#bw-sugg .k { grid-row: span 2; align-self: center; padding: 3px 7px; border-radius: 6px; background: #e3f3f5; color: var(--bw-teal-deep); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
#bw-sugg b { color: var(--bw-ink); font-weight: 600; }
#bw-sugg .m { color: var(--bw-muted); font-size: 0.85rem; }
#bw-sugg .bw-empty { display: block; color: var(--bw-muted); cursor: default; }

/* Filters */
.bw-filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.bw-filters::-webkit-scrollbar { display: none; }
.bw-chip {
  flex: none;
  padding: 7px 12px;
  border: 1.5px solid var(--bw-line);
  border-radius: 999px;
  background: #fff;
  color: var(--bw-text);
  font-size: 0.86rem; font-weight: 500;
  cursor: pointer;
  transition: background 200ms, border-color 200ms, color 200ms;
}
.bw-chip:hover { border-color: var(--bw-teal); }
.bw-chip[aria-pressed="true"] { background: var(--bw-teal); border-color: var(--bw-teal); color: #fff; }
.bw-chip[aria-pressed="true"]::before { content: "✓ "; }

.bw-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bw-bg); }
.bw-tabs button { flex: 1; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--bw-muted); font-weight: 600; cursor: pointer; }
.bw-tabs button[aria-selected="true"] { background: #fff; color: var(--bw-ink); box-shadow: 0 1px 3px rgba(11, 42, 51, 0.15); }
@media (min-width: 900px) { .bw-tabs { display: none; } }

.bw-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 24px; }

/* Mobile: list or map, one at a time */
@media (max-width: 899px) {
  .bw-body { grid-template-rows: 1fr; height: 82vh; min-height: 600px; }
  .bw-panel { border-right: 0; }
  .bw-map { display: none; }
  .bw-show-map .bw-body { grid-template-rows: auto 1fr; }
  .bw-show-map .bw-scroll { display: none; }
  .bw-show-map .bw-map { display: block; }
}

/* Intro, crumbs, cards */
.bw-intro { margin-bottom: 12px; }
.bw-intro h2 { margin: 0; color: var(--bw-ink); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.bw-intro p { margin: 4px 0 0; color: var(--bw-muted); font-size: 0.9rem; }
.bw-crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; font-size: 0.85rem; color: var(--bw-muted); }
.bw-crumbs a { text-decoration: none; font-weight: 500; }
.bw-crumbs a:hover { text-decoration: underline; }

.bw-card {
  position: relative;
  display: grid; gap: 4px;
  margin-bottom: 10px;
  padding: 14px 16px;
  background: var(--bw-card);
  border: 1.5px solid var(--bw-line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}
.bw-card:hover { border-color: #a9d2d8; }
.bw-card.sel { border-color: var(--bw-teal); box-shadow: 0 8px 22px -12px rgba(11, 122, 133, 0.6); }
.bw-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bw-card h3 { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.25; }
.bw-card h3 a { color: var(--bw-ink); text-decoration: none; }
.bw-card h3 a:hover { color: var(--bw-teal); text-decoration: underline; }
.bw-card p { margin: 0; font-size: 0.88rem; color: var(--bw-muted); }
.bw-dist { flex: none; font-size: 0.85rem; font-weight: 600; color: var(--bw-teal-deep); font-variant-numeric: tabular-nums; }

.bw-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; font-weight: 600; }
.bw-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.bw-status.open { color: var(--bw-open); }
.bw-status.soon { color: var(--bw-soon); }
.bw-status.closed { color: var(--bw-closed); }
.bw-status.big { margin-top: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1.5px solid currentColor; }

.bw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.bw-tags li { padding: 2px 8px; border-radius: 6px; background: #e8f4f6; color: var(--bw-teal-deep); font-size: 0.76rem; font-weight: 500; }

.bw-none { padding: 18px; border: 1.5px dashed var(--bw-line); border-radius: 12px; color: var(--bw-muted); text-align: center; }
.bw-none button { margin-left: 4px; border: 0; background: none; color: var(--bw-teal); font-weight: 600; text-decoration: underline; cursor: pointer; }

.bw-states { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bw-line); }
.bw-states h3 { margin: 0 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bw-muted); }
.bw-states ul, .bw-cities { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.bw-states a, .bw-cities a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; background: #fff; border: 1.5px solid var(--bw-line);
  color: var(--bw-ink); text-decoration: none; font-weight: 500; font-size: 0.92rem;
}
.bw-states a:hover, .bw-cities a:hover { border-color: var(--bw-teal); }
.bw-states a span { color: var(--bw-muted); font-weight: 400; }
.bw-cities a { display: grid; justify-content: start; gap: 0; }
.bw-cities b { font-weight: 600; }
.bw-cities span { color: var(--bw-muted); font-size: 0.82rem; }

/* Location detail */
.bw-detail { position: relative; }
.bw-detail h2 { margin: 0; color: var(--bw-ink); font-size: 1.55rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; padding-right: 110px; }
.bw-mapbtn { position: absolute; right: 0; top: 2px; padding: 7px 12px; border: 1.5px solid var(--bw-line); border-radius: 999px; background: #fff; color: var(--bw-teal); font-weight: 600; font-size: 0.82rem; cursor: pointer; }
@media (min-width: 900px) { .bw-mapbtn { display: none; } .bw-detail h2 { padding-right: 0; } }
.bw-addr { margin: 6px 0 0; color: var(--bw-text); }
.bw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.bw-btn { display: inline-block; padding: 11px 18px; border-radius: 10px; background: var(--bw-teal); color: #fff !important; font-weight: 600; text-decoration: none; }
.bw-btn:hover { background: var(--bw-teal-deep); }
.bw-phone { font-weight: 600; color: var(--bw-ink); user-select: all; }
.bw-member { display: grid; gap: 2px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(120deg, var(--bw-ink), #0f4652); color: #fff; }
.bw-member b { color: var(--bw-sun); font-size: 1.05rem; }
.bw-member span { opacity: 0.85; font-size: 0.88rem; }
.bw-detail h3 { margin: 22px 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bw-muted); }
.bw-hours { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.bw-hours th, .bw-hours td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--bw-line); font-weight: 400; }
.bw-hours td { text-align: right; }
.bw-hours tr.today { background: #e8f4f6; font-weight: 600; }
.bw-hours tr.today th { font-weight: 600; }
.bw-hours small { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--bw-teal); color: #fff; font-size: 0.7rem; font-weight: 600; }
.bw-tz { margin: 6px 0 0; font-size: 0.8rem; color: var(--bw-muted); }
.bw-svcs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.bw-svcs li { display: flex; gap: 8px; }
.bw-svcs li span[aria-hidden] { color: var(--bw-open); font-weight: 700; width: 12px; }
.bw-svcs li.off { color: #9fb2b6; }
.bw-svcs li.off span[aria-hidden] { color: #b8c7ca; }
.bw-near { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.bw-near a { display: grid; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1.5px solid var(--bw-line); text-decoration: none; }
.bw-near a:hover { border-color: var(--bw-teal); }
.bw-near b { color: var(--bw-ink); font-weight: 600; font-size: 0.95rem; }
.bw-near span { color: var(--bw-muted); font-size: 0.82rem; }

/* The schema panel is the Atelier's note inside the client site */
.bw-schema { margin-top: 22px; border: 1.5px solid #c9a24b; border-radius: 12px; background: #0e0d0b; color: #f1e9d8; overflow: hidden; }
.bw-schema summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.bw-schema summary::-webkit-details-marker { display: none; }
.bw-schema summary::after { content: "+"; margin-left: auto; color: #e8c873; font-size: 1.2rem; }
.bw-schema[open] summary::after { content: "–"; }
.ka-note { padding: 3px 8px; border-radius: 4px; background: #c9a24b; color: #060606; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.bw-schema p { margin: 0; padding: 0 16px 12px; color: #a39a86; font-size: 0.88rem; }
.bw-schema pre { margin: 0; max-height: 340px; overflow: auto; padding: 14px 16px; border-top: 1px solid rgba(201, 162, 75, 0.25); font: 0.78rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #d9d2c2; }
.bw-schema .k { color: #e8c873; }
.bw-schema .s { color: #9fd4c9; }
.bw-schema .n { color: #f0a77a; }

/* ---------- Map (Leaflet) ---------- */
.bw-map { position: relative; min-height: 0; overflow: hidden; background: var(--bw-water); }
#bw-map { position: absolute; inset: 0; z-index: 0; }
.bw-app .leaflet-container { background: var(--bw-water); font-family: inherit; }
/* CARTO Positron is already quiet; a faint cool tint ties it to the brand's water color */
.bw-tiles { filter: saturate(1.1) hue-rotate(-4deg); }
.bw-app .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.85); color: var(--bw-muted); border-radius: 6px 0 0 0; }
.bw-app .leaflet-control-attribution a { color: var(--bw-teal-deep); }

.bw-mk { background: none; border: 0; }
.bw-mk i {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bw-teal); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(11, 42, 51, 0.45);
  transition: transform 150ms, background 150ms;
}
.bw-mk.closed i { background: #7f9aa0; }
.bw-mk:hover i, .bw-mk.hover i { transform: scale(1.35); background: var(--bw-teal-deep); }
.bw-mk.sel i { width: 26px; height: 26px; background: var(--bw-sun); border-color: var(--bw-ink); position: relative; z-index: 1; }
.bw-mk .ring { position: absolute; inset: -12px; border-radius: 50%; background: rgba(255, 200, 69, 0.4); animation: bw-ring 1.6s ease-out infinite; }
@keyframes bw-ring { from { transform: scale(0.5); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

.bw-cl {
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bw-teal);
  background-clip: padding-box;
  border: 6px solid rgba(11, 122, 133, 0.25);
  color: #fff; font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 4px 12px -4px rgba(11, 42, 51, 0.5);
  transition: border-color 200ms;
}
.bw-cl:hover { border-color: rgba(11, 122, 133, 0.45); }
.bw-cl span { line-height: 1; }

.bw-label span {
  position: absolute; transform: translate(-50%, -190%);
  white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: #6f8a90;
  text-shadow: 0 0 3px var(--bw-land), 0 0 3px var(--bw-land), 0 0 3px var(--bw-land);
  pointer-events: none;
}

.bw-pop .leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 18px 40px -14px rgba(11, 42, 51, 0.5); }
.bw-pop .leaflet-popup-content { display: grid; gap: 3px; margin: 14px 16px; font-family: "Outfit", system-ui, sans-serif; font-size: 0.88rem; line-height: 1.45; color: var(--bw-text); }
.bw-pop b { color: var(--bw-ink); font-size: 1rem; padding-right: 14px; }
.bw-pop a { margin-top: 6px; font-weight: 600; color: var(--bw-teal); }
.bw-pop .bw-status { font-size: 0.86rem; }
.bw-pop .leaflet-popup-close-button { top: 6px; right: 6px; color: var(--bw-muted); }

.bw-zoom { position: absolute; z-index: 2; right: 14px; top: 14px; display: grid; gap: 6px; }
.bw-zoom button {
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: #fff; color: var(--bw-ink); font-size: 1.25rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px -6px rgba(11, 42, 51, 0.45);
}
.bw-zoom button:hover { color: var(--bw-teal); }
.bw-zoom #bw-zreset { font-size: 0.7rem; letter-spacing: 0.04em; }
.bw-count {
  position: absolute; z-index: 2; left: 14px; bottom: 14px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem; font-weight: 600; color: var(--bw-ink);
  box-shadow: 0 4px 14px -6px rgba(11, 42, 51, 0.35);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.bw-basic-note {
  display: none;
  position: absolute; z-index: 2; left: 14px; top: 14px;
  padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.92);
  font-size: 0.75rem; font-weight: 600; color: var(--bw-muted);
  pointer-events: none;
}
.bw-basic .bw-basic-note { display: block; }
#bw-flash {
  position: absolute; left: 50%; top: 14px; z-index: 3; transform: translateX(-50%);
  max-width: calc(100% - 120px);
  padding: 10px 14px; border-radius: 10px; background: var(--bw-ink); color: #fff; font-size: 0.86rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* ---------- What the demo shows ---------- */
.shows { display: grid; gap: 14px; }
@media (min-width: 760px) { .shows { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .shows { grid-template-columns: repeat(3, 1fr); } }
.show { padding: clamp(22px, 3vw, 30px); border: 1px solid var(--line-soft); border-radius: 4px; background: var(--panel); }
.show b.big { display: block; font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.show h3 { margin-top: 14px; font-family: var(--display); font-weight: 500; font-size: 1.45rem; line-height: 1.15; }
.show p { margin-top: 8px; color: var(--muted); }

.lab-note { margin-top: 18px; color: var(--muted); font-size: 0.92rem; text-align: center; }

/* Quick "try it" links in the hero */
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 22px; color: var(--muted); }
.try a {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 2px;
  color: var(--gold-bright); text-decoration: none; font-size: 0.92rem;
  transition: background 250ms, border-color 250ms;
}
.try a:hover { background: rgba(201, 162, 75, 0.12); border-color: var(--gold-bright); }

/* The hidden attribute must win over the display rules above */
.bw-app [hidden] { display: none !important; }
/* One clear button only: hide the browser's own */
#bw-q::-webkit-search-cancel-button, #bw-q::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

/* The site-wide "max-width: 100%" on images and SVG must not touch the map's layers */
.bw-app .leaflet-container svg,
.bw-app .leaflet-container img { max-width: none !important; max-height: none !important; }
