/* Elegí tu Stand — estilos del plano */
#elegi-plano-root {
  --c6x3: #0a97ab;  --c6x3-bg: #e2f3f5;   /* 6x3 libre (teal)  */
  --c3x2: #7d8894;  --c3x2-bg: #eef0f2;   /* 3x2 modular (gris) */
  --c6x2: #57a417;  --c6x2-bg: #eef8dc;   /* 6x2 modular (verde) */
  --c3x3: #333a78;  --c3x3-bg: #e6e7f2;   /* 3x3 espacio libre (azul oscuro) */
  --ctextil: #e07d19; --ctextil-bg: #fdecdb; /* box 4.8x2.4 textiles (naranja) */
  --taken: #9aa4ad; --taken-bg: #ccd3d9;
  --sel: #16a34a;   --sel-bg: #dcfce7;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1b2a4a;
  max-width: 1100px;
  margin: 0 auto;
}
#elegi-plano-root * { box-sizing: border-box; }

.est-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 .4rem; }

.est-intro {
  margin: 0 0 .9rem; font-size: .95rem; line-height: 1.5; color: #374151;
  background: #f1f7fb; border-left: 4px solid var(--c6x3);
  padding: .6rem .8rem; border-radius: 0 8px 8px 0;
}
.est-intro strong { color: #1b2a4a; }
.est-intro .est-intro-ok { color: var(--c6x3); font-weight: 700; }

.est-legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.2rem;
  margin: 0 0 .8rem; font-size: .85rem;
}
.est-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.est-swatch { width: 16px; height: 16px; border-radius: 3px; display: inline-block; border: 2px solid; }
.est-lg-6x3 { background: var(--c6x3-bg); border-color: var(--c6x3); }
.est-lg-3x2 { background: var(--c3x2-bg); border-color: var(--c3x2); }
.est-lg-6x2 { background: var(--c6x2-bg); border-color: var(--c6x2); }
.est-lg-3x3 { background: var(--c3x3-bg); border-color: var(--c3x3); }
.est-lg-textil { background: var(--ctextil-bg); border-color: var(--ctextil); }
.est-lg-reserved { background: var(--taken-bg); border-color: var(--taken); }

.est-plano { position: relative; }

.est-plano-scroll {
  width: 100%; overflow-x: auto; overflow-y: hidden; border: 1px solid #e5e7eb;
  border-radius: 10px; background: #fff; padding: 6px;
  -webkit-overflow-scrolling: touch;
}
/* Ocultamos la barra nativa: usamos la nuestra (consistente en todos los dispositivos) */
.est-plano-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.est-plano-scroll::-webkit-scrollbar { display: none; }
.est-svg { width: 100%; min-width: 640px; height: auto; display: block; }

/* Aviso de deslizar */
.est-scrollhint {
  display: none; font-size: .82rem; font-weight: 600; color: #2563eb;
  margin: 0 0 .45rem; transition: opacity .35s ease;
}
.est-scrollhint.est-hide { opacity: 0; pointer-events: none; }

