/* ======================================================= */
/* VARIABLES Y ESTILOS GLOBALES */
/* ======================================================= */
:root {
  --primary-bg: rgba(255, 255, 255, 0.925);
  --border-radius: 2vh;
  --modal-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --interactive-hover: rgba(0, 123, 255, 0.2);
  --margin: 10px;
  --primary-btn-bg: rgba(255, 255, 255, 0.555);
  --primary-border: #1b325c;
  --primary-text: #1b325c;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-y: auto;
  font-family: Arial, sans-serif;
  background: linear-gradient(to bottom, #34668f, #232a51);
}

body {
  display: flex;
  flex-direction: column;
}

/* ======================================================= */
/* HEADER */
/* ======================================================= */
header {
  background-color: var(--primary-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border-radius: var(--border-radius);
  margin: var(--margin);
  z-index: 100;
  height: 100px;
}

header img {
  height: 100%;
  width: auto;
}

/* ======================================================= */
/* INSTRUCCIONES */
/* ======================================================= */
.instructions {
  background-color: var(--primary-btn-bg);
  color: var(--primary-text);
  padding: 10px;
  text-align: center;
  margin: 0 var(--margin);
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: bold;
}

.instructions p {
  margin: 0;
}

/* ======================================================= */
/* CONTENEDOR INTERACTIVO */
/* ======================================================= */
.interactive-container {
  flex-grow: 1;
  position: relative;
  width: calc(100% - 2 * var(--margin));
  margin: var(--margin);
  overflow: hidden;
  cursor: grab;
  border-radius: var(--border-radius);
  background: #fafafa;
  aspect-ratio: 3916 / 2586;
}

/* ======================================================= */
/* CONTROLES */
/* ======================================================= */
.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: var(--margin);
}

.controls button {
  padding: 8px 16px;
  background-color: var(--primary-btn-bg);
  color: var(--primary-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.controls button:hover {
  background-color: var(--interactive-hover);
}

/* ======================================================= */
/* RESPONSIVE */
/* ======================================================= */
@media (max-width: 768px) {
  header {
    height: 50px;
    padding: 5px;
    margin: 5px;
  }
  .interactive-container {
    width: calc(100% - 10px);
    margin: 5px;
  }
  .instructions {
    margin: 0 5px;
  }
  .controls button {
    padding: 6px 12px;
    font-size: 14px;
  }
}

/* ======================================================= */
/* PLANO BASE */
/* ======================================================= */
.container {
  position: absolute;
  width: 3916px;
  height: 2326px;
  transform-origin: 0 0;
  border-radius: var(--border-radius);
  background: url("plano-fic.svg") no-repeat center/cover;
  image-rendering: auto;
  
}

/* ======================================================= */
/* ÁREAS INTERACTIVAS */
/* ======================================================= */
.interactive-area {
  position: absolute;
  background: #fff;
  border: 1px solid #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  padding: 2px;
  border-radius: 1.5vb;
  box-sizing: border-box;
  transition: transform 0.2s, background 0.2s;
}

.interactive-area:hover,
.interactive-area:focus {
  background: var(--interactive-hover);
  transform: scale(1.1);
}

/* ======================================================= */
/* BANDERAS Y LOGOS */
/* ======================================================= */
.stand-icons {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  
}

.stand-flag {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mantiene el relleno, adaptando la proporción del stand */
}

/* 🚩 AJUSTE DE LOGO: Se limita el tamaño máximo del logo a 58px para evitar desbordes */
.stand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Usa 'cover' como las banderas */
}



/* ======================================================= */
/* NOMBRE DEL STAND */
/* ======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&display=swap');

.stand-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    
    /* CAMBIOS CLAVE PARA SALTO DE PALABRA Y AJUSTE */
    white-space: normal; /* Permite que el texto salte a la siguiente línea */
    word-break: normal; /* Asegura que las palabras no se rompan a la mitad */
    overflow-wrap: break-word; /* Mantiene el salto de línea en los espacios de forma predeterminada */
    
    font-size: 12px; /* Tamaño base */
    line-height: 1.1;
    
    color: #000;
    text-align: center;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.7);
    
    /* Ajustes del contenedor */
    background: rgba(255, 255, 255, 0.85);
    padding: 2px;
    height: auto; 
    min-height: 18px; 
    
    margin: 0;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.interactive-area.zoomed-in .stand-name {
    opacity: 1;
}



/* ======================================================= */
/* MODAL */
/* ======================================================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: var(--modal-shadow);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* 🔹 HEADER FIJO */
.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 20px 15px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #1b325c;
  font-weight: 700;
  text-align: center;
}

.modal-flag {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.modal-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* 🔹 CUERPO SCROLLABLE */
.modal-body {
  padding: 15px 20px 20px;
  overflow-y: auto;
  flex: 1;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #1b325c #eaeaea;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: #1b325c;
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-track {
  background: #eaeaea;
}

.modal-menu {
  list-style: disc;
  text-align: left;
  padding: 0 0 0 20px;
  margin: 0;
  color: #1b325c;
  font-size: 15px;
  line-height: 1.5;
}

/* 🔹 BOTÓN CERRAR */
.close-btn {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  z-index: 3;
}

.close-btn:hover {
  color: #000;
}

/* ======================================================= */
/* TOOLTIP */
/* ======================================================= */
.tooltip-text {
  position: absolute;
  z-index: 1000;
  background: rgba(30, 30, 30, 0.85);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transform-origin: bottom center;
  transform: scale(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tooltip-text.show {
  opacity: 1;
  transform: scale(1);
}

.tooltip-text::before {
  content: '';
  position: absolute;
  border: 8px solid transparent;
  border-top-color: rgba(30, 30, 30, 0.85);
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
}

/* ======================================================= */
/* SERVICIOS INVISIBLES */
/* ======================================================= */
.interactive-area.invisible-service {
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  cursor: default;
  transform: none !important;
  pointer-events: auto;
}

.interactive-area.invisible-service .stand-name,
.interactive-area.invisible-service .stand-flag {
  display: none !important;
}

.invisible-service:hover {
  background: transparent !important;
}

.modal-menu {
  list-style: disc;
  text-align: left;
  padding: 0 0 0 25px;
  margin: 10px 0;
  color: #1b325c;
  font-size: 15px;
  line-height: 1.4;
}