/* ================================================
   Leb Torá · Paraguas
   Estética exacta de gmajbetdavid.com
   Bold, contundente, azul eléctrico puro
   ================================================ */

:root {
  /* Paleta ESTRICTA del sitio */
  --ink: #000000;
  --paper: #FFFFFF;
  --blue: #2B31E5;           /* azul eléctrico del "dona ya" */
  --blue-dark: #1E23C4;
  --blue-hover: #1E23C4;

  /* Grises minimalistas */
  --line: #E5E5E5;
  --muted: #666666;

  /* Estados */
  --red: #E53935;
  --green: #2E7D32;
  --amber: #F59E0B;

  /* Tipografía */
  --font: 'Urbanist', 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Geometría */
  --radius: 8px;
  --radius-lg: 16px;
  --pill: 100px;

  --header-h: 68px;
}

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

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  font-weight: 500;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--ink);
}

/* ================================================
   HEADER
   ================================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark-hebrew {
  font-family: 'Noto Sans Hebrew', serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
  direction: rtl;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
  letter-spacing: 0;
}

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

.pill-btn {
  background: var(--blue);
  color: var(--paper);
  padding: 11px 22px;
  border-radius: var(--pill);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-btn:hover { background: var(--blue-dark); }

.pill-btn.outline {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

.pill-btn.outline:hover { background: var(--ink); color: var(--paper); }

.icon-link {
  width: 40px; height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--paper);
  text-decoration: none;
  transition: all 0.15s ease;
}

.icon-link:hover { background: var(--ink); color: var(--paper); }

.icon-link svg { width: 18px; height: 18px; }

/* ================================================
   MAP
   ================================================ */

.map-container {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  background: var(--paper);
}

#map { width: 100%; height: 100%; }

.locate-btn {
  position: fixed;
  bottom: 120px;
  right: 20px;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  transition: all 0.15s ease;
  color: var(--ink);
}

.locate-btn:hover { background: var(--ink); color: var(--paper); }
.locate-btn.active { background: var(--blue); border-color: var(--blue); color: var(--paper); }
.locate-btn svg { width: 22px; height: 22px; }

.bottom-card {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bottom-card.hidden { transform: translateY(calc(100% + 24px)); }

.bottom-card-info { flex: 1; min-width: 0; }

.bottom-card-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 700;
}

