:root {
  --azul: #2d6cdf;
  --azul-oscuro: #1d4ed8;
  --gris-borde: #e2e5ea;
  --gris-fondo: #f6f7f9;
  --texto: #222;
  --verde: #1a8f4c;
  --rojo: #c0392b;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  background: var(--gris-fondo);
  color: var(--texto);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--gris-borde);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--azul-oscuro);
  text-decoration: none;
  white-space: nowrap;
}

.search-form {
  flex: 1;
  display: flex;
  min-width: 200px;
}

.search-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gris-borde);
  border-radius: 4px 0 0 4px;
  font-size: 0.95rem;
}

.search-form button {
  padding: 8px 16px;
  border: none;
  background: var(--azul);
  color: #fff;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.nav-links a {
  color: var(--azul-oscuro);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a.btn-link {
  background: var(--azul);
  color: #fff;
  padding: 8px 14px;
  border-radius: 4px;
}

.nav-user {
  color: #666;
  font-size: 0.9rem;
}

main.container {
  padding-top: 24px;
  padding-bottom: 48px;
  min-height: 60vh;
}

.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
}
.flash.success { background: #e6f7ec; color: var(--verde); border: 1px solid #b7e6c9; }
.flash.error { background: #fdecea; color: var(--rojo); border: 1px solid #f5c6c0; }

.categories-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.categories-bar a {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 20px;
  text-decoration: none;
  color: var(--texto);
  font-size: 0.9rem;
}
.categories-bar a.active {
  background: var(--azul);
  color: #fff;
  border-color: var(--azul);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.listing-card {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--texto);
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s;
}
.listing-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }

.listing-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #eee;
}

.listing-card .info { padding: 12px; }
.listing-card .price { font-weight: 700; color: var(--azul-oscuro); font-size: 1.1rem; }
.listing-card .title { margin: 4px 0; font-size: 0.95rem; }

.empty-state {
  text-align: center;
  color: #777;
  padding: 60px 0;
}

.form-box {
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  padding: 28px;
  max-width: 480px;
  margin: 0 auto;
}

.form-box h1 { margin-top: 0; font-size: 1.4rem; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--gris-borde);
  border-radius: 4px;
  font-size: 0.95rem;
}
.form-group textarea { resize: vertical; min-height: 100px; }
.help-text { color: #777; font-size: 0.82rem; margin-top: 4px; }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary:hover { background: var(--azul-oscuro); }

.btn-whatsapp {
  display: inline-block;
  padding: 12px 24px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  text-decoration: none;
  font-weight: bold;
}
.btn-whatsapp:hover { background: #1ebe5a; }

.steps-list { margin: 16px 0; padding-left: 20px; }
.steps-list li { margin-bottom: 8px; }

.confirm-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.confirm-table td { padding: 8px 4px; border-bottom: 1px solid #eee; }
.confirm-table td:first-child { color: #777; width: 40%; }

.confirm-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-secondary {
  width: 100%;
  padding: 12px;
  background: #fff;
  color: var(--azul, #2d6cdf);
  border: 1px solid var(--azul, #2d6cdf);
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.btn-secondary:hover { background: #f0f5ff; }
.btn-cancel {
  width: 100%;
  padding: 12px;
  background: none;
  color: var(--rojo, #c0392b);
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.password-wrapper { position: relative; }
.password-wrapper input { width: 100%; padding-right: 42px; box-sizing: border-box; }
.toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-password:hover { color: #333; }

.password-strength { margin-top: 6px; }
.password-strength-bar {
  height: 6px;
  border-radius: 3px;
  background: #eee;
  overflow: hidden;
}
.password-strength-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.2s ease, background 0.2s ease;
  background: #eee;
}
.password-strength-text { font-size: 0.78rem; margin-top: 4px; min-height: 1em; }

.form-footer-link { text-align: center; margin-top: 16px; font-size: 0.9rem; }

.dev-code-box {
  background: #fff8e1;
  border: 1px solid #f4d477;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.listing-detail {
  display: flex;
  gap: 28px;
  background: #fff;
  border: 1px solid var(--gris-borde);
  border-radius: 8px;
  padding: 24px;
  flex-wrap: wrap;
}
.listing-detail img {
  width: 340px;
  max-width: 100%;
  border-radius: 6px;
  object-fit: cover;
  background: #eee;
}
.listing-detail .info { flex: 1; min-width: 240px; }
.listing-detail .price { font-size: 1.6rem; font-weight: 700; color: var(--azul-oscuro); margin: 6px 0 18px; }

table.my-listings {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
table.my-listings th, table.my-listings td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gris-borde);
  text-align: left;
  font-size: 0.9rem;
}
