/* ==========================================================================
   Ayuria Place — Surrounding 360: engagement layer
   Loaded AFTER style.css and enhancements.css, so these rules take priority.
   ========================================================================== */

/* ---------- Markers: coloured by type, with an icon ---------- */
.poi { --c: #e0bd79; }
.poi-dot, .poi-pulse { left: -12px; top: -12px; width: 24px; height: 24px; }
.poi-dot {
  display: grid; place-items: center; background: var(--c); border: 2px solid #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .5);
}
.poi-dot svg { width: 13px; height: 13px; stroke: #17221d; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.poi-pulse { border-color: var(--c); }
.poi-label {
  left: 21px; top: -13px;
  transition: opacity .3s, transform .3s, background .2s, color .2s, max-width .2s;
}
.poi.active .poi-dot { transform: scale(1.22); background: var(--c); }
.poi.active .poi-label { background: var(--c); color: #17221d; border-color: #fff; }
.poi:hover .poi-dot, .poi:focus-visible .poi-dot { background: #fff; }

/* Filtered out by a type chip */
.poi.dim { opacity: .3; filter: saturate(.25); }
.poi.dim:hover, .poi.dim:focus-visible { opacity: 1; filter: none; }

/* Spotlight: while a landmark is open, the other names fade away so it stands out */
body.has-focus .poi:not(.active):not(:hover):not(:focus-visible) .poi-label { opacity: 0; transform: translateX(-6px); pointer-events: none; }
body.has-focus .poi:not(.active) .poi-pulse { animation: none; }

/* ---------- Landmark card ---------- */
.poi-card { padding: 16px 44px 16px 16px; }
.poi-card-head { display: flex; align-items: center; gap: 12px; }
.poi-card-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c, #e0bd79);
}
.poi-card-icon svg { width: 21px; height: 21px; stroke: #17221d; fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.poi-card-head strong { margin: 3px 0 0; font-size: 19px; line-height: 1.2; }
.poi-card p { margin-top: 10px; }
.poi-card-directions { display: flex; gap: 8px; margin-top: 13px; }
.poi-directions-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  flex: 1 1 0; min-width: 0; padding: 9px 10px; border-radius: 9px;
  border: 1px solid rgba(224, 189, 121, .48); color: #f4ead5;
  background: rgba(255,255,255,.055); font: 600 10px "DM Sans", sans-serif;
  letter-spacing: .15px; text-decoration: none; transition: background .2s, border-color .2s, transform .2s;
}
.poi-directions-link svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.poi-directions-link:hover, .poi-directions-link:focus-visible { background: rgba(224,189,121,.18); border-color: #e0bd79; transform: translateY(-1px); outline: none; }
.poi-directions-link:focus-visible { box-shadow: 0 0 0 2px rgba(224,189,121,.35); }
.poi-card-next {
  margin-top: 12px; padding: 8px 14px; border: 1px solid rgba(224, 189, 121, .55); border-radius: 30px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px; color: #f0dfb8; transition: background .2s, color .2s;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.poi-card-next:hover { background: #e0bd79; color: #17221d; }
.poi-card-next[hidden] { display: none; }

.finish-card { width: min(92%, 360px); padding: 20px 46px 20px 20px; }
.finish-card strong { font: 600 22px "Playfair Display", serif; margin: 8px 0 4px; display: block; }
.finish-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.finish-actions .btn { padding: 11px 16px; min-height: 0; font-size: 11px; text-align: center; }
.poi-card.finish-card.show ~ .toast, .finish-card.show ~ .toast { bottom: 250px; }

/* ---------- Type chips ---------- */
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 22px 4px; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
  --c: #e0bd79;
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap;
  padding: 7px 11px; border: 1px solid #d9dccf; border-radius: 99px; background: rgba(255, 255, 255, .55);
  font-size: 11px; font-weight: 600; color: #4b5a4f; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.cat-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cat-chip b { font-weight: 700; color: #8d7955; font-variant-numeric: tabular-nums; }
.cat-chip:hover { background: #fff; transform: translateY(-1px); }
.cat-chip.active { background: #24392c; border-color: #24392c; color: #fff; }
.cat-chip.active b { color: #f0dfb8; }

/* The list item's type colour */
.scene-label small::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%;
  background: var(--c, #e0bd79); vertical-align: 1px;
}

/* Quick-start chips on the welcome screen */
.welcome-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.welcome-cats .cat-chip { color: #fff; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); padding: 9px 14px; }
.welcome-cats .cat-chip b { color: var(--gold-soft); }
.welcome-cats .cat-chip:hover { border-color: #e0bd79; background: rgba(255, 255, 255, .14); }

/* ---------- Guided-tour dots ---------- */
.tour-dots {
  position: absolute; top: 12px; left: 50%; z-index: 6; transform: translate(-50%, -6px);
  display: flex; gap: 6px; padding: 7px 11px; border-radius: 99px; pointer-events: none;
  background: rgba(12, 20, 15, .6); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .3s, transform .3s;
}
.tour-dots.show { opacity: 1; transform: translate(-50%, 0); }
.tour-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .28); transition: background .3s, transform .3s, width .3s; }
.tour-dots span.done { background: #e0bd79; }
.tour-dots span.current { background: #fff; width: 20px; border-radius: 8px; }

/* ---------- Phones ---------- */
@media (max-width: 650px) {
  .poi-dot, .poi-pulse { left: -11px; top: -11px; width: 22px; height: 22px; }
  .poi-dot svg { width: 12px; height: 12px; }
  .poi-label { left: 18px; top: -11px; }
  .poi-card { padding: 14px 40px 14px 14px; }
  .poi-card-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .poi-card-head strong { font-size: 17px; }
  .cat-chips { padding: 0 18px 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .welcome-cats .cat-chip { padding: 8px 11px; font-size: 10px; }
  .tour-dots { top: 8px; }
  .finish-card.show ~ .toast { bottom: 230px; }
}

/* ---------- Welcome card spacing + long landmark names ---------- */
.welcome-card { padding: 34px 38px 30px; max-width: 540px; }
.viewer-heading.long h1 { font-size: clamp(22px, 2.3vw, 31px); line-height: 1.15; }
@media (max-width: 650px) {
  .welcome-card { padding: 26px 22px; }
  .viewer-heading.long h1 { font-size: 21px; }
}

/* Welcome card: never taller than the screen — scrolls if it has to, and is more compact on phones */
.welcome { overflow-y: auto; }
.welcome-card { margin: auto; }
@media (max-width: 650px) {
  .welcome { padding: 14px; align-items: start; }
  .welcome-card { padding: 20px 18px 22px; }
  .welcome-logo-wrap { margin-bottom: 10px; }
  .welcome-logo-wrap .welcome-mark { width: 44px; height: 44px; font-size: 26px; }
  .welcome h2 { font-size: 26px; margin: 8px 0 8px; }
  .welcome-card p { font-size: 12px; line-height: 1.55; margin-bottom: 14px; }
  .welcome-meta { display: none; }
  .welcome-label { margin-bottom: 8px; }
  .welcome-cats { margin-bottom: 16px; gap: 6px; }
  .welcome-actions { gap: 8px; }
  .welcome-actions .btn { padding: 11px 18px; min-height: 0; }
}

/* ==========================================================================
   Dense-map additions: label decluttering, featured Sales Gallery, search
   ========================================================================== */

/* Labels that do not fit are hidden (the dot stays). Hover / keyboard focus always shows the name. */
.poi.nolabel .poi-label { opacity: 0; transform: translateX(-6px); pointer-events: none; }
.poi.nolabel:hover .poi-label, .poi.nolabel:focus-visible .poi-label { opacity: 1; transform: none; pointer-events: auto; }
.poi.dim .poi-label { opacity: 0; pointer-events: none; }
.poi.dim:hover .poi-label, .poi.dim:focus-visible .poi-label { opacity: 1; pointer-events: auto; }
.poi:hover, .poi:focus-visible { z-index: 8; }

/* Featured destinations: larger, category-coloured and prioritised over regular places. */
.poi.featured { z-index: 7; }
.poi.featured .poi-dot, .poi.featured .poi-pulse { left: -16px; top: -16px; width: 32px; height: 32px; }
.poi.featured .poi-dot { border-width: 2.5px; box-shadow: 0 0 0 5px rgba(224, 189, 121, .28), 0 4px 18px rgba(0, 0, 0, .55); }
.poi.featured .poi-dot svg { width: 17px; height: 17px; fill: #17221d; stroke-width: 1.6; }
.poi.featured .poi-pulse { animation-duration: 2s; border-width: 2px; }
.poi.featured .poi-label {
  left: 26px; top: -15px; padding: 7px 13px; font-size: 12px; letter-spacing: .4px; max-width: 220px;
  background: var(--c); color: #17221d; border-color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
}
/* Keep labels decluttered when featured markers are close together; their larger dots remain visible. */
.poi.featured.nolabel:not(:hover):not(:focus-visible):not(.active) .poi-label { opacity: 0; transform: translateX(-6px); pointer-events: none; }

/* Search box */
.panel-search { padding: 0 22px 10px; }
.panel-search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px; border: 1px solid #d9dccf; border-radius: 99px;
  background: rgba(255, 255, 255, .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d7955' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 13px center / 16px no-repeat;
  font: 500 13px "DM Sans", sans-serif; color: #27362d; outline: none; transition: border-color .2s, background-color .2s;
  -webkit-user-select: text; user-select: text;
}
.panel-search input:focus { border-color: #c7a66a; background-color: #fff; }
.panel-search input::placeholder { color: #8a9386; }

/* List: pinned Sales Gallery card + empty state */
.scenes { display: flex; flex-direction: column; }
.scenes li.featured { order: -1; }
.scenes li.featured .scene { background: linear-gradient(135deg, #fbf3df, #f4e7c4); border-color: #e0bd79; }
.scenes li.featured .poi-badge { background: #e0bd79; border-color: #e0bd79; color: #17221d; font-size: 15px; }
.scenes li.featured .scene.current .poi-badge { background: #24392c; border-color: #24392c; color: #e0bd79; }
.scenes li.no-results { order: 99; padding: 22px 14px; text-align: center; font-size: 12px; color: #8a9386; }

@media (max-width: 650px) {
  .panel-search { padding: 0 18px 8px; }
  .poi.featured .poi-dot, .poi.featured .poi-pulse { left: -14px; top: -14px; width: 28px; height: 28px; }
  .poi.featured .poi-label { left: 22px; top: -13px; font-size: 11px; padding: 6px 10px; max-width: 170px; }
}
