/* =============================================
   LURUACO — CSS INDEPENDIENTE
   Complementa estilos.css. NO duplica:
   – hero-title-overlay, page-title        → estilos.css
   – description, description-text         → estilos.css
   – comunidades-content, grid-container   → estilos.css
   – descriptor-section (bg, padding)      → estilos.css
   – descriptor-title, descriptor-text     → estilos.css
   – footer-section y todo el footer       → estilos.css
   ============================================= */

/* ── HERO ── */
.luruaco-hero {
  height: 100vh; width: 100%; position: relative;
  display: flex; align-items: center; justify-content: flex-start; overflow: hidden;
}
.luruaco-hero .hero-background {
  position: absolute; inset: 0;
  background-image: url('/assets/Imagenes de alta resolucion/luruaco-portada.jpg');
  background-size: cover; background-position: center; background-repeat: no-repeat; z-index: 1;
}
.luruaco-hero .hero-background::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.18); z-index: 2;
}

/* ── GRID 4 ZONAS (override del grid genérico de estilos.css) ── */
/* estilos.css define repeat(auto-fit); aquí necesitamos áreas nombradas */
.luruaco-page .comunidades-grid {
  grid-template-areas:
    "zone1 zone2"
    "zone3 zone4" !important;
}
.luruaco-page .comunidades-grid .zone1 { grid-area: zone1; }
.luruaco-page .comunidades-grid .zone2 { grid-area: zone2; }
.luruaco-page .comunidades-grid .zone3 { grid-area: zone3; }
.luruaco-page .comunidades-grid .zone4 { grid-area: zone4; }

.luruaco-page .comunidades-grid .zone1 .content-image-card {
  width: 100%; max-width: 856px; aspect-ratio: 5 / 3;
  border: 4px solid #092C44; box-shadow: 8px 8px 0 #092C44;
  background: #092C44; border-radius: 15px; overflow: hidden;
}
.luruaco-page .comunidades-grid .zone4 .content-image-card {
  width: 100%; max-width: 856px; aspect-ratio: 5 / 3;
  border: 4px solid #092C44; box-shadow: -8px 8px 0 #092C44;
  background: #092C44; border-radius: 15px; overflow: hidden;
}
.luruaco-page .content-image { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 991.98px) {
  .luruaco-page .comunidades-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas: "zone1" "zone2" "zone3" "zone4" !important;
  }
  .luruaco-page .comunidades-grid .zone1 .content-image-card,
  .luruaco-page .comunidades-grid .zone4 .content-image-card {
    max-width: 100%; box-shadow: 4px 4px 0 #092C44;
  }
}

/* ── VIEWER INTERACTIVO ──────────────────────────────────────────────────────── */
.interactive-image-container {
  position: relative; max-width: 100%; margin: 0 auto;
  container-type: inline-size;
}

