@import url('https://fonts.googleapis.com/css2?family=Anton&family=Space+Mono:wght@400;700&family=Karla:wght@400;500;600;700;800&display=swap');

:root {
  --maroon: #7B1E2B;
  --maroon-dark: #4E1119;
  --mustard: #E8B923;
  --mustard-light: #F4D466;
  --cream: #FBF3E3;
  --charcoal: #241512;
  --white: #FFFFFF;
  --paper: #FFFDF8;
  --line: rgba(36, 21, 18, 0.14);
  --shadow: 0 6px 18px rgba(36, 21, 18, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: 'Karla', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

a { color: inherit; }

button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- TOP BAR ---------- */
.topbar {
  background: var(--maroon-dark);
  color: var(--mustard-light);
  font-size: 0.82rem;
  padding: 7px 0;
}
.topbar .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar strong { color: var(--white); }

/* ---------- HERO / BANNER ---------- */
.hero {
  background: var(--mustard);
  border-bottom: 6px solid var(--maroon);
}
.banner-full {
  width: 100%;
  height: auto;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--mustard);
  color: var(--maroon-dark);
  box-shadow: 0 6px 0 #b5891a;
}
.btn-primary:hover { box-shadow: 0 8px 0 #b5891a; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 3px 0 #b5891a; }
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

/* ---------- CATEGORY NAV ---------- */
.catnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.catnav .wrap {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
}
.cat-chip {
  background: transparent;
  border: 2px solid var(--maroon);
  color: var(--maroon);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cat-chip.active, .cat-chip:hover {
  background: var(--maroon);
  color: var(--white);
}

/* ---------- PRODUCTS ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 46px 0 20px;
}
.section-title h2 { font-size: 1.7rem; color: var(--maroon); }
.section-title .rule { flex: 1; height: 3px; background: repeating-linear-gradient(90deg, var(--mustard) 0 10px, transparent 10px 18px); }

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

/* Signature element: product = hanging price tag */
.tag {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 16px 16px;
  position: relative;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease;
}
.tag:hover { transform: translateY(-3px); }
.tag::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 20px;
  width: 14px;
  height: 14px;
  background: var(--cream);
  border: 2px solid var(--maroon);
  border-radius: 50%;
}
.tag-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
}
.tag-name {
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--charcoal);
}
.tag-unit {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: #7a685f;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tag-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.tag-price {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--mustard);
  color: var(--maroon-dark);
  padding: 4px 10px;
  border-radius: 4px;
  transform: rotate(-2deg);
  display: inline-block;
}
.tag-add {
  background: var(--maroon);
  color: var(--white);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 var(--maroon-dark);
}
.tag-add:hover { background: var(--maroon-dark); }
.tag-add:active { transform: translateY(2px); box-shadow: none; }

.empty-note {
  font-family: 'Space Mono', monospace;
  color: #8a7a70;
  padding: 30px 0;
}

/* ---------- INFO STRIP ---------- */
.info-strip {
  background: var(--maroon-dark);
  color: var(--mustard-light);
  margin-top: 60px;
  padding: 34px 0;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
}
.info-grid h3 {
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 8px;
}
.info-grid p { margin: 2px 0; font-size: 0.92rem; color: rgba(255,255,255,0.82); }

footer {
  text-align: center;
  padding: 18px 0 26px;
  font-size: 0.78rem;
  color: #9a8a80;
  background: var(--maroon-dark);
}

/* ---------- FLOATING CART BUTTON ---------- */
.cart-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 40;
  background: var(--mustard);
  color: var(--maroon-dark);
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.cart-fab .count {
  background: var(--maroon-dark);
  color: var(--mustard);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
}

