:root {
  --navy: #1e2a4a;
  --navy-deep: #131c33;
  --gold: #c9a227;
  --gold-soft: #e6c65a;
  --cream: #faf7f0;
  --green: #2d8a6b;
  --ink: #2a2f3a;
  --muted: #6b7280;
  --line: #e7e1d4;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(19, 28, 51, 0.10);
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.01em; }

a { color: var(--navy); }

/* ---------- ENCABEZADO ---------- */
header.top {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 22px 20px;
  text-align: center;
}
header.top .cross { color: var(--gold-soft); font-size: 26px; }
header.top h1 { margin: 6px 0 2px; font-size: 26px; color: #fff; }
header.top .sub { color: var(--gold-soft); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
header.top .lema { color: #d9e0ef; font-size: 14px; margin-top: 6px; font-style: italic; }

nav.menu {
  background: var(--navy-deep);
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 10px; position: sticky; top: 0; z-index: 20;
}
nav.menu a {
  color: #d9e0ef; text-decoration: none; padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
nav.menu a:hover, nav.menu a.active { background: var(--gold); color: var(--navy-deep); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 18px 60px; }

.demo-banner {
  background: #fff7e0; border: 1px solid var(--gold); color: #6b5310;
  padding: 10px 16px; border-radius: 12px; font-size: 13px; margin-bottom: 18px; text-align: center;
}

/* ---------- PRODUCTOS ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card .photo { aspect-ratio: 4/3; background: #f0ece1 center/cover no-repeat; display: block; }
.card .photo.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 40px; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-weight: 700; font-size: 17px; }
.card .desc { color: var(--muted); font-size: 13px; flex: 1; }
.card .seller { color: var(--muted); font-size: 12px; }
.card .price { color: var(--navy); font-weight: 800; font-size: 20px; font-family: Georgia, serif; }

.btn {
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
.btn.gold { background: var(--gold); color: var(--navy-deep); }
.btn.gold:hover { background: var(--gold-soft); }
.btn.navy { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

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

/* ---------- CARRITO (panel lateral) ---------- */
.cart-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: var(--gold); color: var(--navy-deep); border: none; border-radius: 999px;
  padding: 14px 20px; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: var(--shadow);
}
.cart-fab .count { background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-size: 13px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(19,28,51,.45); z-index: 50; display: none; }
.drawer-bg.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 92vw); background: #fff;
  z-index: 60; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer h2 { margin: 0; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer .items { flex: 1; overflow: auto; padding: 12px 18px; }
.cart-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; background: #f0ece1; }
.cart-row .info { flex: 1; }
.cart-row .info .n { font-weight: 600; font-size: 14px; }
.cart-row .info .p { color: var(--muted); font-size: 13px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-weight: 700; }
.drawer .foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.drawer .total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; margin-bottom: 12px; }

/* ---------- FORMULARIOS ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; max-width: 560px; margin: 0 auto; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; background: var(--cream);
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { min-height: 90px; resize: vertical; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ok-msg { background: #e7f6ef; border: 1px solid var(--green); color: #1c5e48; padding: 12px 16px; border-radius: 10px; margin-top: 14px; }
.err-msg { background: #fdeaea; border: 1px solid #d9534f; color: #a33; padding: 12px 16px; border-radius: 10px; margin-top: 14px; }

.preview-img { width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; margin-top: 10px; background: var(--cream); display: none; }

/* ---------- TABLA ADMIN ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--navy); color: #fff; font-weight: 600; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.pagada { background: #e7f6ef; color: var(--green); }
.badge.pendiente { background: #fff7e0; color: #8a6d10; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 800; color: var(--navy); font-family: Georgia, serif; }
.stat .l { color: var(--muted); font-size: 13px; }

footer.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px; }
footer.foot .cross { color: var(--gold); }
