.filtro-input {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 9px 14px;
  font-size: .85rem; font-weight: 600; font-family: inherit; color: #374151;
  width: 100%; background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.filtro-input:focus { outline: none; border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

/* ===== Buscador profesional (barra lateral vertical) ===== */
.buscador-layout {
  display: flex; flex-direction: column; gap: 24px; align-items: flex-start;
}
@media (min-width: 900px) {
  .buscador-layout { flex-direction: row; }
}

.buscador-panel {
  background: #fff; border-radius: 18px; box-shadow: 0 20px 40px rgba(15,23,42,.1);
  border: 1px solid #f1f5f9; padding: 22px 22px 24px;
  width: 100%;
}
@media (min-width: 900px) {
  .buscador-panel { width: 290px; flex-shrink: 0; position: sticky; top: 90px; }
}

.buscador-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.buscador-titulo { display: flex; align-items: center; gap: 12px; }
.buscador-icono {
  width: 40px; height: 40px; border-radius: 10px; background: #fee2e2; color: #dc2626;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.buscador-titulo-txt { font-weight: 800; font-size: 1rem; color: #0f172a; }
.buscador-contador { font-size: .78rem; color: #6b7280; font-weight: 600; margin-top: 2px; }

.buscador-limpiar {
  width: 100%; margin-top: 18px;
  border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280;
  font-size: .78rem; font-weight: 700; padding: 10px 14px; border-radius: 8px;
  cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.buscador-limpiar:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

.buscador-grid {
  display: flex; flex-direction: column; gap: 14px;
}

.buscador-campo { display: flex; flex-direction: column; gap: 6px; }
.buscador-label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; }

.buscador-input-icono { position: relative; display: flex; align-items: center; }
.buscador-input-icono svg { position: absolute; left: 13px; color: #9ca3af; pointer-events: none; }
.buscador-input-icono input { padding-left: 36px; }

/* ===== Rango de precio: slider doble ===== */
.buscador-campo-precio { gap: 10px; }

.precio-rango-valores {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; font-weight: 800; color: #dc2626;
  font-variant-numeric: tabular-nums;
}

.precio-rango-slider { position: relative; height: 20px; display: flex; align-items: center; }

.precio-rango-track {
  position: absolute; left: 0; right: 0; height: 4px; border-radius: 999px; background: #e5e7eb;
}
.precio-rango-fill {
  position: absolute; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.precio-rango-input {
  position: absolute; left: 0; right: 0; width: 100%; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent;
  pointer-events: none; height: 20px;
}
.precio-rango-input::-webkit-slider-runnable-track { -webkit-appearance: none; background: transparent; height: 20px; }
.precio-rango-input::-moz-range-track { background: transparent; height: 20px; border: none; }

.precio-rango-input::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: #dc2626; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,.4); cursor: pointer; margin-top: 0;
  transition: transform .15s ease;
}
.precio-rango-input::-webkit-slider-thumb:hover,
.precio-rango-input::-webkit-slider-thumb:active { transform: scale(1.15); }

.precio-rango-input::-moz-range-thumb {
  pointer-events: auto; width: 18px; height: 18px; border-radius: 50%;
  background: #dc2626; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(220,38,38,.4); cursor: pointer;
}

.buscador-resultados { flex: 1; min-width: 0; width: 100%; }

.venta-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.venta-card:hover { transform: translateY(-6px); box-shadow: 0 20px 36px rgba(15,23,42,.12); border-color: rgba(220,38,38,.25); }

.venta-thumb { position: relative; height: 190px; background: linear-gradient(135deg,#f3f4f6,#e5e7eb); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.venta-thumb img { width: 100%; height: 100%; object-fit: cover; }

.venta-badge {
  position: absolute; top: 10px; left: 10px; background: #fff;
  font-size: .65rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: #dc2626;
}

.venta-destacada-badge {
  position: absolute; top: 10px; right: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
  font-size: .65rem; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(217,119,6,.4);
}

.venta-ubicacion {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; color: #6b7280; margin-top: 4px;
}

.venta-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.venta-tag { font-size: .65rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #f3f4f6; color: #4b5563; }
.venta-tag.ok { background: #dcfce7; color: #166534; }

.venta-publicada { font-size: .68rem; color: #9ca3af; font-weight: 600; margin-top: 10px; }

.venta-card { cursor: pointer; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(11,15,25,.75);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: modalFade .25s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: #fff; border-radius: 18px; max-width: 920px; width: 100%;
  max-height: 90vh; overflow-y: auto; position: relative;
  display: grid; grid-template-columns: 1fr; gap: 0;
  animation: modalPop .3s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 800px) { .modal-box { grid-template-columns: 1.1fr 1fr; } }
@keyframes modalPop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-cerrar {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(17,24,39,.75);
  color: #fff; font-size: .9rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.modal-cerrar:hover { background: #dc2626; transform: rotate(90deg); }

.modal-galeria { background: #f3f4f6; }
.modal-foto-principal {
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative; cursor: zoom-in;
}
.modal-foto-principal img { width: 100%; height: 100%; object-fit: cover; }
.modal-foto-principal::after {
  content: '🔍 Ver tamaño completo';
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.65); color: #fff; font-size: .68rem; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; opacity: 0; transition: opacity .2s ease;
  pointer-events: none;
}
.modal-foto-principal:hover::after { opacity: 1; }

/* ===== Lightbox: foto en tamaño completo ===== */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(3,7,18,.94);
  display: flex; align-items: center; justify-content: center; padding: 30px;
  animation: modalFade .2s ease;
}
.lightbox-overlay.hidden { display: none; }
.lightbox-overlay img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox-cerrar {
  position: absolute; top: 18px; right: 18px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255,255,255,.15);
  color: #fff; font-size: 1.05rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease;
}
.lightbox-cerrar:hover { background: rgba(255,255,255,.3); transform: rotate(90deg); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255,255,255,.12);
  color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-nav.hidden { display: none; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
@media (max-width: 640px) {
  .lightbox-nav { width: 38px; height: 38px; font-size: 1.4rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
.modal-miniaturas { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.modal-miniaturas img {
  width: 60px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: border-color .2s ease, opacity .2s ease; opacity: .7;
}
.modal-miniaturas img:hover { opacity: 1; }
.modal-miniaturas img.activa { border-color: #dc2626; opacity: 1; }

.modal-info { padding: 26px; }
.modal-titulo { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; }
.modal-precio { color: #dc2626; font-weight: 800; font-size: 1.3rem; }
.modal-ubicacion { color: #6b7280; font-size: .85rem; margin-top: 6px; }
.modal-tags { margin-top: 14px; }

.modal-descripcion-box {
  margin-top: 14px; background: #f9fafb; border: 1px solid #f1f5f9; border-radius: 10px;
  padding: 12px 14px;
}
.modal-descripcion-box.hidden { display: none; }
.modal-descripcion-titulo {
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #9ca3af; margin-bottom: 4px;
}
.modal-descripcion-texto { font-size: .8rem; color: #374151; line-height: 1.5; }

.modal-specs { margin-top: 20px; border-top: 1px solid #f3f4f6; padding-top: 16px; }
.modal-vendedor { margin-top: 14px; font-size: .85rem; font-weight: 600; color: #374151; }
.modal-spec-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .85rem; border-bottom: 1px solid #f9fafb; }
.modal-spec-row span:first-child { color: #6b7280; }
.modal-spec-row span:last-child { font-weight: 700; }
