* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #6b7280;
  --border: #e6e4df;
  --accent: #0e7c5a;
  --accent-dark: #0a5f45;
  --danger: #c0392b;
  --radius: 14px;
}

html {
  font-size: 16px;
}

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.header-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  transition: 0.15s;
}

.header-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero / búsqueda */
.search-section {
  padding: 48px 0 24px;
}

.search-section h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.search-section p {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.filters select,
.filters input[type="number"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--text);
}

.filters input[type="number"] {
  width: 110px;
}

.filters .price-range {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Grid de productos */
.catalog-section {
  padding: 24px 0 64px;
}

.results-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

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

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1efe9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image.empty {
  color: var(--muted);
  font-size: 0.8rem;
}

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

.product-name {
  font-weight: 700;
  font-size: 1rem;
}

.product-business {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
}

.product-price {
  font-weight: 800;
  font-size: 1.15rem;
  margin-top: 4px;
}

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

/* Formularios (login / paneles) */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 400px;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-card .subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
}

.field label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.15s;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #f0d4d0;
}

.btn-danger:hover {
  background: #fdf1f0;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.form-error {
  background: #fdf1f0;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.form-success {
  background: #eaf6f0;
  color: var(--accent-dark);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Paneles internos */
.panel-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.panel-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
}

.panel-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.panel-title span {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  display: block;
}

.panel-body {
  padding: 32px 0 64px;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .panel-grid.with-form {
    grid-template-columns: 340px 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.active {
  background: #eaf6f0;
  color: var(--accent-dark);
}

.badge.inactive {
  background: #f3f0f0;
  color: var(--muted);
}

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

.loading {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 20px 0;
}

@media (max-width: 600px) {
  .search-bar {
    flex-direction: column;
  }
  table {
    font-size: 0.82rem;
  }
}
