:root {
  --green: #25d366;
  --green-dark: #1ba955;
  --ink: #1c1f22;
  --muted: #6b7280;
  --bg: #f7f7f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --danger: #d64545;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

a { color: inherit; }

.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.header .admin-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

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

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

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eee;
  display: block;
}

.card .photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.card .body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card .title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.card .price {
  font-weight: 700;
  color: var(--green-dark);
  font-size: 1.05rem;
}

.card .description {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-line;
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-whatsapp {
  background: var(--green);
  color: #fff;
}
.btn-whatsapp:hover { background: var(--green-dark); }

.btn-secondary {
  background: #eef0f2;
  color: var(--ink);
}

.btn-danger {
  background: #fdecec;
  color: var(--danger);
}

.btn-block { width: 100%; }

.fab-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--green);
  color: #fff;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  text-decoration: none;
  font-size: 1.6rem;
  z-index: 20;
}

/* --- Admin --- */
.admin-topbar {
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar a { color: #fff; text-decoration: none; font-size: 0.9rem; }
.admin-topbar form { margin: 0; }
.admin-topbar button {
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.flash {
  background: #e8f7ee;
  color: #1c7a3c;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.admin-list { display: flex; flex-direction: column; gap: 12px; }

.admin-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.admin-row .thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info .title { font-weight: 600; }
.admin-row .info .meta { color: var(--muted); font-size: 0.85rem; }

.badge-sold {
  display: inline-block;
  background: #fde8e8;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}

.actions { display: flex; gap: 8px; flex-shrink: 0; }

.top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- Formularios --- */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  margin: 0 auto;
}

.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }

input[type="text"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}

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

.price-row { display: flex; gap: 10px; }
.price-row input { flex: 2; }
.price-row select { flex: 1; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; }

.current-image {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.current-image img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.error-box {
  background: #fdecec;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.muted-link { color: var(--muted); font-size: 0.85rem; text-align: center; display: block; margin-top: 10px; }
