/* =============================================
   Predial Unificado - Consulta pública y factura
   ============================================= */

/* Sobrescribe portal.css: no centrar verticalmente
   (cuando hay resultados el contenido excede el viewport) */
.wrapper {
  justify-content: flex-start;
  padding: 28px 0 60px;
}

header.mb-5 {
  margin-bottom: 2rem;
}

.brand {
  padding: 6px 0;
}

/* ---------- Card de búsqueda ---------- */
.search-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 36px 34px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.search-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8860b, #e6b800);
  color: #ffffff;
  font-size: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 18px rgba(184, 134, 11, 0.4);
}

.search-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

.search-desc {
  color: #666;
  margin-bottom: 24px;
}

.search-input {
  border-radius: 50px 0 0 50px !important;
  border: 2px solid #e0e0e0;
}

.search-input:focus {
  border-color: #b8860b;
  box-shadow: 0 0 0 0.2rem rgba(184, 134, 11, 0.2);
}

.search-btn {
  border-radius: 0 50px 50px 0 !important;
  background: linear-gradient(135deg, #b8860b, #e6b800);
  color: #ffffff;
  font-weight: 600;
  border: none;
  padding: 0 26px;
}

.search-btn:hover {
  background: linear-gradient(135deg, #9c740a, #cfa600);
  color: #ffffff;
}

/* ---------- Resultados ---------- */
.results-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

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

.results-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.predial-table {
  margin-bottom: 0;
}

.predial-table thead th {
  background: #f7f7f7;
  color: #555;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-top: none;
  white-space: nowrap;
}

.predial-table tbody td {
  vertical-align: middle;
  font-size: 0.88rem;
}

.ficha-badge {
  background: #f0e9d6;
  color: #8a6d0b;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.factura-valor {
  color: #b8860b;
  font-weight: 700;
  white-space: nowrap;
}

.action-btn {
  border-radius: 50px;
  font-size: 0.78rem;
  padding: 5px 12px;
  margin: 2px;
  white-space: nowrap;
}

.back-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  font-weight: 600;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* ---------- Factura imprimible ---------- */
.factura-body {
  background: #f0f2f5;
  padding: 30px 0;
}

.factura-container {
  max-width: 820px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 32px 36px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.factura-logo {
  height: 90px;
}

.factura-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f3d2e;
  margin-bottom: 2px;
}

.factura-subtitle {
  font-size: 1rem;
  color: #b8860b;
  font-weight: 600;
  margin-bottom: 6px;
}

.factura-doc {
  font-size: 0.95rem;
  margin: 0;
  color: #333;
}

.factura-anio {
  font-size: 0.95rem;
  margin: 0;
  color: #555;
}

.factura-section {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f3d2e;
  margin-bottom: 16px;
}

.info-item {
  margin-bottom: 14px;
}

.info-item small {
  display: block;
  color: #888;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info-item strong {
  font-size: 0.9rem;
  color: #222;
}

.liquidacion-table td {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.total-row td {
  background: #0f3d2e;
  color: #ffffff;
  font-size: 1rem;
}

/* ---------- Impresión ---------- */
@media print {
  .factura-body {
    background: #ffffff;
    padding: 0;
  }

  .factura-container {
    box-shadow: none;
    border-radius: 0;
    padding: 10px;
    max-width: 100%;
  }

  .factura-section {
    break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }
}

/* =============================================
   Responsive
   ============================================= */

/* Tablets / pantallas pequeñas */
@media (max-width: 767.98px) {
  .wrapper {
    padding: 20px 0 48px;
  }

  header.mb-5 {
    margin-bottom: 1.5rem;
  }
}

/* Móviles (ej. 350px de ancho) */
@media (max-width: 575.98px) {
  .brand-logo {
    height: 62px;
  }

  .brand-title {
    font-size: 1.35rem;
  }

  .brand-subtitle {
    font-size: 0.8rem;
    letter-spacing: 2px;
  }

  .search-card {
    padding: 26px 18px;
    border-radius: 14px;
  }

  .search-icon {
    width: 58px;
    height: 58px;
    font-size: 1.4rem;
  }

  .search-title {
    font-size: 1.2rem;
  }

  .search-desc {
    font-size: 0.85rem;
    margin-bottom: 20px;
  }

  /* Apilar input + botón en columna (móviles).
     Usa selectores con mayor especificidad que Bootstrap
     (.input-group > .form-control { width: 1%; flex: 1 1 auto; }) */
  .input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .input-group .search-input {
    width: 100% !important;
    flex: none;
    border-radius: 50px !important;
  }

  .input-group-append {
    width: 100%;
    margin-left: 0;
  }

  .search-btn {
    border-radius: 50px !important;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
  }

  .results-card {
    padding: 16px;
    border-radius: 14px;
  }

  .results-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .results-header h3 {
    font-size: 1rem;
  }

  .predial-table thead th {
    font-size: 0.72rem;
  }

  .predial-table tbody td {
    font-size: 0.8rem;
  }

  .action-btn {
    font-size: 0.72rem;
    padding: 4px 9px;
    margin: 2px 1px;
  }

  .back-btn {
    width: 100%;
  }

  .footer small {
    font-size: 0.78rem;
  }

  /* Factura en móvil */
  .factura-container {
    padding: 20px 16px;
    border-radius: 10px;
  }

  .factura-title {
    font-size: 1.2rem;
  }

  .factura-logo {
    height: 60px;
  }
}

/* Muy pequeños: reducir aún más el espacio vertical */
@media (max-width: 420px) {
  .wrapper {
    padding: 12px 0 32px;
  }
}