/* ==========================================================================
   1es REAL ESTATE (www.1es.bo) — Sistema de Diseño Arquitectónico Cálido
   Fiel a 1es_app (Desktop, Teléfono, Tablet, Smart TV) y Masterplan Digital
   Paleta Oficial:
   - Arena / Marfil Arquitectónico: #F4EFE6 · #ECE3D3 · #DFD2BC
   - Superficie Tarjeta Cálida: #FBF9F5 · #FFFFFF
   - Carbón Obsidiana: #23201C · #181613
   - Oro Champagne 1es: #B89B5E · #D8BE86 · #9E8247
   - Esmeralda Verificado: #1D8432
   ========================================================================== */

:root {
  --sand-bg: #EFE7D9;
  --sand-light: #F7F3EB;
  --sand-card: #FAF7F1;
  --sand-pill: #F5F0E6;
  --sand-border: #E2D8C5;
  --sand-border-strong: #CFC1A7;
  --charcoal: #24211D;
  --charcoal-deep: #181613;
  --stone: #6B6357;
  --stone-muted: #8C8273;
  --gold: #B6995B;
  --gold-bright: #DFC488;
  --gold-deep: #967A40;
  --verified: #1D8432;
  --verified-dark: #156B26;
  --tv-glow: 0 0 0 3px #E2C378, 0 0 28px rgba(226, 195, 120, 0.65);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #E7DEC9;
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -8%, rgba(214, 194, 158, 0.55) 0%, rgba(214, 194, 158, 0) 46%),
    radial-gradient(circle at 15% 18%, rgba(255, 252, 246, 0.72) 0%, rgba(255, 252, 246, 0) 50%),
    linear-gradient(165deg, #F4EFE5 0%, #ECE3D2 52%, #E5DAC6 100%);
  color: var(--charcoal);
  overflow-x: hidden;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(235, 226, 210, 0.6);
}
::-webkit-scrollbar-thumb {
  background: #C9B99B;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-deep);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   SURFACES, CARDS & BUTTONS (1es_app Warm Ivory + Charcoal + Champagne Gold)
   ========================================================================== */

.card-1es {
  background: rgba(251, 248, 242, 0.94);
  border: 1px solid var(--sand-border);
  border-radius: 20px;
  box-shadow: 0 10px 26px -14px rgba(36, 33, 29, 0.16);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card-1es:hover {
  border-color: var(--gold);
  box-shadow: 0 18px 36px -16px rgba(36, 33, 29, 0.24);
  transform: translateY(-2px);
}

.panel-1es {
  background: rgba(249, 245, 238, 0.9);
  border: 1px solid var(--sand-border);
  border-radius: 22px;
  box-shadow: 0 12px 32px -18px rgba(36, 33, 29, 0.14);
}

.pill-search {
  background: #FBF9F4;
  border: 1px solid var(--sand-border);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(36, 33, 29, 0.04), 0 6px 18px -10px rgba(36, 33, 29, 0.12);
}

.btn-dark-gold {
  background: linear-gradient(180deg, #2D2924 0%, #1F1C18 100%);
  color: var(--gold-bright);
  border: 1px solid rgba(223, 196, 136, 0.28);
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-dark-gold:hover {
  background: #171512;
  box-shadow: 0 8px 20px -8px rgba(24, 22, 19, 0.55);
}

.btn-tour360 {
  background: linear-gradient(135deg, #BEA266 0%, #9E8247 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 245, 220, 0.45);
  font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(150, 122, 64, 0.55);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.btn-tour360:hover {
  filter: brightness(1.06);
  transform: scale(1.02);
}

.btn-cream-gold {
  background: #FAF6EE;
  color: var(--charcoal);
  border: 1.5px solid var(--gold);
  font-weight: 600;
  transition: all 0.18s ease;
}
.btn-cream-gold:hover {
  background: #F1E9D8;
}

.badge-verified {
  background: linear-gradient(135deg, #218E37 0%, #166E28 100%);
  color: #FFFFFF;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(22, 110, 40, 0.32);
}

/* Category big tiles (Ventas, Alquileres, Anticréticos verificados, Comerciales, Terrenos) */
.cat-tile {
  background: #F8F4EC;
  border: 1px solid var(--sand-border);
  border-radius: 18px;
  color: var(--charcoal);
  box-shadow: 0 6px 16px -10px rgba(36, 33, 29, 0.14);
  transition: all 0.2s ease;
}
.cat-tile svg {
  color: var(--gold-deep);
}
.cat-tile:hover {
  border-color: var(--gold);
  background: #FDFBF7;
  transform: translateY(-1px);
}
.cat-tile.active {
  background: linear-gradient(180deg, #2D2924 0%, #1F1C18 100%);
  border-color: #2D2924;
  color: var(--gold-bright);
  box-shadow: 0 10px 22px -8px rgba(24, 22, 19, 0.45);
}
.cat-tile.active svg {
  color: var(--gold-bright);
}

/* Top Nav Links */
.top-nav-link {
  position: relative;
  color: #4A443B;
  font-weight: 500;
  padding: 6px 4px;
  transition: color 0.18s ease;
}
.top-nav-link:hover {
  color: var(--charcoal-deep);
}
.top-nav-link.active {
  color: var(--charcoal-deep);
  font-weight: 700;
}
.top-nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--gold-deep);
}

/* Sub-filter chips */
.sub-chip {
  background: #F9F5ED;
  border: 1px solid var(--sand-border);
  color: var(--charcoal);
  border-radius: 999px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.sub-chip:hover {
  border-color: var(--gold);
}
.sub-chip.active {
  background: var(--charcoal);
  border-color: var(--charcoal);
  color: var(--gold-bright);
  font-weight: 600;
}

/* ==========================================================================
   MAP MARKERS & SATELLITE LOT POLYGONS
   ========================================================================== */

.map-price-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #FBF8F1;
  color: var(--charcoal);
  border: 1.5px solid #D7C9B0;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(28, 25, 20, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
  z-index: 15;
}
.map-price-pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: var(--charcoal);
}
.map-price-pin::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--charcoal);
  border: 1.5px solid var(--gold-bright);
}
.map-price-pin:hover {
  transform: translate(-50%, -104%) scale(1.05);
  z-index: 25;
}
.map-price-pin.active {
  background: linear-gradient(180deg, #2D2924 0%, #1C1916 100%);
  color: var(--gold-bright);
  border-color: var(--gold);
  z-index: 30;
  transform: translate(-50%, -106%) scale(1.06);
}

.user-gps-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #2563EB;
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 12px rgba(37, 99, 235, 0.20), 0 4px 10px rgba(0, 0, 0, 0.25);
  z-index: 12;
  pointer-events: none;
}

/* ==========================================================================
   MULTI-DEVICE SHELL ADAPTATIONS (PC · TELÉFONO · TABLET · SMART TV)
   ========================================================================== */

#device-shell {
  min-height: calc(100vh - 38px);
  display: flex;
  flex-direction: column;
  transition: max-width 0.28s ease, margin 0.28s ease, border-radius 0.28s ease;
}

#side-rail {
  display: none;
}

#mobile-header {
  display: none;
}