/* Barra de scroll propia */
.est-scrollbar {
  display: none; position: relative; height: 14px; margin-top: 8px;
  background: #eef2f5; border-radius: 999px; cursor: pointer; touch-action: none;
}
.est-scrollbar-thumb {
  position: absolute; top: 3px; left: 0; height: 8px; width: 40px;
  background: var(--c6x3); border-radius: 999px; cursor: grab;
  transition: background .12s ease;
}
.est-scrollbar-thumb:hover { background: #1c86b3; }
.est-scrollbar-thumb:active { cursor: grabbing; }

/* Celdas de stands */
.est-cell { cursor: pointer; }
.est-cell text { pointer-events: none; user-select: none; }

.est-cell rect { transition: fill .12s ease; }

/* 6x3 libre (azul) disponible */
.est-6x3.est-available rect { fill: var(--c6x3-bg); stroke: var(--c6x3); stroke-width: 1.4; }
.est-6x3.est-available text { fill: var(--c6x3); }
.est-6x3.est-available:hover rect { fill: var(--c6x3); }
.est-6x3.est-available:hover text { fill: #fff; }

/* 3x2 modular (gris) disponible */
.est-3x2.est-available rect { fill: var(--c3x2-bg); stroke: var(--c3x2); stroke-width: 1.4; }
.est-3x2.est-available text { fill: #4b5560; }
.est-3x2.est-available:hover rect { fill: var(--c3x2); }
.est-3x2.est-available:hover text { fill: #fff; }

/* 6x2 modular (verde) disponible */
.est-6x2.est-available rect { fill: var(--c6x2-bg); stroke: var(--c6x2); stroke-width: 1.4; }
.est-6x2.est-available text { fill: #4a7314; }
.est-6x2.est-available:hover rect { fill: var(--c6x2); }
.est-6x2.est-available:hover text { fill: #fff; }

/* 3x3 espacio libre (azul oscuro) disponible */
.est-3x3.est-available rect { fill: var(--c3x3-bg); stroke: var(--c3x3); stroke-width: 1.4; }
.est-3x3.est-available text { fill: var(--c3x3); }
.est-3x3.est-available:hover rect { fill: var(--c3x3); }
.est-3x3.est-available:hover text { fill: #fff; }

/* box 4.8x2.4 textiles (naranja) disponible */
.est-textil.est-available rect { fill: var(--ctextil-bg); stroke: var(--ctextil); stroke-width: 1.4; }
.est-textil.est-available text { fill: #b5610d; }
.est-textil.est-available:hover rect { fill: var(--ctextil); }
.est-textil.est-available:hover text { fill: #fff; }

/* Reservado / bloqueado */
.est-reserved rect, .est-blocked rect { fill: var(--taken-bg); stroke: var(--taken); stroke-width: 1.2; }
.est-reserved text, .est-blocked text { fill: #6b7280; }
.est-reserved, .est-blocked { cursor: not-allowed; }

/* Tooltip "Reservado por:" (al pasar el mouse sobre un stand ocupado) */
.est-tooltip {
  position: absolute; left: 0; top: 0; z-index: 20;
  transform: translate(-50%, calc(-100% - 9px));
  max-width: 190px; padding: 7px 11px;
  background: #1f2937; color: #fff; border-radius: 8px;
  font-size: .74rem; line-height: 1.28; text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.20);
  white-space: normal; overflow-wrap: anywhere; word-break: break-word;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s ease;
}
.est-tooltip.est-tip-on { opacity: 1; visibility: visible; }
.est-tooltip::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #1f2937;
}
.est-tip-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; opacity: .78; margin-bottom: 2px; }
.est-tip-name { font-weight: 700; }

/* Seleccionado */
.est-selected rect { fill: var(--sel-bg) !important; stroke: var(--sel) !important; stroke-width: 2.4 !important; }
.est-selected text { fill: var(--sel) !important; }

.est-wall { pointer-events: none; }

/* Toast */
.est-toast {
  position: sticky; top: 8px; z-index: 5;
  margin: .6rem 0 0; padding: 0 .9rem; max-height: 0; overflow: hidden;
  background: #1b2a4a; color: #fff; border-radius: 8px;
  opacity: 0; transition: all .2s ease; font-size: .9rem;
}
.est-toast.est-toast-on { max-height: 60px; padding: .6rem .9rem; opacity: 1; }

/* Formulario */
.est-form-wrap { margin-top: 1rem; }
.est-form-card {
  border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.1rem 1.2rem;
  background: #fbfcfe; box-shadow: 0 6px 24px rgba(20,30,60,.06);
}
.est-form-head { font-size: 1.05rem; margin-bottom: .9rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.est-tag { font-size: .72rem; font-weight: 700; padding: .18rem .5rem; border-radius: 999px; color: #fff; }
.est-tag-6x3 { background: var(--c6x3); }
.est-tag-3x2 { background: var(--c3x2); }
.est-tag-6x2 { background: var(--c6x2); }
.est-tag-3x3 { background: var(--c3x3); }
.est-tag-textil { background: var(--ctextil); }

/* Selección múltiple */
.est-copy {
  font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  background: none; border: 0; color: var(--c6x3); text-decoration: underline;
  padding: 0; margin: 0 0 .8rem;
}
.est-multiform { display: grid; gap: 1rem; }
.est-stand-block {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: .8rem .9rem; background: #fff;
}
.est-stand-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; margin-bottom: .7rem;
}
.est-stand-code { font-size: 1rem; display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.est-remove {
  font: inherit; line-height: 1; cursor: pointer; border: 0; border-radius: 6px;
  background: #f3f4f6; color: #6b7280; padding: .3rem .5rem; font-weight: 700;
}
.est-remove:hover { background: #fde2e2; color: #b3141a; }
.est-grid { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; }
.est-field-full { grid-column: 1 / -1; }

.est-form { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; }
.est-field { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 600; }
.est-field:nth-child(3), /* email */
.est-field:has(textarea) { grid-column: 1 / -1; }
.est-field input, .est-field textarea {
  font: inherit; font-weight: 400; padding: .55rem .65rem;
  border: 1px solid #cbd2d9; border-radius: 8px; background: #fff;
}
.est-field input:focus, .est-field textarea:focus {
  outline: none; border-color: var(--c6x3); box-shadow: 0 0 0 3px rgba(41,163,212,.15);
}
.est-err { grid-column: 1 / -1; color: #b3141a; font-size: .82rem; min-height: 1em; }
.est-actions { grid-column: 1 / -1; display: flex; gap: .6rem; }
.est-btn { font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: .6rem 1.1rem; cursor: pointer; }
.est-btn-primary { background: var(--sel); color: #fff; }
.est-btn-primary:disabled { opacity: .6; cursor: default; }
.est-btn-ghost { background: #eef1f4; color: #1b2a4a; }

@media (max-width: 560px) {
  .est-form { grid-template-columns: 1fr; }
}
