:root {
  --bg: #f6d5de;
  --bg-card: #ffffff;
  --border: #f3d3dc;
  --text: #4a3f3a;
  --text-dim: #6b5a4f;
  --accent: #d98b8b;
  --accent-dark: #c66f6f;
  --sage: #9caf88;
  --shadow: 0 4px 20px rgba(74, 63, 58, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
}

h1, h2, h3 { font-weight: 700; margin: 0 0 0.5em; }

a { color: var(--accent-dark); }

/* --- Hamburger nav (shared across all pages) --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  padding: 16px 20px;
  background: var(--bg);
}

.hamburger-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow);
}
.hamburger-btn:active { opacity: 0.8; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 63, 58, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}
.nav-backdrop.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  max-width: 80vw;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 21;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer h2 { font-size: 1.2rem; margin-bottom: 20px; color: var(--accent-dark); }
.nav-drawer nav { display: flex; flex-direction: column; gap: 4px; }
.nav-drawer nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.nav-drawer nav a:hover, .nav-drawer nav a.active { background: var(--bg); color: var(--accent-dark); }

header.site-header {
  text-align: center;
  padding: 16px 20px 32px;
  position: sticky;
  top: 74px;
  z-index: 14;
  background: var(--bg);
}

header.site-header h1 {
  font-size: 2.4rem;
  letter-spacing: 0.02em;
}

header.site-header .tagline {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-top: 4px;
}

.about-section {
  max-width: 680px;
  margin: 0 auto 48px;
  padding: 0 24px;
  text-align: center;
  color: var(--text-dim);
  white-space: pre-line;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}

.item-card {
  background: var(--bg-card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}

.item-card.out-of-stock .item-image-wrap img { filter: grayscale(0.6) brightness(0.85); }

.item-image-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--border);
}

.item-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.item-nav.prev { left: 8px; }
.item-nav.next { right: 8px; }

.stock-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
}

.item-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.item-name { font-size: 1.15rem; font-weight: 700; }
.item-price { color: var(--accent-dark); font-weight: 700; font-size: 1.05rem; }
.item-description { color: var(--text-dim); font-size: 0.92rem; flex: 1; }

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.btn:active { opacity: 0.8; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-facebook { background: #1877f2; color: #fff; }
.btn[disabled] { background: var(--border); color: var(--text-dim); cursor: default; }

.contact-section {
  margin-top: 64px;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.contact-section h2 { margin-bottom: 12px; }
.contact-section .btn-facebook { margin-bottom: 24px; }

form.contact-form { text-align: left; display: flex; flex-direction: column; gap: 14px; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select,
.input-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}
.field textarea { min-height: 110px; resize: vertical; }
.order-table .input-select { padding: 8px 10px; font-size: 0.88rem; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field-check { display: flex; align-items: center; gap: 8px; }
.field-check label { margin: 0; text-transform: none; font-weight: 600; font-size: 0.9rem; }

.form-status {
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: 10px;
  display: none;
}
.form-status.ok { display: block; background: rgba(156, 175, 136, 0.18); color: #5a7248; }
.form-status.err { display: block; background: rgba(214, 111, 111, 0.15); color: var(--accent-dark); }

.honeypot { position: absolute; left: -9999px; opacity: 0; }

footer.site-footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-dim);
  font-size: 0.8rem;
}
footer.site-footer a { color: var(--text-dim); }

/* --- Admin --- */
.admin-shell { max-width: min(1200px, 94vw); margin: 0 auto; padding: 40px 24px 80px; }
.admin-shell h1 { text-align: center; margin-bottom: 32px; }

/* Tables benefit from the full widened shell; the settings form doesn't —
   a 1000px-wide single-column form of text fields looks bad, so cap it. */
#settingsTab .admin-card { max-width: 640px; margin-left: auto; margin-right: auto; }

.admin-card {
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.admin-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 24px;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.admin-tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 9px 18px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-dim);
}
.admin-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 480px) {
  .admin-tabs { gap: 6px; }
  .admin-tabs button { padding: 8px 12px; font-size: 0.85rem; }
}

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.item-table { width: 100%; min-width: 480px; border-collapse: collapse; table-layout: fixed; }
table.item-table th, table.item-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
  overflow-wrap: break-word;
}
table.item-table img.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
table.item-table.order-table { min-width: 840px; }
.order-table th:nth-child(5),
.order-table td:nth-child(5),
.order-table th:nth-child(6),
.order-table td:nth-child(6) { white-space: nowrap; }
table.item-table .row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cancelled-row { opacity: 0.5; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.reorder-cell { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.reorder-cell button {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  width: 26px;
  height: 22px;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.reorder-cell button:disabled { opacity: 0.3; cursor: default; }
.btn-danger { background: #d9534f; color: #fff; }

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 999px; transition: 0.15s;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.15s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--sage); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

.image-preview-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.image-preview { position: relative; width: 72px; height: 72px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.image-preview .remove-x {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  background: var(--accent-dark); color: #fff; border: none; border-radius: 50%;
  font-size: 0.7rem; cursor: pointer; line-height: 1;
}

.login-form { max-width: 320px; margin: 60px auto; text-align: center; }
.login-form .field { text-align: left; margin-bottom: 14px; }
.login-form .btn { width: 100%; margin-top: 8px; }

/* --- Order tracking --- */
.order-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.order-card:last-child { margin-bottom: 0; }
.order-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.order-meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 16px; }
.order-cancelled { color: var(--accent-dark); font-weight: 700; margin: 0; }

.order-pipeline { display: flex; }
.order-step {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.order-step::before {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  background: var(--border);
  margin-bottom: 8px;
}
.order-step:first-child::before { border-radius: 999px 0 0 999px; }
.order-step:last-child::before { border-radius: 0 999px 999px 0; }
.order-step.done::before, .order-step.current::before { background: var(--accent); }
.order-step.current { color: var(--accent-dark); }

.hidden { display: none !important; }