#mobile-bottom-bar {
  display: none;
}

#tv-remote-footer {
  display: none;
}

/* Natural Responsive Mobile (< 768px in Auto mode) */
@media (max-width: 767px) {
  body.mode-auto #desktop-header {
    display: none;
  }
  body.mode-auto #mobile-header {
    display: flex;
  }
  body.mode-auto #mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
  }
  body.mode-auto #main-stage {
    padding-bottom: 88px;
  }
}

/* Modo Nativo APK Android (oculta barra simuladora web y adapta Tablet/Phone/TV nativamente) */
body.native-apk #web-simulator-bar {
  display: none !important;
}
body.native-apk #device-shell {
  min-height: 100vh;
}
@media (min-width: 768px) and (max-width: 1180px) {
  body.native-apk.mode-auto #device-shell {
    flex-direction: row;
  }
  body.native-apk.mode-auto #desktop-header {
    display: none !important;
  }
  body.native-apk.mode-auto #side-rail {
    display: flex !important;
    width: 176px;
    flex-shrink: 0;
  }
  body.native-apk.mode-auto #tablet-top-actions {
    display: flex !important;
  }
}

/* Explicit TELÉFONO Preview Mode (Matches phone_home.png & phone_ficha.png) */
body.mode-mobile {
  background: #CFC4B0;
}
body.mode-mobile #device-shell {
  max-width: 420px;
  margin: 16px auto 28px;
  border: 10px solid #1E1C19;
  border-radius: 40px;
  background: linear-gradient(170deg, #F3EDE2 0%, #EAE0CE 100%);
  box-shadow: 0 32px 72px rgba(24, 22, 19, 0.35);
  overflow: hidden;
  position: relative;
}
body.mode-mobile #desktop-header {
  display: none !important;
}
body.mode-mobile #mobile-header {
  display: flex !important;
}
body.mode-mobile #mobile-bottom-bar {
  display: flex !important;
  position: sticky;
  bottom: 0;
  z-index: 40;
}
body.mode-mobile .force-mobile-stack {
  grid-template-columns: 1fr !important;
}
body.mode-mobile .hide-in-mobile {
  display: none !important;
}
body.mode-mobile .mobile-scroll-row {
  display: flex !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding-bottom: 6px;
}
body.mode-mobile .mobile-scroll-row > * {
  min-width: 286px;
  scroll-snap-align: start;
}