/* Acento verde Luruaco en el nombre de cartografía */
.cartography-name {
  position: absolute; top: 14px; left: 14px;
  background: linear-gradient(135deg, rgba(139,195,74,0.92), rgba(104,159,56,0.92));
  color: #fff; padding: 6px 16px; border-radius: 20px;
  font-size: clamp(9px, 2.2cqw, 15px); font-weight: 600; z-index: 10;
  opacity: 0; transform: translateY(-8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  max-width: calc(100% - 90px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cartography-name.visible { opacity: 1; transform: translateY(0); }

.image-viewer {
  position: relative; width: 100%;
  height: clamp(260px, 35vw, 450px);
  border-radius: 15px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.image-layer  { position: absolute; inset: 0; }
.hidden-layer { display: none; }
.interactive-img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }

/* Botones nav — verde Luruaco */
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(139,195,74,0.92); color: #fff; border: none;
  width: clamp(34px,4vw,48px); height: clamp(34px,4vw,48px);
  border-radius: 50%; cursor: pointer; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(13px,1.4vw,17px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  transition: background 0.25s ease, transform 0.25s ease;
}
.prev-btn { left: 10px; }
.next-btn { right: 10px; }
.nav-btn:hover { background: rgba(104,159,56,1); transform: translateY(-50%) scale(1.1); }

/* Toggle btn — verde Luruaco */
.image-toggle-container { margin-top: 18px; text-align: center; }
.toggle-btn {
  background: linear-gradient(135deg,#8BC34A,#689F38);
  color: #fff; border: none;
  padding: clamp(7px,1vw,11px) clamp(14px,2vw,22px);
  border-radius: 22px; cursor: pointer;
  font-size: clamp(12px,1.1vw,15px); font-weight: 500;
  display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: background 0.25s ease, transform 0.25s ease;
}
.toggle-btn:hover { background: linear-gradient(135deg,#689F38,#8BC34A); transform: translateY(-2px); }
.toggle-icon { transition: transform 0.3s ease; }
.toggle-btn:hover .toggle-icon { transform: rotate(180deg); }

/* Indicadores — verde Luruaco */
.image-indicators { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.indicator {
  width: 11px; height: 11px; border-radius: 50%;
  background: rgba(7,42,64,0.28); cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.indicator.active  { background: #8BC34A; transform: scale(1.25); }
.indicator:hover   { background: rgba(139,195,74,0.65); }

/* ── MARKERS ── */
@keyframes markerPulse {
  0%   { transform: translate(-50%,-50%) scale(1); }
  50%  { transform: translate(-50%,-50%) scale(1.12); }
  100% { transform: translate(-50%,-50%) scale(1); }
}
.point-marker {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: #e64900; border: 2px solid #fff;
  transform: translate(-50%,-50%); z-index: 30; cursor: pointer;
  animation: markerPulse 3.5s ease-in-out infinite;
}
.point-marker-label {
  position: absolute; left: 20px; top: -6px;
  background: rgba(255,255,255,0.96); padding: 4px 9px;
  border-radius: 6px; font-size: 12px; color: #072A40;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  display: none; white-space: nowrap; pointer-events: none;
}
.point-marker:hover .point-marker-label { display: block; }

/* ── UI READ-ONLY (oculta controles de edición) ── */
.floating-controls,
.cartography-description,
#pointsPanel, #pointsList, #pointModal { display: none !important; }

/* Fuerza visibilidad del descriptor (cartography-editor puede ocultarlo) */
.descriptor-text { display: block !important; }

/* ── DESCRIPTOR CARDS ── */
.cartography-desc { margin-bottom: 14px; }
.cartography-desc strong {
  display: block; font-size: clamp(20px,1.75vw,24px);
  color: #072A40; margin-bottom: 5px;
}
.cartography-desc p {
  font-size: clamp(16px,1.5vw,22px); color: #2D3139; line-height: 1.55; margin: 0;
}
.carto-hint {
  font-size: clamp(12px,1.25vw,20px); color: #4a6072;
  font-style: italic; margin-top: 10px; text-align: center;
}
.carto-point-entry {
  background: rgba(255,255,255,0.85); border-radius: 10px;
  padding: 12px 14px; border-left: 4px solid #8BC34A;
  display: flex; flex-direction: column; gap: 8px;
}
.carto-back-btn { display: none !important; }
.carto-point-title { font-size: clamp(13px,1.2vw,15px); font-weight: 700; color: #072A40; }
.carto-point-info  { font-size: clamp(12px,1.05vw,14px); color: #4b5563; line-height: 1.45; margin: 0; }
.carto-descriptors-list { display: flex; flex-direction: column; gap: 7px; }
.carto-descriptor-item  { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.carto-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 6px; border-radius: 20px; border: 1.5px solid;
  font-size: clamp(12px,1.05vw,16px); font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.carto-badge-shape { width: 10px; height: 10px; display: inline-block; flex-shrink: 0; }
.carto-badge-shape.sym-circle   { border-radius: 50%; background: currentColor; }
.carto-badge-shape.sym-square   { background: currentColor; }
.carto-badge-shape.sym-triangle {
  width: 0; height: 0; background: transparent;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 10px solid currentColor; transform: translateY(-1px);
}
.carto-descriptor-info { font-size: clamp(12px,1.05vw,16px); color: #4b5563; line-height: 1.45; flex: 1; min-width: 0; }

/* ── MODAL (editor interno) ── */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); z-index: 70; }
.modal.hidden { display: none; }
.modal-content { background: #fff; padding: 18px; border-radius: 12px; width: min(520px,95%); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.modal-content label { color: #333; font-weight: 600; }
.modal-content input,
.modal-content textarea { color: #072A40 !important; background: #fff !important; }
.modal-actions { text-align: right; margin-top: 8px; }
.symbols-container { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.descriptors-container { display: flex; flex-direction: column; }
.toggle-edit-btn { background: #f3f4f6; color: #072A40; border: 1px solid #d1d5db; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.toggle-edit-btn:hover { background: #e6e9ec; }
.export-btn { background: #072A40; color: #fff; border: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; margin-left: 8px; }

/* ══════════════════════════════════════
   ESTADÍSTICAS
══════════════════════════════════════ */
.stats-section {
  padding: clamp(48px,7vw,100px) 0;
  background-color: #f8f9fa;
}
.stats-title {
  font-size: clamp(22px,3.5vw,48px); font-weight: 700;
  color: #0F4C75; margin-bottom: clamp(28px,4vw,50px); text-align: center;
}
.stats-dashboard {
  display: grid;
  grid-template-columns: 1fr clamp(80px,10vw,120px);
  gap: clamp(12px,2vw,24px);
  background: #fff; border-radius: 20px;
  padding: clamp(16px,2.5vw,24px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.stats-left { display: grid; grid-template-rows: auto auto auto; gap: clamp(12px,2vw,20px); }

/* Shapes */
.stats-shapes {
  background: #e6e6e6; border-radius: 10px;
  padding: clamp(16px,2.5vw,26px) clamp(20px,3vw,36px);
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px,4vw,48px); border: 2px solid #142139;
}
/* Tarjeta de color sólido — idéntico a Carreto */
.shape {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: clamp(10px,1.4vw,16px); flex: 1 1 0;
  border-radius: clamp(14px,2vw,24px);
  padding: clamp(16px,2.2vw,28px) clamp(10px,1.5vw,18px);
  background: #2E4DA9; transition: background 0.35s ease;
  min-height: clamp(130px,16vw,190px);
}
.shape::before { display: none !important; }
.shape-circle  { order: 1; }
.shape-triangle{ order: 2; }
.shape-rect    { order: 3; }

/* Wrapper de la figura — transparente, solo centra */
.shape-wrap {
  display: flex; align-items: center; justify-content: center;
  width: clamp(60px,7vw,96px); height: clamp(60px,7vw,96px);
  background: transparent !important; border: none !important;
}

/* Etiqueta de texto dinámico — nombra la figura y categoría */
.shape-label {
  font-size: clamp(11px,1.3vw,16px); font-weight: 600; color: #fff;
  text-align: center; line-height: 1.3; white-space: pre-line;
  transition: color 0.35s ease;
}

/* Figuras blancas sobre el fondo de color */
.shape-inner-circle {
  width: clamp(40px,5vw,96px); height: clamp(40px,5vw,96px);
  border-radius: 50%; display: block; background: #fff;
  transition: background 0.35s ease;
}
.shape-inner-triangle {
  width: 0; height: 0;
  border-left:   clamp(18px,2.1vw,58px) solid transparent;
  border-right:  clamp(18px,2.1vw,58px) solid transparent;
  border-bottom: clamp(32px,3.8vw,80px) solid #fff;
  display: block; transition: border-bottom-color 0.35s ease;
}
.shape-inner-rect {
  width: clamp(40px,5vw,96px); height: clamp(40px,5vw,96px);
  border-radius: 7px; display: block; background: #fff;
  transition: background 0.35s ease;
}

/* Estados de color: cambian el fondo de .shape y la figura se adapta */
#statsShapes.state-blue   .shape { background: #2E4DA9; }
#statsShapes.state-blue   .shape-inner-circle,
#statsShapes.state-blue   .shape-inner-rect     { background: #fff !important; }
#statsShapes.state-blue   .shape-inner-triangle { border-bottom-color: #fff !important; }
#statsShapes.state-blue   .shape-label { color: #fff; }

#statsShapes.state-yellow .shape { background: #E4D22A; }
#statsShapes.state-yellow .shape-inner-circle,
#statsShapes.state-yellow .shape-inner-rect     { background: #142139 !important; }
#statsShapes.state-yellow .shape-inner-triangle { border-bottom-color: #142139 !important; }
#statsShapes.state-yellow .shape-label { color: #142139; }

#statsShapes.state-green  .shape { background: #2EA942; }
#statsShapes.state-green  .shape-inner-circle,
#statsShapes.state-green  .shape-inner-rect     { background: #fff !important; }
#statsShapes.state-green  .shape-inner-triangle { border-bottom-color: #fff !important; }
#statsShapes.state-green  .shape-label { color: #fff; }

#statsShapes.state-red    .shape { background: #A9362E; }
#statsShapes.state-red    .shape-inner-circle,
#statsShapes.state-red    .shape-inner-rect     { background: #fff !important; }
#statsShapes.state-red    .shape-inner-triangle { border-bottom-color: #fff !important; }
#statsShapes.state-red    .shape-label { color: #fff; }

#statsShapes.state-brown  .shape { background: #8A602C; }
#statsShapes.state-brown  .shape-inner-circle,
#statsShapes.state-brown  .shape-inner-rect     { background: #fff !important; }
#statsShapes.state-brown  .shape-inner-triangle { border-bottom-color: #fff !important; }
#statsShapes.state-brown  .shape-label { color: #fff; }

/* Panel de números */
.stats-main {
  background: #e6e6e6; border-radius: 8px;
  padding: clamp(14px,2.5vw,24px) clamp(14px,2.5vw,26px);
  border: 2px solid #142139;
}
.stats-card-title {
  font-size: clamp(16px,1.2vw,24px); font-weight: 600; color: #000;
  margin-bottom: clamp(8px,1.2vw,12px); transition: opacity 0.2s ease;
}
.stats-main-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.stats-main-item { text-align: center; flex: 1 1 0; }
.stat-number { font-size: clamp(36px,5vw,64px); font-weight: 700; color: #1f2937; }
.stat-label  { font-size: clamp(14px,1.1vw,18px); color: #1f2937; margin-top: 4px; }

/* Cards resumen */
.stats-summary-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(8px,1.5vw,16px); }
.summary-card {
  background: #e6e6e6; border-radius: 8px;
  padding: clamp(12px,1.5vw,18px); border: 2px solid #142139;
  text-align: left; position: relative; min-height: clamp(90px,12vw,120px);
}
.summary-number { font-size: clamp(28px,3.5vw,44px); font-weight: 700; margin-top: clamp(16px,2vw,22px); color: #1f2937; }
.summary-label  { font-size: clamp(14px,1.05vw,18px); margin-top: 4px; color: #1f2937; }
.total-card { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; }

/* Botones categoría */
.stats-right {
  display: flex; flex-direction: column;
  gap: clamp(6px,1vw,12px); align-items: stretch; justify-content: center;
}
.color-btn {
  width: 100%; border: 2px solid #142139; border-radius: 8px;
  font-size: clamp(14px,1.05vw,18px); font-weight: 600; cursor: pointer;
  box-shadow: 2px 2px 0 #142139; height: clamp(48px,7vw,72px);
  transition: filter 0.2s ease, transform 0.15s ease;
}
.color-btn:hover  { filter: brightness(1.07); transform: translateX(-2px); }
.color-btn:focus  { outline: 2px solid #8BC34A; }
.color-btn.active { transform: translateX(-4px); box-shadow: 4px 4px 0 #142139; }
.color-blue   { background: #2E4DA9; color: #fff; }
.color-yellow { background: #E4D22A; color: #142139; }
.color-green  { background: #2EA942; color: #fff; }
.color-red    { background: #A9362E; color: #fff; }
.color-brown  { background: #8A602C; color: #fff; }

/* ══════════════════════════════════════
   RESPONSIVE — ≤ 991 px
══════════════════════════════════════ */
@media (max-width: 991.98px) {
  .stats-dashboard     { grid-template-columns: 1fr; }
  .stats-right         { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: stretch; }
  .color-btn           { flex: 1 1 clamp(70px,18%,120px); height: 48px; }
  .stats-summary-cards { grid-template-columns: repeat(2,1fr); }
  .stats-shapes        { gap: clamp(10px,2.5vw,24px); padding: 14px clamp(10px,2vw,20px); }
  .shape               { padding: clamp(10px,1.6vw,18px) clamp(6px,1.2vw,14px); min-height: 110px; gap: 8px; }
  .shape-wrap          { width: 52px; height: 52px; }
  .shape-inner-circle  { width: 36px; height: 36px; }
  .shape-inner-triangle { border-left-width: 14px; border-right-width: 14px; border-bottom-width: 26px; }
  .shape-inner-rect    { width: 36px; height: 36px; }
  .shape-label         { font-size: 9px; max-width: 62px; }
  .cartography-name    { font-size: 10px; padding: 5px 12px; top: 8px; left: 8px; }
  .carto-badge         { font-size: 11px; }
}

/* ══════════════════════════════════════
   RESPONSIVE — ≤ 575 px (móvil)
══════════════════════════════════════ */
@media (max-width: 575.98px) {
  .stats-summary-cards { grid-template-columns: 1fr 1fr; }
  .image-viewer        { height: clamp(200px,52vw,300px); }
  .stats-shapes        { gap: 6px; padding: 10px 6px; overflow-x: auto; }
  .shape               { padding: 8px 5px; min-height: 88px; min-width: 72px; gap: 6px; border-radius: 12px; }
  .shape-wrap          { width: 38px; height: 38px; }
  .shape-inner-circle  { width: 28px; height: 28px; }
  .shape-inner-triangle { border-left-width: 12px; border-right-width: 12px; border-bottom-width: 20px; }
  .shape-inner-rect    { width: 28px; height: 22px; border-radius: 4px; }
  .shape-label         { font-size: 8px; max-width: 54px; line-height: 1.2; }
  .point-marker-label  { display: none !important; }
  .carto-badge         { font-size: 10px; white-space: normal; }
  .carto-descriptor-item { flex-wrap: wrap; }
}

@media (hover: none) {
  .point-marker-label { display: none !important; }
}

/* Utilidades */
.align-right { text-align: right; }
.mt-8        { margin-top: 8px; }