/* Ponat - one stylesheet for the whole site. */
:root {
  --cream: #fdf6ec;
  --paper: #ffffff;
  --dough: #e8b46a;
  --dough-dark: #c98e45;
  --brown: #4a2c17;
  --brown-soft: #7a5a43;
  --pink: #e86a92;
  --pink-dark: #c94f77;
  --line: #ecdcc6;
  --ok: #2f7d4f;
  --warn: #b7791f;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(74, 44, 23, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", var(--font);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--pink-dark); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.5rem; }
.container { width: min(1100px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--brown-soft); }
.center { text-align: center; }
.hidden { display: none !important; }

/* Header */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brown); font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.brand img { width: 36px; height: 36px; }
.nav { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--brown); padding: 8px 12px; border-radius: 999px; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--cream); }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.cart-count { background: var(--pink); color: #fff; border-radius: 999px; font-size: 0.75rem; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); padding: 24px 0; margin-top: 48px; font-size: 0.9rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px;
  background: var(--pink); color: #fff; font: 600 1rem var(--font);
  cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--pink-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary { background: var(--paper); color: var(--brown); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--cream); }
.btn-small { padding: 6px 14px; font-size: 0.875rem; }
.btn-block { width: 100%; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: inherit; background: var(--paper);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(232, 106, 146, 0.35); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 16px; }
.field-error { color: var(--danger); font-size: 0.85rem; margin-top: 4px; }
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-row label { display: flex; align-items: center; gap: 8px; font-weight: 500; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--paper); cursor: pointer; }
.radio-row input { width: auto; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); overflow: hidden; }
.qty button { border: 0; background: none; width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; color: var(--brown); }
.qty button:hover { background: var(--cream); }
.qty input { width: 44px; border: 0; text-align: center; padding: 0; border-radius: 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Cards & grids */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product-card { display: flex; flex-direction: column; overflow: hidden; }
.product-card a.thumb { background: linear-gradient(180deg, #fff6e6, #fbe9cf); padding: 18px; display: block; }
.product-card img { aspect-ratio: 1; width: 100%; height: auto; object-fit: cover; border-radius: 14px; transition: transform 0.25s; }
.product-card a.thumb:hover img { transform: rotate(-8deg) scale(1.03); }
.product-card .body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { font-size: 1.1rem; margin: 0; }
.product-card h3 a { color: inherit; text-decoration: none; }
.product-card p { margin: 0; font-size: 0.9rem; color: var(--brown-soft); flex: 1; }
.product-card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 700; font-size: 1.05rem; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dough-dark); }

/* Sections */
.section { padding: 40px 0; }
.page-head { padding: 32px 0 8px; }
.hero { padding: 56px 0 32px; }
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero p { font-size: 1.15rem; color: var(--brown-soft); max-width: 34ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.hero-art { position: relative; }
.hero-art img { width: 100%; max-width: 380px; margin-inline: auto; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-6deg); } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.features .card { padding: 20px; }
.features h3 { font-size: 1.1rem; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.tabs a { text-decoration: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--brown); font-weight: 600; }
.tabs a[aria-current="true"] { background: var(--brown); color: #fff; border-color: var(--brown); }

/* Product page */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 32px 0; }
.product-detail .art { background: linear-gradient(180deg, #fff6e6, #fbe9cf); border-radius: 24px; padding: 32px; }
.product-detail .art img { aspect-ratio: 1; width: 100%; height: auto; object-fit: cover; border-radius: 16px; }
.product-detail .buy { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.product-detail .price { font-size: 1.6rem; }

/* Cart & checkout */
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 72px; height: 72px; object-fit: cover; background: #fff6e6; border-radius: 12px; padding: 6px; }
.cart-line .name { font-weight: 700; color: inherit; text-decoration: none; }
.link-button { background: none; border: 0; color: var(--danger); cursor: pointer; padding: 0; font: inherit; font-size: 0.85rem; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.15rem; }
.empty { text-align: center; padding: 48px 16px; }
.empty img { width: 120px; margin: 0 auto 16px; opacity: 0.9; }

/* Order status */
.timeline { display: flex; gap: 0; margin: 24px 0; list-style: none; padding: 0; }
.timeline li { flex: 1; text-align: center; position: relative; font-size: 0.85rem; color: var(--brown-soft); padding-top: 34px; }
.timeline li::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--line); z-index: 1; }
.timeline li::after { content: ""; position: absolute; top: 14px; left: -50%; width: 100%; height: 4px; background: var(--line); }
.timeline li:first-child::after { display: none; }
.timeline li.done { color: var(--brown); font-weight: 700; }
.timeline li.done::before, .timeline li.done::after { background: var(--dough-dark); }
.timeline li.current::before { background: var(--pink); box-shadow: 0 0 0 6px rgba(232, 106, 146, 0.2); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; text-transform: capitalize; background: var(--cream); border: 1px solid var(--line); }
.badge.pending { background: #fff4d6; border-color: #f2d48a; color: #7a5300; }
.badge.preparing { background: #e3effd; border-color: #a9c8f0; color: #1d4f8a; }
.badge.ready { background: #fde3ec; border-color: #f2a8c0; color: #8a1d45; }
.badge.completed { background: #e2f4ea; border-color: #9fd3b4; color: var(--ok); }
.badge.cancelled { background: #f4e2e2; border-color: #e0a9a9; color: var(--danger); }

/* Notices */
.notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.notice.error { background: #fdecea; border-color: #f5c2bd; color: #8a1f14; }
.notice.success { background: #e2f4ea; border-color: #9fd3b4; color: #1f5a37; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--brown); color: #fff; padding: 12px 20px; border-radius: 999px;
  box-shadow: var(--shadow); opacity: 0; transition: opacity 0.2s, transform 0.2s; z-index: 50; pointer-events: none;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Admin */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brown-soft); }
td select { width: auto; padding: 6px 8px; }
td ul { margin: 0; padding-left: 18px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.switch input { width: 18px; height: 18px; }
.login-box { max-width: 380px; margin: 64px auto; }

@media (max-width: 820px) {
  .hero .container, .product-detail, .two-col { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 240px; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header .container { flex-wrap: wrap; padding: 8px 0; }
  .nav { margin-left: 0; width: 100%; justify-content: space-between; gap: 2px; }
  .nav a { padding: 6px 6px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card .body { padding: 12px; }
  .product-card p { display: none; }
  .cart-line { grid-template-columns: 56px 1fr; }
  .cart-line img { width: 56px; height: 56px; }
  .cart-line .qty, .cart-line .line-total { grid-column: 2; justify-self: start; }
  .timeline li { font-size: 0.72rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-40 { margin-top: 40px; }
.field.grow { flex: 1; margin: 0; min-width: 200px; }
#lookup { align-items: flex-end; }
.admin-bar select { width: auto; }
.served-by { width: 100%; font-size: 0.8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Admin: product photos */
.photo-cell { display: flex; align-items: center; gap: 10px; }
.photo-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; background: #fff6e6; }
.photo-cell label { cursor: pointer; }
.photo-cell label:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Account: order history */
.order-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.order-row:last-child { border-bottom: 0; }
.order-row:hover { background: var(--cream); }
.order-row .code { font-weight: 800; letter-spacing: 0.04em; }
.order-row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
