/**
 * COMUNEROS CENTRO COMERCIAL A CIELO ABIERTO
 * Paleta de Colores y Estilo Inspirado en Plaza de las Américas (plazadelasamericas.com.co)
 * Incluye Sistema de Perspectiva 3D Isométrica y Vidrio Translúcido (Glassmorphism)
 */

:root {
  /* FONDOS LUMINOSOS Y LIMPIOS */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-surface: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #7c3aed;

  /* TEXTO LEGIBLE DE ALTO CONTRASTE */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  /* PALETA MULTICOLOR PLAZA DE LAS AMÉRICAS */
  --primary: #6d28d9;
  --primary-hover: #5b21b6;
  --primary-light: #f5f3ff;
  --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  
  --accent-fuchsia: #db2777;
  --accent-fuchsia-light: #fdf2f8;
  --accent-orange: #ea580c;
  --accent-orange-light: #fff7ed;
  --accent-yellow: #ca8a04;
  --accent-yellow-light: #fefce8;
  --accent-green: #059669;
  --accent-green-light: #ecfdf5;

  /* RADIOS Y SOMBRAS */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 16px 36px rgba(109, 40, 217, 0.12);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fdf4ff 0%, #f8fafc 350px, #f8fafc 100%);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
}

input, select, textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER SUPERIOR ESTILO PLAZA */
.premium-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #db2777, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 24px;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(219, 39, 119, 0.35);
}

.brand-name {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #1e1b4b;
}

.brand-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-fuchsia-light);
  color: var(--accent-fuchsia);
  border: 1px solid rgba(219, 39, 119, 0.25);
  margin-left: 6px;
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-green-light);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--accent-green);
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* SISTEMA DE PESTAÑAS (TABS PLAZA DE LAS AMÉRICAS) */
.tabs-navigation-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.tabs-container {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-container::-webkit-scrollbar { display: none; }

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: rgba(124, 58, 237, 0.3);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--primary-gradient);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(219, 39, 119, 0.28);
}

.tab-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* BOTONES ESTILO PLAZA */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ea580c 0%, #db2777 50%, #7c3aed 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.3);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(219, 39, 119, 0.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* HERO SECTION LUMINOSO */
.hero-section {
  padding: 50px 0 36px;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--accent-fuchsia);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.hero-title {
  font-size: 46px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1.2px;
  color: #0f172a;
  margin-bottom: 16px;
}

