/* Pulido visual rescatado de Qeubo-beta-3/qeubo-isaac-jesus. */
/* Integración reversible: contraste, legibilidad y señalización. Sin dependencias de PHP/MySQL. */

/* --- 0. CORRECCIÓN DE TRACKING Y TAMAÑOS MÍNIMOS --- */
h1, h2, h3, .page-intro h1, .hero h1 {
  letter-spacing: -0.02em !important;
  text-wrap: balance;
}
.brand {
  letter-spacing: -0.03em !important;
}
.eyebrow {
  font-size: 12px !important;
  letter-spacing: 0.08em !important;
  font-weight: 850;
}
.small, .muted, .listing-location, .listing-meta {
  font-size: 13px !important;
  line-height: 1.5;
}
.pill {
  font-size: 12px !important;
  font-weight: 800;
  padding: 6px 12px;
}

/* --- 1. BOTONES DE CABECERA Y SEÑALIZACIÓN --- */
.topbar {
  gap: 16px;
}

/* Botón Entrar / Mi Cuenta */
.head-actions #account-shortcut {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: #eaf3ed;
  border: 1.5px solid #235c4b;
  color: #123d30;
  font-weight: 800;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(27, 83, 68, 0.08);
}
.head-actions #account-shortcut:hover {
  background: #1b5344;
  color: #ffffff;
  border-color: #1b5344;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 83, 68, 0.22);
}

/* Botón Guardados */
.head-actions [data-go="favoritos"] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f4f2ea;
  border: 1.5px solid #c9c1b0;
  color: #1c362c;
  font-weight: 800;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 12px;
  transition: all 0.18s ease;
}
.head-actions [data-go="favoritos"]:hover {
  background: #eae4d4;
  border-color: #a89a84;
  color: #11221e;
  transform: translateY(-1px);
}
.head-actions [data-go="favoritos"] .count-bubble {
  background: #e0684b;
  color: #ffffff;
  font-weight: 900;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(224, 104, 75, 0.4);
}

/* Botón Mis Avisos */
.head-actions [data-go="misavisos"] {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #f4f2ea;
  border: 1.5px solid #c9c1b0;
  color: #1c362c;
  font-weight: 800;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 12px;
  transition: all 0.18s ease;
}
.head-actions [data-go="misavisos"]:hover {
  background: #eae4d4;
  border-color: #a89a84;
  color: #11221e;
  transform: translateY(-1px);
}

/* Botón Escanear Cámara */
.qeubo-scan-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eaf3ed;
  border: 1.5px solid #2d6b59;
  color: #164638;
  font-weight: 800;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.qeubo-scan-trigger:hover {
  background: #1b5344;
  color: #ffffff;
  border-color: #1b5344;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 83, 68, 0.18);
}

/* Botón Publicar */
.btn.coral {
  background: #c84e31 !important;
  color: #ffffff !important;
  font-weight: 850 !important;
  font-size: 14px !important;
  border-radius: 12px !important;
  padding: 9px 18px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  transition: all 0.18s ease !important;
}
.btn.coral:hover {
  background: #ab391f !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}

/* Barra de categorías superior */
.toplinks .navbtn {
  color: #183327;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.toplinks .navbtn:hover {
  background: rgba(27, 83, 68, 0.08);
  color: #11221e;
}
.toplinks .navbtn.active {
  color: #1b5344;
  box-shadow: inset 0 -3px #e0684b;
  background: rgba(27, 83, 68, 0.06);
}

/* --- 2. SEÑALIZACIÓN Y LEGIBILIDAD DE MAPAS --- */

/* Sección de mapa en publicar */
.qeubo-location-editor {
  background: #ffffff;
  border: 1.5px solid #ccd8d0;
  border-radius: 18px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 4px 16px rgba(17, 34, 30, 0.04);
}
.qeubo-location-editor h3 {
  color: #11221e;
  font-size: 1.18rem;
  font-weight: 850;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qeubo-location-editor .small {
  color: #273e34;
  font-size: 13px;
  line-height: 1.55;
}

/* Botones de acción del mapa */
.qeubo-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 10px;
}
.qeubo-map-actions .btn.outline.sm,
.qeubo-map-actions button {
  background: #ffffff;
  border: 1.5px solid #235c4b;
  color: #144033;
  font-weight: 800;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
  box-shadow: 0 2px 5px rgba(27, 83, 68, 0.08);
}
.qeubo-map-actions .btn.outline.sm:hover,
.qeubo-map-actions button:hover {
  background: #1b5344;
  color: #ffffff;
  border-color: #1b5344;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 83, 68, 0.22);
}

/* Badge de coordenadas */
#qeubo-coordinates {
  background: #eaf3ed;
  color: #123d30;
  font-weight: 800;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #bad0c4;
  display: inline-block;
}

/* Marco del mapa interactivo */
#qeubo-map, #detail-leaflet-map {
  border: 2px solid #a8c4b2 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 18px rgba(17, 34, 30, 0.08) !important;
  overflow: hidden;
}

