/* ---------- Base ------------------------------------------------- */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
}


/* ---------- KrPano viewport ------------------------------------- */
#pano {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ---------- Floating “hamburger” -------------------------------- */
#menu-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 20;
  padding: 10px 16px;
  font-size: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}
#menu-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Dim overlay ----------------------------------------- */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 9;
  display: none;
}

/* ---------- Side menu ------------------------------------------- */
#menu-lateral {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100%;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  transform: translateX(-100%);
  transition: transform 0.3s;
}
#menu-lateral.open {
  transform: translateX(0);
}

/* close tab */
#menu-lateral .close-menu {
  position: absolute;
  top: 0;
  right: -50px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 0 10px 10px 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#menu-lateral.open .close-menu {
  opacity: 1;
  pointer-events: auto;
}
#menu-lateral .close-menu svg {
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

/* menu buttons */
.menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font: 600 16px/1 'Nunito', sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.menu-btn svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  stroke: #000;
  stroke-width: 2;
  fill: none;
}
.menu-btn:hover {
  background: #d9d9d9;
}

/* ---------- Full-screen panel ----------------------------------- */
#panel-full {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 30;
}
#panel-content {
  max-width: 90vw;
  max-height: 80vh;
  min-width: 40vw;
  padding: 24px 32px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* PlayCanvas / raw mode */
#panel-full.pc-raw {
  background: transparent;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
:root {
  /* 1 dvh = 1 % del viewport visible (Safari 16.4+, Chrome 108+) */
  --vh: 1dvh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
#panel-full.pc-raw #panel-content {
  padding: 0;
  max-width: none;
  max-height: none;
  width: 100vw;
  /* 100 dvh menos el área “peligrosa” */
  height: calc(var(--vh) * 100 - var(--safe-bottom));
}
/* iFrame usado en Vista Exterior */
.pc-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}
/* Imagen antigua con Panzoom (ya no se usa, pero no estorba) */
#panel-full.pc-raw img.panzoom {
  width: 100%;
  height: auto;
  user-select: none;
  cursor: grab;
}

/* ---------- Modal ------------------------------------------------ */
#modal-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
}
#modal {
  background: #fff;
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
}

/* ---------- Close buttons (panel / modal) ----------------------- */
.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
}

/* ---------- Helpers --------------------------------------------- */
.hidden {
  display: none !important;
}
#panel-content img,
#modal img {
  max-width: 100%;
  height: auto;
}

/* ---------- Visor “Planta” -------------------------------------- */
.zoom-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;              /* pinch-zoom / pan táctil */
}
.zoom-wrap img {
  display: block;
  transform-origin: center center;
  user-select: none;
  transition: transform 0.2s ease;
  max-width: none;                 /* dejar que escale libremente */
}

/* Asegura que los clics lleguen dentro del panel en modo raw */
#panel-full.pc-raw #panel-content {
  pointer-events: auto !important;
}
/* Desactiva el arrastre nativo de imágenes en WebKit/Blink */
.zoom-wrap img {
  -webkit-user-drag: none;
  user-drag: none;
}
/* ----- Navegador de plantas ----------------------------------- */
.floor-nav {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 1000;
}
.floor-nav button,
.floor-btn {
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font: 600 14px/1 'Nunito', sans-serif;
}
.floor-nav button.active { background: #fff; color: #000; }
.floor-btn.active        { background: #0077ff; }
/* -------- Botón ícono (regla) --------------------------------- */
.icon-btn{
  position:absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  right:16px;
  width:36px;
  height:36px;
  border:none;
  border-radius:4px;
  background:rgba(0,0,0,.6);
  color:#fff;
  display:none !important;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:1000;
}
.icon-btn.active{background:#0077ff;}