/* Explicit TABLET Preview Mode (Matches tablet_home.png with Left Rail) */
body.mode-tablet {
  background: #CFC4B0;
}
body.mode-tablet #device-shell {
  max-width: 1060px;
  margin: 16px auto 28px;
  border: 10px solid #1E1C19;
  border-radius: 32px;
  background: linear-gradient(165deg, #F3EDE2 0%, #EAE0CE 100%);
  box-shadow: 0 32px 72px rgba(24, 22, 19, 0.32);
  overflow: hidden;
  flex-direction: row;
}
body.mode-tablet #desktop-header {
  display: none !important;
}
body.mode-tablet #side-rail {
  display: flex !important;
  width: 176px;
  flex-shrink: 0;
}
body.mode-tablet #tablet-top-actions {
  display: flex !important;
}

/* Explicit SMART TV Mode (Matches tv_home.png 10-foot Showroom UI) */
body.mode-tv {
  background: #171512;
  font-size: 17px;
}
body.mode-tv #device-shell {
  max-width: 1480px;
  margin: 10px auto 16px;
  border: 8px solid #2A2621;
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 0%, rgba(205, 182, 138, 0.48) 0%, rgba(205, 182, 138, 0) 48%),
    linear-gradient(165deg, #EFE7D8 0%, #E4D8C2 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  flex-direction: row;
}
body.mode-tv #desktop-header {
  display: none !important;
}
body.mode-tv #side-rail {
  display: flex !important;
  width: 184px;
  flex-shrink: 0;
  background: rgba(235, 225, 207, 0.92);
}
body.mode-tv .rail-btn {
  flex-direction: column !important;
  justify-content: center;
  padding: 16px 10px !important;
  border-radius: 20px !important;
  background: #F8F4EC;
  border: 1px solid var(--sand-border);
  font-size: 15px !important;
  gap: 6px !important;
}
body.mode-tv .rail-btn.active {
  background: #24211D !important;
  color: var(--gold-bright) !important;
  border-color: var(--gold) !important;
}
body.mode-tv #tv-remote-footer {
  display: flex !important;
}
body.mode-tv *:focus,
body.mode-tv .tv-highlighted {
  outline: none !important;
  box-shadow: var(--tv-glow) !important;
  border-color: #E2C378 !important;
}

/* ==========================================================================
   FULL-SCREEN TOUR 360° VR OVERLAY (Matches desktop_tour360 / comerciales / terrenos)
   ========================================================================== */

.vr-panoramic-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #141210;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.vr-panoramic-stage:active {
  cursor: grabbing;
}

/* Floating 3D Pin Hotspot matching 1es_app mockups:
   Cream pill label on top + thin vertical stem + concentric gold target circle */
.vr-pin-3d {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 25;
  transition: transform 0.16s ease;
}
.vr-pin-3d:hover {
  transform: translate(-50%, -104%) scale(1.06);
  z-index: 35;
}
.vr-pin-label {
  background: rgba(251, 248, 241, 0.96);
  color: #1F1C18;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  padding: 7px 15px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(216, 190, 134, 0.65);
  white-space: nowrap;
}
.vr-pin-stem {
  width: 2px;
  height: 16px;
  background: rgba(251, 248, 241, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.vr-pin-target {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(190, 162, 102, 0.78);
  border: 2px solid rgba(255, 250, 238, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.vr-pin-target::after {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2.5px solid #FFFFFF;
  background: rgba(36, 33, 29, 0.35);
}

/* Info Hotspot (i circle + metric pill underneath, like 180 m² / 600 m²) */
.vr-info-3d {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 24;
  cursor: pointer;
}
.vr-info-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.94);
  border: 2.5px solid #C6AA6B;
  color: #8E7238;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.vr-info-badge {
  background: rgba(251, 248, 241, 0.96);
  color: #1F1C18;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 13px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
}

/* Glass HUD docks inside Tour 360° */
.vr-glass-pill {
  background: rgba(34, 31, 27, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 248, 232, 0.22);
  color: #FFFFFF;
}

.vr-thumb-card {
  position: relative;
  width: 122px;
  height: 70px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.24);
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.18s ease;
}
.vr-thumb-card:hover {
  border-color: rgba(226, 195, 120, 0.8);
  transform: translateY(-2px);
}
.vr-thumb-card.active {
  border-color: #E5C87E;
  box-shadow: 0 0 0 2px rgba(229, 200, 126, 0.45);
}