/* Mapa en la ficha de detalle (#detalle) */
.qeubo-approximate-location {
  background: #ffffff;
  border: 1.5px solid #ccd8d0;
  border-radius: 16px;
  padding: 18px;
  margin: 18px 0;
  box-shadow: 0 3px 12px rgba(17, 34, 30, 0.04);
}
.qeubo-approximate-location strong {
  color: #11221e;
  font-size: 1.08rem;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 7px;
}
#qeubo-detail-map-label {
  color: #1b4538 !important;
  font-weight: 750 !important;
  font-size: 13.5px !important;
  margin: 6px 0 10px;
}
#qeubo-detail-map-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eaf3ed;
  border: 1.5px solid #235c4b;
  color: #123d30;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.18s ease;
  margin-right: 8px;
  margin-top: 6px;
}
#qeubo-detail-map-link a:hover {
  background: #1b5344;
  color: #ffffff;
  border-color: #1b5344;
  transform: translateY(-1px);
}

/* --- 3. BOTÓN VER AVISO EN TARJETAS --- */
.listing .listing-footer .view-ad {
  background: #eaf3ed;
  border: 1.5px solid #235c4b;
  color: #123d30;
  font-weight: 800;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.listing .listing-footer .view-ad:hover {
  background: #1b5344;
  color: #ffffff;
  border-color: #1b5344;
}

/* --- 4. CONTRASTE MEJORADO DE TEXTOS --- */
.small, .muted {
  color: #273e34;
}
.eyebrow {
  color: #144033;
  font-weight: 900;
}
.listing-price .usd-price {
  color: #11221e;
  font-weight: 900;
  font-size: 1.15rem;
}
.listing-price .ves-main {
  color: #1e4a3c;
  font-weight: 750;
  font-size: 0.88rem;
}

/* --- 5. ADAPTACIÓN MODO OSCURO (DARK THEME) --- */
html[data-theme="dark"] .head-actions #account-shortcut {
  background: #1c3327;
  border-color: #7dd3a7;
  color: #9fe6c1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .head-actions #account-shortcut:hover {
  background: #7dd3a7;
  color: #101c16;
  border-color: #7dd3a7;
}

html[data-theme="dark"] .head-actions [data-go="favoritos"],
html[data-theme="dark"] .head-actions [data-go="misavisos"] {
  background: #1a2a22;
  border-color: #385544;
  color: #d8ede0;
}
html[data-theme="dark"] .head-actions [data-go="favoritos"]:hover,
html[data-theme="dark"] .head-actions [data-go="misavisos"]:hover {
  background: #253d30;
  border-color: #527e64;
  color: #ffffff;
}

html[data-theme="dark"] .qeubo-scan-trigger {
  background: #1e3328;
  border-color: #62b38b;
  color: #9fe6c1;
}
html[data-theme="dark"] .qeubo-scan-trigger:hover {
  background: #7dd3a7;
  color: #101c16;
}

html[data-theme="dark"] .toplinks .navbtn {
  color: #e2f0e6;
}
html[data-theme="dark"] .toplinks .navbtn:hover {
  background: rgba(125, 211, 167, 0.12);
  color: #ffffff;
}

html[data-theme="dark"] .qeubo-location-editor,
html[data-theme="dark"] .qeubo-approximate-location {
  background: #182720;
  border-color: #365241;
  color: #ecf7ef;
}
html[data-theme="dark"] .qeubo-location-editor h3,
html[data-theme="dark"] .qeubo-approximate-location strong {
  color: #ffffff;
}
html[data-theme="dark"] .qeubo-location-editor .small,
html[data-theme="dark"] #qeubo-detail-map-label {
  color: #a6c4b2 !important;
}

html[data-theme="dark"] .qeubo-map-actions .btn.outline.sm,
html[data-theme="dark"] .qeubo-map-actions button,
html[data-theme="dark"] #qeubo-detail-map-link a {
  background: #1f3328;
  border-color: #62b38b;
  color: #a4f2cb;
}
html[data-theme="dark"] .qeubo-map-actions .btn.outline.sm:hover,
html[data-theme="dark"] .qeubo-map-actions button:hover,
html[data-theme="dark"] #qeubo-detail-map-link a:hover {
  background: #7dd3a7;
  color: #101c16;
  border-color: #7dd3a7;
}

html[data-theme="dark"] #qeubo-coordinates {
  background: #1f3328;
  border-color: #436953;
  color: #a4f2cb;
}
html[data-theme="dark"] #qeubo-map,
html[data-theme="dark"] #detail-leaflet-map {
  border-color: #40634f !important;
}

html[data-theme="dark"] .listing .listing-footer .view-ad {
  background: #1f3328;
  border-color: #5da982;
  color: #9eecc4;
}
html[data-theme="dark"] .listing .listing-footer .view-ad:hover {
  background: #7dd3a7;
  color: #101c16;
}

