/* ============================================================
   plano.css — Plano interactivo del Complejo Museológico
   Autocontenido (solo depende de variables.css por los tokens).
   Vive en la web de Museos.
============================================================ */

body { overflow: hidden; }

/* ---------- Header ---------- */
.pl-nav {
  position: sticky; top: 0; z-index: 100; height: 76px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.pl-nav__brand { display: flex; align-items: center; gap: 14px; }
.pl-nav__brand img { height: 44px; width: auto; }
.pl-nav__brand span {
  font-size: 1.12rem; font-weight: 600; color: var(--c-gris); line-height: 1.05;
  padding-left: 15px; border-left: 1.5px solid rgba(0,0,0,0.12);
}
.pl-nav__brand strong { color: var(--c-azul); font-weight: 700; }
.pl-nav__back {
  font-size: 0.9rem; font-weight: 600; color: var(--c-gris);
  padding: 9px 16px; border-radius: var(--r-pill); transition: all var(--t-base);
}
.pl-nav__back:hover { background: var(--c-azul-light); color: var(--c-azul); }
@media (max-width: 768px) { .pl-nav__brand span { font-size: 0.95rem; } }

/* ---------- Lienzo del mapa ---------- */
.pl-app { position: relative; height: calc(100vh - 76px); overflow: hidden; }
.pl-canvas {
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 70% 20%, rgba(4,113,154,0.06), transparent 60%),
    var(--c-cream);
}
.leaflet-container { background: transparent; font-family: var(--font); }
.leaflet-image-layer { filter: drop-shadow(0 18px 40px rgba(0,0,0,0.18)); border-radius: 6px; }
.leaflet-control-zoom a { border-radius: 8px !important; color: var(--c-gris) !important; }
.leaflet-bar { border: none !important; box-shadow: var(--shadow-md) !important; }

/* ---------- Glass base ---------- */
.glass {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 14px 44px rgba(0,0,0,0.18);
}

/* ---------- Panel flotante ---------- */
.m-panel {
  position: absolute; top: 18px; left: 18px; z-index: 600;
  width: 340px; max-height: calc(100% - 36px);
  display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
}
.m-panel[hidden] { display: none; }
.m-panel__head {
  padding: 22px 22px 16px; display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.m-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-azul); font-weight: 700; }
.m-panel__head h1 { font-size: 1.5rem; font-weight: 700; color: var(--c-dark); line-height: 1.1; margin: 7px 0 5px; letter-spacing: -0.01em; }
.m-count { font-size: 0.8rem; color: var(--c-mid); font-weight: 500; }
.m-panel__close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; border: none;
  background: rgba(0,0,0,0.05); color: var(--c-gris); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background var(--t-fast);
}
.m-panel__close:hover { background: rgba(0,0,0,0.1); }
.m-panel__foot { padding: 12px 22px; border-top: 1px solid rgba(0,0,0,0.06); font-size: 0.72rem; color: var(--c-mid); font-weight: 600; }

/* Botón reabrir */
.m-panel-open {
  position: absolute; top: 18px; left: 18px; z-index: 600; border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 12px; font-size: 0.85rem; font-weight: 700;
  color: var(--c-azul); display: none; align-items: center;
}
.m-panel-open:hover { background: #fff; }

/* ---------- Leyenda (museos) blanca ---------- */
.m-filtros { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 20px 16px; }
.m-filtros .chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: default;
  padding: 7px 12px; border-radius: var(--r-pill);
  background: #fff; border: 1px solid rgba(0,0,0,0.1); color: var(--c-gris);
  font-size: 0.76rem; font-weight: 600; box-shadow: var(--shadow-sm);
}
.m-filtros .chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- Sublistado gris ---------- */
.m-sub {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: #eceef1; border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 8px 16px -10px rgba(0,0,0,0.35); border-radius: 0 0 20px 20px;
}
.m-sub__label { padding: 13px 20px 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #9aa0a6; }
.pl-list { flex: 1; overflow-y: auto; padding: 0 12px 8px; display: flex; flex-direction: column; gap: 1px; list-style: none; margin: 0; }
.pl-list__it { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; cursor: pointer; transition: background var(--t-fast); }
.pl-list__it:hover { background: rgba(255,255,255,0.75); }
.pl-list__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; opacity: 0.85; }
.pl-list__nm { font-size: 0.84rem; color: #6b7075; line-height: 1.25; transition: color var(--t-fast); }
.pl-list__it:hover .pl-list__nm { color: var(--c-dark); }

/* ---------- Modo edición (calibración de pines) ---------- */
.pl-edit {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 2000;
  background: var(--c-dark); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 0.92rem; font-weight: 700; letter-spacing: 0.02em; box-shadow: var(--shadow-md);
}

/* ---------- Pines de hotspot ---------- */
.ph-spot { background: none; border: none; }
.ph-pin {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff; box-shadow: 0 3px 11px rgba(0,0,0,0.45);
  cursor: pointer; transition: transform 0.16s ease;
  animation: pinpop 0.4s var(--ease-back, ease-out) backwards;
}
.ph-pin span { font-size: 17px; line-height: 1; color: #fff; }
.ph-spot:hover .ph-pin { transform: scale(1.16); z-index: 1000; }
@keyframes pinpop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- Popups ---------- */
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.mp-pop { font-family: var(--font); }
.mp-pop__cat { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 3px; }
.mp-pop strong { font-size: 0.98rem; color: var(--c-dark); display: block; line-height: 1.25; }
.mp-pop p { font-size: 0.8rem; color: var(--c-mid); margin: 6px 0 10px; line-height: 1.45; }
.mp-pop a { font-size: 0.82rem; font-weight: 700; color: var(--c-azul); text-decoration: none; }

@media (max-width: 640px) {
  .m-panel { width: auto; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 44%; }
  .m-panel__head h1 { font-size: 1.3rem; }
}