.bottom-card-text {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.bottom-card-text strong { color: var(--blue); }

/* ================================================
   BUTTONS
   ================================================ */

.btn-primary {
  background: var(--blue);
  color: var(--paper);
  border: none;
  padding: 12px 24px;
  border-radius: var(--pill);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 10px 22px;
  border-radius: var(--pill);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ================================================
   LEAFLET POPUP
   ================================================ */

.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  padding: 0 !important;
  background: var(--paper) !important;
  border: 2px solid var(--ink) !important;
  box-shadow: 6px 6px 0 var(--ink) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: var(--font) !important;
  color: var(--ink) !important;
  min-width: 240px;
}

.leaflet-popup-tip {
  background: var(--ink) !important;
  box-shadow: none !important;
}

.leaflet-control-zoom a {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border-color: var(--ink) !important;
  font-family: var(--font) !important;
  font-weight: 900 !important;
}

.leaflet-control-zoom a:hover { background: var(--ink) !important; color: var(--paper) !important; }

.station-popup { padding: 16px; }

.station-popup-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 4px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.station-popup-address {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.station-popup-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 12px;
  border-radius: var(--pill);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.station-popup-stock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.station-popup-stock-dot.low { background: var(--amber); }
.station-popup-stock-dot.empty { background: var(--red); }

.station-popup-actions { display: flex; gap: 8px; }

.station-popup-actions a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  padding: 11px 14px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.popup-btn-primary { background: var(--blue); color: var(--paper); }
.popup-btn-primary:hover { background: var(--blue-dark); }

/* ================================================
   MARKERS
   ================================================ */

.umbrella-marker {
  width: 42px; height: 42px;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.umbrella-marker svg {
  width: 19px; height: 19px;
  color: var(--paper);
  transform: rotate(45deg);
  stroke-width: 2.5;
}

.umbrella-marker.empty { background: #999; }
.umbrella-marker.low { background: var(--amber); }

.user-location-marker {
  width: 20px; height: 20px;
  background: var(--blue);
  border: 3px solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--blue), 0 0 0 9px rgba(43, 49, 229, 0.25);
  animation: pulse-user 2s ease-in-out infinite;
}

@keyframes pulse-user {
  0%, 100% { box-shadow: 0 0 0 3px var(--blue), 0 0 0 9px rgba(43, 49, 229, 0.25); }
  50% { box-shadow: 0 0 0 3px var(--blue), 0 0 0 16px rgba(43, 49, 229, 0.06); }
}

/* ================================================
   ADMIN
   ================================================ */

body.admin-page { overflow: auto; background: var(--paper); }
body.admin-page html { overflow: auto; }

.admin-layout {
  padding-top: calc(var(--header-h) + 32px);
  padding-bottom: 80px;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.login-card {
  max-width: 460px;
  margin: 40px auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
}

.login-card-emblem {
  width: 76px; height: 76px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-card-emblem svg { width: 32px; height: 32px; stroke-width: 2.5; }

.login-card h1 {
  font-size: 38px;
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.login-card p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 32px;
  font-weight: 500;
}

.form-group { text-align: left; margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  transition: all 0.15s ease;
}

.form-group textarea { resize: vertical; min-height: 90px; }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--ink);
}

.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.form-actions .btn-primary, .form-actions .btn-ghost { flex: 1; }

.error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 2px solid var(--red);
  border-radius: var(--radius);
  display: none;
  font-weight: 700;
}

.error-msg.visible { display: block; }

.success-msg {
  color: var(--green);
  font-size: 13px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  display: none;
  font-weight: 700;
}

.success-msg.visible { display: block; }

.admin-hero {
  margin-bottom: 40px;
  padding: 32px 0 24px;
  border-bottom: 2px solid var(--ink);
}

.admin-hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
  font-weight: 900;
}

.admin-hero h1 {
  font-size: 56px;
  margin-bottom: 8px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.admin-hero p { color: var(--muted); font-size: 15px; font-weight: 500; }

.admin-section {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.admin-section-header h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.admin-section-header-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.stations-list { display: flex; flex-direction: column; gap: 10px; }

.station-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.15s ease;
}

.station-card:hover { background: var(--ink); }
.station-card:hover .station-card-name { color: var(--paper); }
.station-card:hover .station-card-address { color: rgba(255,255,255,0.7); }
.station-card:hover .station-card-stock { color: var(--paper); }

.station-card-marker {
  width: 44px; height: 44px;
  background: var(--blue);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.station-card-marker svg { width: 20px; height: 20px; stroke-width: 2.5; }

.station-card-info { flex: 1; min-width: 0; }

.station-card-name {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -0.02em;
}

.station-card-address {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.station-card-stock {
  font-size: 12px;
  color: var(--blue);
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.station-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.station-card-actions button {
  width: 38px; height: 38px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
}

.station-card:hover .station-card-actions button {
  border-color: var(--paper);
  color: var(--paper);
  background: transparent;
}

.station-card-actions button:hover {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: var(--paper) !important;
}

.station-card-actions button.danger:hover {
  background: var(--red) !important;
  border-color: var(--red) !important;
}

.station-card-actions svg { width: 16px; height: 16px; stroke-width: 2.5; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.empty-state-icon { font-size: 44px; margin-bottom: 12px; }

/* ================================================
   UTILS
   ================================================ */

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: var(--paper);
  padding: 14px 24px;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.hidden { display: none; }

.spinner {
  width: 42px; height: 42px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 540px) {
  .admin-hero h1 { font-size: 42px; }
  .admin-section { padding: 22px; }
  .login-card { padding: 32px 22px; }
  .brand-sub { display: none; }
  .site-header { padding: 0 16px; }
}

/* ================================================
   NEAREST BAR (arriba)
   ================================================ */

.nearest-bar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  z-index: 500;
  cursor: pointer;
  transform: translateY(-120%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}

.nearest-bar.visible { transform: translateY(0); }
.nearest-bar.empty { background: #991B1B; }

.nearest-bar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nearest-bar-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
}

.nearest-bar.empty .nearest-bar-icon { background: rgba(255,255,255,0.2); }

.nearest-bar-icon svg { width: 20px; height: 20px; }

.nearest-bar-text { flex: 1; min-width: 0; }

.nearest-bar-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  font-weight: 800;
  margin-bottom: 2px;
}

.nearest-bar-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--paper);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearest-bar-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  margin-top: 1px;
}

.nearest-bar-arrow {
  flex-shrink: 0;
  color: var(--paper);
  opacity: 0.8;
}

.nearest-bar-arrow svg { width: 18px; height: 18px; }

/* ================================================
   POPUP — botón reportar + meta
   ================================================ */

.station-popup-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.popup-btn-report {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 11px 14px;
  border-radius: var(--pill);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.popup-btn-report:hover {
  background: var(--ink);
  color: var(--paper);
}

.popup-btn-report svg { width: 14px; height: 14px; stroke-width: 2.5; }

/* ================================================
   REPORT MODAL
   ================================================ */

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.report-modal.visible { display: flex; }

@media (min-width: 640px) {
  .report-modal { align-items: center; }
}

.report-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.report-dialog {
  position: relative;
  background: var(--paper);
  border-top: 3px solid var(--ink);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 28px 24px 24px;
  animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .report-dialog {
    border: 3px solid var(--ink);
    border-radius: 24px;
    margin: 20px;
  }
}

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

.report-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
}

.report-close:hover { background: var(--ink); color: var(--paper); }
.report-close svg { width: 16px; height: 16px; }

.report-header { margin-bottom: 24px; padding-right: 44px; }

.report-eyebrow {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 900;
  margin-bottom: 6px;
}

.report-station-name {
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.report-options { display: flex; flex-direction: column; gap: 10px; }

.report-option {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: all 0.15s ease;
}

.report-option:hover {
  background: var(--ink);
}

.report-option:hover .report-option-title,
.report-option:hover .report-option-sub {
  color: var(--paper);
}

.report-option:disabled { opacity: 0.4; cursor: not-allowed; }

.report-option-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.report-option-text { flex: 1; }

.report-option-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 3px;
}

.report-option-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.report-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
}

/* ================================================
   ROUTE OPTIONS
   ================================================ */

.route-option-icon {
  width: 44px;
  height: 44px;
  background: var(--blue);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.route-option:hover .route-option-icon {
  background: var(--paper);
  color: var(--blue);
}

.route-option-icon svg { width: 22px; height: 22px; }