html[data-theme="dark"] .small,
html[data-theme="dark"] .muted {
  color: #a6c4b2;
}
html[data-theme="dark"] .eyebrow {
  color: #7dd3a7;
}


/* --- 6. MIS ANUNCIOS: GESTIÓN AVANZADA PORTADA DESDE BETA-3 --- */
.qeubo-mine-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.qeubo-mine-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.qeubo-mine-tab {
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 7px 13px !important;
  white-space: nowrap;
}
.qeubo-mine-count {
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17,34,30,.08);
  font-size: 11px;
  font-weight: 900;
}
.qeubo-mine-tab.coral .qeubo-mine-count {
  background: rgba(255,255,255,.24);
}
.qeubo-mine-view-toggle {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  background: #f3f0e7;
  border: 1px solid #ddd5c8;
  border-radius: 12px;
  padding: 4px;
}
.qeubo-mine-status {
  min-width: 142px;
  background: #fff !important;
  color: #17382f !important;
  border: 1px solid #b9c8c0 !important;
  font-weight: 750 !important;
}
.qeubo-mine-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill,minmax(245px,1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.qeubo-mine-card-grid .listing {
  min-width: 0;
}
.qeubo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 850;
  line-height: 1;
}
.qeubo-status-published { background:#e6f4ea; color:#137333; }
.qeubo-status-paused { background:#fff3d6; color:#915f00; }
.qeubo-status-reserved { background:#e8f0fe; color:#1a5bb8; }
.qeubo-status-sold { background:#fce8e6; color:#b42318; }
.qeubo-status-rented { background:#e0f2f1; color:#00695c; }
.qeubo-status-draft { background:#eceff1; color:#4f5b62; }

.footer {
  padding-top: 24px !important;
  padding-bottom: 24px !important;
}
.footer .foot-flex {
  gap: 14px;
  align-items: center;
}

html[data-theme="dark"] .qeubo-mine-view-toggle {
  background:#17261f;
  border-color:#355244;
}
html[data-theme="dark"] .qeubo-mine-count {
  background:rgba(255,255,255,.10);
}
html[data-theme="dark"] .qeubo-mine-status {
  background:#182820 !important;
  color:#e7f4ec !important;
  border-color:#436653 !important;
}
@media (max-width:700px) {
  .qeubo-mine-toolbar { gap: 10px; }
  .qeubo-mine-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .qeubo-mine-tabs::-webkit-scrollbar { display: none; }
  .qeubo-mine-view-toggle { width: 100%; }
  .qeubo-mine-view-toggle .btn { flex: 1; justify-content: center; }
  .qeubo-mine-card-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .footer { padding-bottom: 92px !important; }
}
@media (max-width:480px) {
  .qeubo-mine-card-grid { grid-template-columns: 1fr; }
}


/* --- 7. TARJETA CLICABLE ESTABLE --- */
/* La foto completa sigue siendo clicable, pero las capas visuales no se roban el toque. */
.listing-cover > button[data-detail] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
  scroll-margin-top: 110px;
}
.listing-cover > button[data-detail] > * {
  pointer-events: none;
}
.listing-cover .cover-label {
  z-index: 2;
  pointer-events: none;
}
.listing-cover .fav {
  z-index: 3;
}


/* --- 7. TARJETAS: CAPAS DE INTERACCIÓN --- */
/* La foto y las etiquetas son decorativas; los controles mantienen la zona clicable. */
.listing-cover > button[data-detail] {
  z-index: 1;
}
.listing-cover > button[data-detail] > *,
.listing-cover > button[data-detail] img,
.cover-label {
  pointer-events: none;
}
.listing-body {
  position: relative;
  z-index: 1;
}
.listing-title,
.listing-footer .view-ad {
  position: relative;
  z-index: 4;
  pointer-events: auto;
}


/* --- 8. NAVEGACIÓN MÓVIL SIEMPRE POR ENCIMA DEL CATÁLOGO --- */
@media (max-width: 750px) {
  #app,
  #inicio,
  #inicio .market-featured,
  #inicio .market-featured .featured-track {
    position: relative;
    z-index: 0;
  }
  .bottom-nav {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    display: grid !important;
    z-index: 10000 !important;
    isolation: isolate;
    pointer-events: auto !important;
    transform: translateZ(0);
  }
  .bottom-nav button {
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
  }
}


/* --- 9. CABECERA RESPONSIVE SIN DESBORDAMIENTO --- */
/* Los accesos completos de escritorio no deben forzar un viewport móvil de 640px. */
@media (max-width:750px) {
  .topbar { min-width:0; gap:8px; }
  .head-actions { min-width:0; flex:0 1 auto; gap:7px; margin-left:auto; }
  .head-actions > #account-shortcut,
  .head-actions > .header-action {
    display:none !important;
  }
  .bottom-nav { width:100% !important; max-width:100vw !important; }
}