/* ---------- CART DRAWER ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(36,21,18,0.5);
  z-index: 50;
  display: none;
}
.overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--paper);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  background: var(--maroon);
  color: var(--white);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-head h3 { font-size: 1.2rem; }
.drawer-close {
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item .ci-name { flex: 1; font-weight: 700; font-size: 0.92rem; }
.cart-item .ci-unit { font-size: 0.72rem; color: #8a7a70; font-family: 'Space Mono', monospace; }
.qty-ctl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-ctl button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--maroon);
  background: var(--white);
  color: var(--maroon);
  font-weight: 800;
}
.qty-ctl span { min-width: 18px; text-align: center; font-family: 'Space Mono', monospace; }
.ci-price { font-family: 'Space Mono', monospace; font-weight: 700; min-width: 76px; text-align: right; }
.ci-remove { background: none; border: none; color: #b23; font-size: 1.1rem; }

.drawer-foot {
  border-top: 2px solid var(--line);
  padding: 16px 20px 20px;
  background: var(--cream);
}
.field-row { margin-bottom: 10px; }
.field-row label { display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; color: var(--maroon-dark); }
.field-row input, .field-row select, .field-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--white);
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 12px 0;
  color: var(--maroon-dark);
}
.whatsapp-btn {
  width: 100%;
  background: #25D366;
  color: #052e16;
  padding: 14px;
  border-radius: 8px;
  border: none;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 5px 0 #1aa653;
}
.whatsapp-btn:active { transform: translateY(3px); box-shadow: none; }
.whatsapp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ================= ADMIN ================= */
.admin-body { background: var(--cream); min-height: 100vh; }
.admin-header {
  background: var(--maroon);
  color: var(--white);
  padding: 16px 0;
  display: flex;
  align-items: center;
}
.admin-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.admin-header img { height: 42px; }
.admin-header .title { font-family: 'Anton', sans-serif; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.2rem; }
.logout-btn {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: var(--white);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--maroon);
  padding: 20px;
}
.login-card {
  background: var(--paper);
  border-radius: 10px;
  padding: 34px 30px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  text-align: center;
}
.login-card img { width: 90px; margin-bottom: 10px; }
.login-card h2 { color: var(--maroon); font-size: 1.3rem; margin-bottom: 18px; }
.login-card .field-row { text-align: left; }
.login-error { color: #b23; font-size: 0.85rem; margin-top: 10px; min-height: 1.2em; }

.admin-main { padding: 26px 0 60px; }
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.tabs { display: flex; gap: 8px; }
.tab-btn {
  background: var(--paper);
  border: 1.5px solid var(--line);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
}
.tab-btn.active { background: var(--maroon); color: var(--white); border-color: var(--maroon); }

.status-tab-btn {
  background: var(--paper);
  border: 1.5px solid var(--line);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}
.status-tab-btn.active { background: var(--maroon); color: var(--white); border-color: var(--maroon); }

.status-pill.pendiente { background: #fdeecb; color: #93650c; }
.status-pill.enviado { background: #d7f2df; color: #1c6b3a; }
.status-pill.cancelado { background: #f2d7d7; color: #8a1c1c; }

.order-items-cell { max-width: 260px; font-size: 0.82rem; line-height: 1.4; }
.status-select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  font-size: 0.82rem;
  font-family: inherit;
}

.panel { display: none; }
.panel.active { display: block; }

.table-card {
  background: var(--paper);
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead { background: var(--mustard-light); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: 'Space Mono', monospace; }
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pill.active { background: #d7f2df; color: #1c6b3a; }
.status-pill.inactive { background: #f2d7d7; color: #8a1c1c; }
.row-actions { display: flex; gap: 6px; }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 0.8rem;
}
.icon-btn.danger { color: #b23; border-color: #e9c8c8; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(36,21,18,0.5);
  display: none; align-items: center; justify-content: center; z-index: 70; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: 10px;
  width: 100%;
  max-width: 460px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.modal h3 { color: var(--maroon); font-size: 1.15rem; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn-small {
  padding: 9px 16px; border-radius: 6px; font-weight: 700; font-size: 0.85rem; border: none;
}
.btn-small.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--charcoal); }
.btn-small.primary { background: var(--maroon); color: var(--white); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--charcoal); color: var(--white); padding: 12px 20px; border-radius: 8px;
  font-size: 0.88rem; z-index: 80; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

@media (max-width: 640px) {
  table { font-size: 0.8rem; }
  th, td { padding: 8px; }
}
