:root {
  --brand: #1b2a5b;        /* azul marino Tractopartes Ayala */
  --brand-dark: #12204a;
  --accent: #e2231a;       /* rojo del logo */
  --wa: #25d366;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c1f23;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

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

.site-header__bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__logo { height: 44px; width: auto; max-width: 260px; object-fit: contain; }
/* El logo ya incluye el nombre del negocio; el texto queda solo para lectores de pantalla */
.brand__name {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.search { flex: 1; min-width: 200px; }
.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 1rem;
  outline: none;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 122, 77, .15); }

/* Category bar */
.category-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: .9rem;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
}
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Status */
.status-line { color: var(--muted); font-size: .88rem; margin: 4px 2px 16px; }
.empty-state { text-align: center; color: var(--muted); padding: 48px 0; }

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.card__imgwrap {
  aspect-ratio: 1 / 1;
  background: #eef0f2;
  overflow: hidden;
}
.card__img { width: 100%; height: 100%; object-fit: cover; }

.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card__cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card__name { font-size: .98rem; font-weight: 600; margin: 0; }
.card__price { font-size: 1.05rem; font-weight: 700; color: var(--brand-dark); margin-top: auto; }
.card__badge {
  position: absolute;
  margin: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.card__imgwrap { position: relative; }

.card--out { opacity: .55; }
.card__out-label { font-size: .78rem; color: #b91c1c; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-block;
  text-align: center;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn--wa { background: var(--wa); color: #05340f; }
.btn--wa:hover { filter: brightness(.96); }
.btn--ghost { background: #fff; border-color: var(--border); color: var(--text); width: 100%; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.modal__panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: rgba(255, 255, 255, .9);
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
}
.modal__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef0f2; }
.modal__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.modal__category { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0; }
.modal__name { margin: 0; font-size: 1.35rem; }
.modal__price { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); }
.modal__sku { margin: 0; font-size: .8rem; color: var(--muted); }
.modal__desc { margin: 6px 0 10px; white-space: pre-line; }

.site-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 24px 16px 40px; }

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .brand__name { font-size: 1rem; }
}
