:root {
  --yellow: #f4ca19;
  --yellow-dark: #d9b416;
  --black: #000000;
  --white: #ffffff;
  --gray-bg: #f8f8f8;
  --gray-border: #e0e0e0;
  --gray-text: #333333;
  --error-red: #e53935;
  --header-h: 130px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--white); color: var(--black);
  overflow-x: hidden; scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* ── HEADER ── */
.site-header {
  background: var(--yellow); color: var(--black);
  height: var(--header-h);
  position: fixed; top: 0; width: 100%; z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  padding: 2px 15px 0;
  display: flex; align-items: flex-start; justify-content: center;
}
/* Título fijado arriba a la derecha (no afecta layout) */
.header-title {
  position: absolute; top: 6px; right: 15px;
  font-weight: 900; font-size: 12px; letter-spacing: .5px;
  text-transform: uppercase; line-height: 1.1; color: var(--black);
  white-space: nowrap; z-index: 1;
}
/* Texto de marca en esquina superior izquierda */
.header-brand {
  position: absolute; top: 6px; left: 15px;
  z-index: 1;
}
.brand-line {
  display: block;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.brand-line.costo {
  font-size: 12px;
  color: var(--black);
}
/* Logo del header: centrado, tamaño fijo */
.header-logo-img {
  position: relative; z-index: 2;
  height: 80px;
  width: auto;
  max-width: 90vw;
  max-height: 80px;
  object-fit: contain;
  object-position: center;
}
/* Botones navegación centrados debajo */
.nav-buttons {
  position: absolute; bottom: 8px; left: 0; width: 100%;
  display: flex; justify-content: center; gap: 10px; padding: 0 10px;
}
/* Header móvil: solo logo y botones, ocultar textos */
@media (max-width: 560px) {
  .header-brand { display: none; }
  .header-title { display: none; }
  .header-logo-img { height: 60px; }
  .header-logo { left: 0; transform: none; }
}
.nav-btn {
  background: var(--yellow); border: 1.5px solid var(--black); color: var(--black);
  padding: 10px 14px; border-radius: 30px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; cursor: pointer; flex: 1; max-width: 120px;
  text-align: center; font-family: inherit; text-decoration: none; appearance: none; touch-action: manipulation;
}
.nav-btn:active { opacity: .7; }
.nav-btn-link { line-height: 1.2; }

/* ── MAP ── */
.public-map-page { min-height: 100vh; }
#map-container { position: relative; margin-top: var(--header-h); height: calc(100dvh - 86px); min-height: 420px; width: 100%; z-index: 1; }
#map-container #map-widget { position: absolute; inset: 0; height: 100%; width: 100%; touch-action: pan-x pan-y pinch-zoom; }
#map-container::after {
  content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 55px;
  background: rgba(222,185,20,.4); backdrop-filter: blur(8px) saturate(130%); z-index: 999; pointer-events: none;
}
.map-legend { position: absolute; top: 14px; left: 14px; z-index: 800; background: rgba(255,255,255,.94); border-radius: 12px; padding: 10px 14px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.map-legend small { display: block; font-weight: 400; color: #555; margin-top: 2px; }

/* ── MARKER ── */
.private-pin { width: 38px; height: 38px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--yellow); border: 3px solid var(--black); box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.private-pin-wrapper { background: transparent; }
.category-pin { width: 36px; height: 44px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--yellow); color: var(--black); border: 2px solid var(--black); box-shadow: 0 2px 6px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; font-size: 18px; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }
.category-emoji { display: inline-block; transform: rotate(45deg); }
.category-pin-wrapper { background: transparent; }
.popup-private { margin: .4rem 0 0; color: #7a5a00; font-size: .9rem; font-weight: 700; }
.popup-report strong { font-weight: 900; }
/* Popups del mapa público */
.popup-report { max-width: 280px; word-break: break-word; line-height: 1.5; }
.popup-status { font-weight: 700; }
.popup-photo-thumb { max-width: 180px; max-height: 120px; margin-top: 6px; border-radius: 6px; object-fit: cover; border: 1px solid #ddd; }

/* ── FAB ── */
.fab {
  position: fixed; bottom: 25px; background: var(--yellow); color: var(--black);
  border: none; border-radius: 50%; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,.3);
  z-index: 999; display: flex; align-items: center; justify-content: center;
  font-weight: 800; text-decoration: none; appearance: none; touch-action: manipulation;
}
.fab-plus { right: 20px; width: 65px; height: 65px; font-size: 36px; line-height: 1; }
.fab-filter { left: 20px; width: 56px; height: 56px; }

/* ── FOOTER ── */
.site-footer { background: var(--gray-text); color: #bbb; padding: 40px 20px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); text-align: center; width: 100%; }
.footer-hidden { display: none; }
.intro-hidden { display: none; }
.site-footer p { margin-bottom: 6px; }
.footer-title { color: var(--white); }
.copyright { font-size: 12px; opacity: .7; }

/* ── MODALS ── */
.modal {
  display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px); overflow-y: auto; -webkit-overflow-scroll: touch;
}
.modal.open { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: #fffefe; margin: calc(2vh + 70px) auto; padding: 20px; width: 95%; max-width: 350px; border-radius: 20px; position: relative; }
.modal-content.wide { max-width: 560px; }
.close-btn { float: right; font-size: 24px; cursor: pointer; color: #999; line-height: 1; padding: 4px 4px 4px 12px; touch-action: manipulation; }
.modal h3 { font-size: 1.1rem; font-weight: 900; text-transform: uppercase; margin-bottom: 14px; color: var(--black); }
.contact-item { font-size: 14px; line-height: 1.6; margin-bottom: 10px; }

/* ── FILTRO ── */
.filter-grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 10px 5px; }
.btn-filter-opt { width: 100%; padding: 18px 10px; background: var(--gray-bg); border: 1px solid var(--gray-border); border-radius: 25px; font-size: 11px; font-weight: 800; text-transform: uppercase; cursor: pointer; color: #000 !important; font-family: inherit; line-height: 1.2; touch-action: manipulation; appearance: none; }
.btn-filter-opt:active { opacity: .7; }
.btn-filter-opt.active { background: var(--yellow) !important; color: var(--black) !important; }

/* ── BANNER ── */
.banner-intro { background-color: var(--yellow); text-align: center; color: var(--black); display: flex; flex-direction: column; align-items: center; width: 100%; }
.banner-content { max-width: 560px; width: 100%; padding: 40px 25px; }
.banner-intro h2 { font-size: clamp(1.3rem,4.5vw,1.9rem); font-weight: 800; margin-bottom: 20px; line-height: 1.3; text-transform: uppercase; }
.banner-intro p { font-size: clamp(.9rem,3.5vw,1rem); line-height: 1.6; margin-bottom: 10px; }
.banner-instruction { background: #fff; border-radius: 14px; padding: 16px; font-weight: 600; font-size: clamp(1rem,3vw,1.1rem); }
.banner-cta { font-size: 1.1rem; font-weight: 900; text-transform: uppercase; margin: 18px 0 8px; line-height: 1.2; }
.banner-sub { font-size: clamp(.85rem,3vw,.95rem); line-height: 1.6; font-weight: 500; margin-top: 8px; }
.hazard-stripes { width: 100%; height: 45px; border-top: 3px solid var(--black); background: repeating-linear-gradient(-45deg, var(--black), var(--black) 25px, var(--yellow) 25px, var(--yellow) 50px); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: calc(36px + env(safe-area-inset-bottom)); left: 50%; z-index: 9999;
  transform: translateX(-50%); background: var(--white); border-radius: 18px; padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18); display: flex; align-items: center; gap: 14px;
  width: calc(100% - 48px); max-width: 380px; opacity: 0; pointer-events: none;
  transition: opacity .35s cubic-bezier(.4,0,.2,1), transform .35s cubic-bezier(.4,0,.2,1);
}
.toast.show { opacity: 1; }
.toast-accent { flex-shrink: 0; width: 5px; height: 36px; background: var(--yellow); border-radius: 3px; }
.toast-text { flex: 1; font-size: 14px; font-weight: 600; color: #111; line-height: 1.4; }

/* ── GUÍA DE BIENVENIDA ── */
.guia-overlay {
  position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.78); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.guia-overlay.open { display: flex; }
.guia-modal { background: #1e1e1e; border-radius: 24px; width: 100%; max-width: 370px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 32px 24px 24px; position: relative; box-shadow: 0 24px 64px rgba(0,0,0,.4); }
.guia-modal::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--yellow); border-radius: 24px 24px 0 0; }
.guia-cerrar { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 28px; color: #ccc; cursor: pointer; line-height: 1; padding: 4px 8px; z-index: 1; font-family: inherit; }
.guia-slides-wrapper { overflow: hidden; width: 100%; }
.guia-slides { display: flex; will-change: transform; transition: transform .4s cubic-bezier(.4,0,.2,1); }
.guia-slide { min-width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 8px 16px; min-height: 230px; justify-content: center; }
.guia-icono { font-size: 52px; margin-bottom: 18px; line-height: 1; display: block; }
.guia-titulo { font-size: 1.15rem; font-weight: 900; margin-bottom: 14px; line-height: 1.3; text-transform: uppercase; letter-spacing: .3px; color: #eee; }
.guia-texto { font-size: .95rem; color: #ccc; line-height: 1.65; }
.guia-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.guia-dot { width: 8px; height: 8px; border-radius: 50%; background: #555; cursor: pointer; }
.guia-dot.activo { background: var(--yellow); width: 20px; border-radius: 4px; }
.guia-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.guia-btn-omitir { background: none; border: none; color: #aaa; font-size: 12px; font-weight: 700; text-transform: uppercase; cursor: pointer; font-family: inherit; padding: 8px; }
.guia-btn-grupo { display: flex; gap: 10px; }
.guia-btn-nav { background: var(--gray-bg); border: 1.5px solid var(--gray-border); border-radius: 50px; padding: 10px 18px; font-size: 13px; font-weight: 800; text-transform: uppercase; cursor: pointer; font-family: inherit; color: var(--black); touch-action: manipulation; appearance: none; }
.guia-btn-nav:disabled { opacity: .4; cursor: default; }
.guia-btn-sig { background: var(--yellow); border-color: var(--yellow); color: var(--black); }

/* Leaflet z-index por debajo de header y FABs */
.leaflet-pane { z-index: 400; }
.leaflet-top, .leaflet-bottom { z-index: 500; }

/* ── MODAL DE REPORTE (SCREEN-2) ── */
.report-modal .modal-title { font-size: 1.1rem; font-weight: 900; text-transform: uppercase; margin: 6px 0 12px; color: var(--black); }
.report-modal .modal-content { padding: 20px; max-width: 520px; }

/* Grupo de campo: leyenda ARRIBA, input DEBAJO (apilado en columna) */
.input-group { display: flex; flex-direction: column; width: 100%; margin-bottom: 10px; }

/* Fila: elementos lado a lado (botones Cancelar/Enviar, Cámara/Galería) */
.row { display: flex; gap: 10px; }

.field-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-text); margin-bottom: 4px; display: block; }
.report-modal select, .report-modal textarea, .report-modal input[type="text"], .report-modal input[type="tel"], .report-modal input[type="email"] {
  width: 100%; padding: 10px; margin: 0; border: 1px solid var(--gray-border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fafafa; color: var(--black); appearance: none; outline: none; line-height: 1.4;
  box-sizing: border-box;
}
.report-modal select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.report-modal textarea { resize: none; min-height: 70px; }
.error-message { display: none; color: var(--error-red); font-size: 12px; font-weight: bold; margin-top: 2px; text-align: left; }
input.invalid, textarea.invalid, select.invalid { border: 2px solid var(--yellow) !important; }

.btn-location { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: #fafafa; border: 1.5px solid var(--gray-border); border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; color: var(--gray-text); appearance: none; touch-action: manipulation; }
.loc-icon { color: var(--red, #e53935); font-size: 16px; }
.report-modal .input-group.report-location #map-widget { min-height: 180px; height: 180px; }
.report-modal .loc-feedback { font-size: 11px; color: #666; margin-top: 3px; text-align: center; line-height: 1.3; }
.loc-feedback.ok { color: #0a7d3f; font-weight: 700; }

.file-area { background: #f8f9fa; border: 2px dashed #ddd; padding: 12px; border-radius: 10px; text-align: center; margin: 10px 0; }
.file-title { font-size: 12px; font-weight: 800; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .3px; }
.btn-file { flex: 1; background: var(--yellow); color: var(--black); border: none; padding: 12px; border-radius: 8px; font-weight: 800; font-size: 12px; text-transform: uppercase; cursor: pointer; font-family: inherit; display: inline-block; text-align: center; appearance: none; touch-action: manipulation; }
.file-name { font-size: 12px; font-weight: 700; color: #0a7d3f; margin-top: 8px; }

.report-actions { gap: 10px; margin-top: 12px; }
/* Cancelar y Enviar: mismo diseño, misma tipografía, a la par.
   Definición GLOBAL de .btn-send para que el submit no use estilos del navegador. */
.btn-send,
.btn-cancel {
  flex: 1 1 0%; min-width: 0; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border-radius: 10px;
  font-family: inherit; font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .3px;
  cursor: pointer; touch-action: manipulation; appearance: none;
  border: 1.5px solid var(--gray-border);
  line-height: 1.2; box-sizing: border-box;
  margin: 0; text-align: center;
}
.btn-send { background: var(--yellow); color: var(--black); border-color: var(--yellow); }
.btn-send:active, .btn-cancel:active { opacity: .8; }
.btn-cancel { background: var(--gray-bg); color: var(--black); }

/* Checkbox "Usar ubicación actual" */
.loc-check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 12px; background: #fafafa; border: 1.5px solid var(--gray-border); border-radius: 10px; user-select: none; touch-action: manipulation; font-weight: 700; font-size: 14px; }
.loc-check input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--yellow); cursor: pointer; }
.loc-feedback.searching { color: var(--yellow-dark); font-weight: 800; }

/* Vista previa de imagen cargada */
.report-preview { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; background: #f0f0f0; }

/* Error de envío dentro del modal */
.form-error { background: #fdecea; border: 1px solid #f5c6c2; color: #b3261e; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }

/* Modal de captura de cámara */
.camera-capture { text-align: center; }
.camera-video { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; display: block; margin: 0 0 12px; }
