:root {
  --bg: #fbf9f1;
  --surface: #ffffff;
  --ink: #1e293b;
  --ink-muted: #64748b;
  --navy: #18487a;
  --navy-bright: #1d63b8;
  --red: #d9232a;
  --cat-water: #1d63b8;
  --cat-paper: #43a047;
  --cat-drink: #e53935;
  --cat-addon: #f9a825;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -10px rgba(15, 23, 42, 0.12);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}

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

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

@media (min-width: 768px) {
  .wrap {
    padding: 1.5rem 1.5rem 5rem;
  }
}

/* Header — Agent49 style */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e8e4d9;
}

.wordmark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--navy);
  text-decoration: none;
}

.wordmark .red {
  color: var(--red);
}

.tagline {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin: 0.15rem 0 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* Value banner */
.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.banner span {
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid #e8e4d9;
}

/* Grid layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 7fr 5fr;
    align-items: start;
  }
  .sidebar {
    position: sticky;
    top: 1.25rem;
  }
}

/* Section titles */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.5rem 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

.section-title .count {
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0;
  text-transform: none;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  background-clip: padding-box, border-box;
  background-origin: padding-box, border-box;
}

.card-water {
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(145deg, rgba(29, 99, 184, 0.7), rgba(29, 99, 184, 0.15));
}
.card-paper {
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(145deg, rgba(67, 160, 71, 0.7), rgba(67, 160, 71, 0.15));
}
.card-drink {
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(145deg, rgba(229, 57, 53, 0.7), rgba(229, 57, 53, 0.15));
}
.card-addon {
  background-image: linear-gradient(#fff, #fff),
    linear-gradient(145deg, rgba(249, 168, 37, 0.75), rgba(249, 168, 37, 0.15));
}

.card-top {
  display: flex;
  gap: 0.75rem;
}

.card-img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #f1f5f9;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}

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

.card-body {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.3;
  /* never truncate mid-name — allow wrap */
  white-space: normal;
  overflow: visible;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.card-price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy);
  margin-top: 0.35rem;
}

.card-break {
  font-size: 0.7rem;
  color: #94a3b8;
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.qty-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}

.qty-btn:hover {
  background: #f1f5f9;
}

.qty-val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}

/* Forms */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  border: 1px solid #e8e4d9;
  margin-bottom: 0.85rem;
}

.panel h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: var(--navy);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .field-grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(29, 99, 184, 0.35);
  border-color: var(--navy-bright);
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.choice {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  background: #fff;
  text-align: left;
  font-family: inherit;
}

.choice.active {
  border-color: var(--navy-bright);
  background: #f0f7ff;
}

.choice.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
}

.choice .t {
  font-weight: 800;
  font-size: 0.9rem;
}

.choice .s {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.choice .fee {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.35rem;
}

.stair-row,
.tip-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.tip-row {
  grid-template-columns: repeat(4, 1fr);
}

/* Sidebar summary */
.countdown {
  background: #fff8e6;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.countdown strong {
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.summary-lines {
  font-size: 0.875rem;
  color: var(--ink);
}

.summary-lines .row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.summary-lines .muted {
  color: var(--ink-muted);
}

.deal-box {
  margin: 0.75rem 0;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  color: #065f46;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.total-row .amt {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  font-weight: 800;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #12365c;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid #e2e8f0;
}

.err {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.ok {
  color: #15803d;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e8e4d9;
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.6;
}

.top-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 20;
}

/* Admin */
.admin-bar {
  background: var(--navy);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.admin-bar a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

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

table.admin {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

table.admin th,
table.admin td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

table.admin th {
  background: #f8fafc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}
.badge.warn {
  background: #fef3c7;
  color: #92400e;
}

#card-container {
  min-height: 40px;
  margin: 0.5rem 0;
}
