:root {
  --brand: #c2410c;       /* warm FMCG accent */
  --brand-dark: #9a3412;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main.container {
  flex: 1;
  padding-top: 1.5rem;
}

.brand, .brand:hover { color: var(--brand); text-decoration: none; }

.lang-toggle {
  font-weight: 600;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

/* ---- Product grid (responsive) ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  /* All rows share the same height (= the tallest row), so a card alone
     in a row stretches to match rows with 2-3 cards, keeping buttons and
     prices aligned across the grid. */
  grid-auto-rows: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.product-card .hero {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.product-card h3 {
  margin: 0.75rem 0.75rem 0;
  font-size: 1.05rem;
  /* Force all titles to occupy the same vertical space (max 1 line) so the
     price and buy button align across cards. */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 1.4em;
}
.product-card .desc {
  margin: 0.25rem 0.75rem 0.5rem;
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  /* Force all descriptions to occupy exactly 2 lines so the price block
     sits at a consistent Y across all cards. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.product-card .price { margin: 0 0.75rem 0.75rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; }
.product-card .price .was { font-size: 0.8rem; color: var(--pico-muted-color); text-decoration: line-through; font-weight: 400; }
.product-card .price .now { font-size: 1.1rem; color: var(--brand); }
.product-card .buy-btn { margin: auto 0.75rem 0.75rem; text-align: center; }

.muted { color: var(--pico-muted-color); }

/* ---- Product detail ---- */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
@media (min-width: 768px) {
  .product-detail { grid-template-columns: 320px 1fr; align-items: start; }
}
.hero-detail { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--pico-border-radius); }
.product-detail .price { font-size: 1.4rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.product-detail .price .was { font-size: 1rem; color: var(--pico-muted-color); text-decoration: line-through; font-weight: 400; }
.product-detail .price .now { font-size: 1.5rem; color: var(--brand); }
.product-detail .buy-btn { width: 100%; max-width: 280px; display: inline-block; text-align: center; }
.back-link { display: inline-block; margin-bottom: 0.5rem; }

/* ---- Auth cards ---- */
.auth-card {
  max-width: 420px;
  margin: 2rem auto;
  padding: 1.5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}
.auth-card .errors { color: #b91c1c; }
.auth-card .ok { color: #15803d; }
.auth-card .switch { text-align: center; margin-top: 1rem; }

/* ---- Admin tables (compact) ---- */
.admin-table {
  font-size: 0.85rem;
  table-layout: fixed;
  width: 100%;
}
.admin-table th,
.admin-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-table th { font-size: 0.8rem; font-weight: 600; }
/* Tight, fixed-width columns that should never wrap or stretch. */
.admin-table td.col-order,
.admin-table th.col-order { width: 11rem; white-space: nowrap; }
.admin-table td.col-qty,
.admin-table th.col-qty { width: 2.5rem; text-align: right; }
.admin-table td.col-total,
.admin-table th.col-total { width: 4.5rem; text-align: right; white-space: nowrap; }
.admin-table td.col-status,
.admin-table th.col-status { width: 4.5rem; white-space: nowrap; }
.admin-table td.col-placed,
.admin-table th.col-placed { width: 7rem; white-space: nowrap; }
.admin-table td.col-action,
.admin-table th.col-action { width: 4.5rem; text-align: center; white-space: nowrap; }
/* Email / product cells truncate so the table fits without horizontal scroll. */
.admin-table td.col-email,
.admin-table td.col-product {
  white-space: nowrap;
}

/* ---- Notices ---- */
.errors { color: #b91c1c; }
.ok { color: #15803d; }