.hero-gradient-text {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 50%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* BUSCADOR ELEGANTE EN FONDO BLANCO */
.search-box-card {
  max-width: 780px;
  margin: 0 auto 40px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 8px 10px;
  display: flex;
  gap: 10px;
  box-shadow: 0 14px 35px rgba(109, 40, 217, 0.08);
}

.search-input-group {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 12px 18px 12px 50px;
  font-size: 15px;
  font-weight: 500;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-select {
  background: #f8fafc;
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

/* FILTROS POR CATEGORÍA ESTILO PLAZA */
.category-filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 26px;
  scrollbar-width: none;
}
.category-filter-bar::-webkit-scrollbar { display: none; }

.cat-pill {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.cat-pill:hover {
  color: var(--primary);
  border-color: rgba(124, 58, 237, 0.4);
}

.cat-pill.active {
  background: var(--primary-gradient);
  color: #ffffff;
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.25);
}

/* REJILLA DE COMERCIOS */
.grid-comercios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.comercio-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.comercio-card:hover {
  transform: translateY(-5px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.comercio-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fdf4ff, #fae8ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid #f0abfc;
}

.badges-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.badge-status {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.badge-open {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.badge-closed {
  background: #f1f5f9;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.badge-gold {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-yellow-light);
  color: var(--accent-yellow);
  border: 1px solid rgba(202, 138, 4, 0.3);
}

.comercio-categoria {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.comercio-nombre {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.comercio-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-highlight {
  background: linear-gradient(135deg, #fff7ed, #fef2f2);
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #c2410c;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-address {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==========================================================
 * SISTEMA DE MAPA 3D ISOMÉTRICO TRANSLÚCIDO (GLASSMORPHIC)
 * ========================================================== */
.map-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
  align-items: start;
}

.map-wrapper-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
}

/* Barra de herramientas para controlar la cámara 3D y capas */
.map-toolbar-3d {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.mode-selector-pill {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid #e2e8f0;
  gap: 4px;
}

.mode-btn {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}

.mode-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Escenario con perspectiva 3D */
.map-viewport-3d-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid #cbd5e1;
  border-radius: 20px;
  overflow: hidden;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.04);
}

/* Plano que se inclina e interactúa en 3D */
.map-canvas-3d {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-origin: 50% 55%;
}

/* MODO 1: PERSPECTIVA 3D ISOMÉTRICA CON ELEVACIÓN */
.map-viewport-3d-scene.mode-3d .map-canvas-3d {
  transform: rotateX(46deg) rotateZ(-18deg) scale(0.92);
}

/* MODO 2: SATÉLITE HÍBRIDO (Tono oscuro satélite con calles brillantes) */
.map-viewport-3d-scene.mode-satellite {
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
}
.map-viewport-3d-scene.mode-satellite .map-canvas-3d {
  transform: rotateX(35deg) rotateZ(-10deg) scale(0.95);
}

/* MODO 3: PLANO 2D CENITAL */
.map-viewport-3d-scene.mode-2d .map-canvas-3d {
  transform: rotateX(0deg) rotateZ(0deg) scale(1);
}

/* EFECTO DE VIDRIO TRANSLÚCIDO (GLASSMORPHISM) EN EDIFICIOS */
.glass-block {
  fill: rgba(255, 255, 255, 0.65);
  stroke: rgba(148, 163, 184, 0.5);
  stroke-width: 1.5;
  filter: drop-shadow(0 8px 12px rgba(15, 23, 42, 0.12));
  backdrop-filter: blur(4px);
  transition: var(--transition);
}

.glass-block:hover {
  fill: rgba(245, 243, 255, 0.85);
  stroke: var(--primary);
}

/* PAREDES EXTRUIDAS EN 3D (SOMBRAS DE PROFUNDIDAD) */
.wall-3d-left {
  fill: rgba(203, 213, 225, 0.75);
}

.wall-3d-front {
  fill: rgba(148, 163, 184, 0.85);
}

/* EDIFICIO COLEGIO LOS COMUNEROS EN 3D DE CRISTAL AZUL */
.school-glass-roof {
  fill: rgba(219, 234, 254, 0.85);
  stroke: #3b82f6;
  stroke-width: 2;
  filter: drop-shadow(0 12px 20px rgba(59, 130, 246, 0.25));
}
.school-wall-left {
  fill: rgba(147, 197, 253, 0.9);
}
.school-wall-front {
  fill: rgba(96, 165, 250, 0.95);
}

/* CIRCUITO VERDE COMERCIAL BRILLANTE */
.circuit-glow-path {
  stroke: #10b981;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.6));
}

/* PINES FLOTANTES EN EL ESPACIO 3D */
.pin-3d-group {
  cursor: pointer;
  transition: transform 0.25s ease;
}

.pin-3d-group:hover {
  transform: translateY(-8px) scale(1.12);
}

.pin-shadow-ground {
  fill: rgba(15, 23, 42, 0.25);
  filter: blur(2px);
}

.pin-stem-line {
  stroke: rgba(100, 116, 139, 0.7);
  stroke-width: 2;
  stroke-dasharray: 2 2;
}

.map-sidepanel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* EVENTOS Y FERIAS */
.grid-eventos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.evento-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.evento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.evento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* FORMULARIO DE AFILIACIÓN */
.afiliacion-container {
  max-width: 820px;
  margin: 0 auto 60px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

/* FOOTER */
.premium-footer {
  margin-top: auto;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 40px 0;
  font-size: 13px;
  color: #94a3b8;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  padding: 30px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #f1f5f9;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* PULSE DE PINES */
.pin-pulse {
  animation: pulseMarker 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseMarker {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; }
}

@media (max-width: 900px) {
  .hero-title { font-size: 32px; }
  .map-layout-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .search-box-card { flex-direction: column; border-radius: var(--radius-lg); }
  .search-select { padding: 12px; }
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .header-inner { height: 68px; }
  .db-status-pill { display: none; }
}
