/* Jamie's Cakes — shared styles. Phone-first: everything is laid out for a
   narrow screen, and wider screens just get more columns. */

:root {
  color-scheme: light;
  /* Purple and pink, from the Jamie's Cakes logo */
  --cream: #fcf8fc;
  --card: #ffffff;
  --ink: #3a2941;
  --ink-soft: #76657e;
  --line: #ece1ee;
  --accent: #7a45b4;
  --accent-dark: #5d3091;
  --accent-soft: #f1e8fb;
  --pink: #e0569b;
  --pink-dark: #b8327a;
  --pink-soft: #fde7f2;
  --butter: #fdf1d6;
  --mint: #e3f3ea;
  --mint-ink: #1f6b45;
  --grey: #f1ece6;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(58 41 65 / 6%), 0 4px 16px rgb(58 41 65 / 7%);
  --serif: 'Fraunces', Georgia, serif;
  --script: 'Pacifico', 'Brush Script MT', cursive;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }

/* --- Header --- */
.site-head { padding: 28px 0 18px; text-align: center; }
.site-head .brand { font: 400 2.5rem/1.3 var(--script); color: var(--accent); text-decoration: none; }
.site-head .tagline { color: var(--ink-soft); margin-top: 4px; }
.site-head.small { padding: 16px 0 8px; }
.site-head.small .brand { font-size: 1.8rem; }

.cash-note {
  background: var(--pink-soft);
  border: 1px solid #f7c6de;
  color: var(--pink-dark);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 600;
  text-align: center;
  margin: 8px 0 20px;
}

.top-nav { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.top-nav a { padding: 6px 14px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.top-nav a[aria-current] { background: var(--accent-soft); color: var(--accent-dark); }
.page-title { font-size: 2rem; text-align: center; margin-top: 8px; }
.page-intro { text-align: center; color: var(--ink-soft); max-width: 520px; margin: 6px auto 18px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  font: 600 1.05rem var(--sans); text-decoration: none;
  cursor: pointer;
}
.btn:active { background: var(--accent-dark); }
.btn:disabled { background: #d9c9c2; cursor: default; }
.btn.secondary { background: var(--accent-soft); color: var(--accent-dark); }
.btn.block { display: flex; width: 100%; }

/* Order button that stays on screen while scrolling the menu */
.sticky-cta {
  position: sticky; bottom: 0; z-index: 5;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, var(--cream) 70%, transparent);
}
.sticky-cta .btn { max-width: 480px; margin: 0 auto; box-shadow: var(--shadow); }

/* --- Menu --- */
.chips {
  position: sticky; top: 0; z-index: 4;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px; margin: 0 -16px;
  background: var(--cream);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}

.menu-section { margin: 20px 0 32px; }
.menu-section h2 { margin-bottom: 4px; }
.menu-section .lead { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }

.item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.item.unavailable { opacity: 0.6; }
.item .photo { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--accent-soft); }
.item .placeholder {
  aspect-ratio: 3 / 1; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pink-soft), var(--accent-soft));
  font-family: var(--script); font-size: 2.4rem; color: var(--accent);
}
.item .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item .desc { color: var(--ink-soft); }
.prices { list-style: none; margin: 0; padding: 0; }
.prices li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.prices li:last-child { border-bottom: 0; }
.prices .amt { font-weight: 600; white-space: nowrap; }
.flavors { font-size: 0.95rem; color: var(--ink-soft); }
.item .btn { margin-top: auto; }

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; vertical-align: middle;
  background: var(--grey); color: var(--ink-soft);
}
.tag.seasonal { background: var(--butter); color: #8a5a00; }
.tag.from { background: var(--pink-soft); color: var(--pink-dark); }

.info-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.info-card h2 { font-size: 1.35rem; margin-bottom: 10px; }
.info-card ul { margin: 0; padding-left: 20px; }
.info-card li { margin: 6px 0; }
.site-foot { text-align: center; color: var(--ink-soft); font-size: 0.9rem; padding: 24px 0 8px; }

/* --- Gallery --- */
.gallery { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 24px; }
@media (min-width: 600px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery .loading, .gallery .error { grid-column: 1 / -1; }
.tile {
  position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  aspect-ratio: 1; background: var(--accent-soft); cursor: pointer; box-shadow: var(--shadow);
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px;
  background: linear-gradient(transparent, rgb(30 15 35 / 70%)); color: #fff;
  font: 600 0.85rem/1.25 var(--sans); text-align: left;
}

/* Full-screen photo viewer */
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(20 10 25 / 94%); color: #fff;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgb(20 10 25 / 94%); }
.viewer img { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: calc(56px + env(safe-area-inset-top, 0px)) 8px 8px; }
.viewer .caption { padding: 4px 20px calc(20px + var(--safe-bottom)); max-width: 560px; margin: 0 auto; width: 100%; }
.viewer h2 { font-size: 1.4rem; }
.viewer p { color: #e5d9ec; margin: 4px 0 14px; }
.viewer .close, .viewer .nav {
  position: absolute; z-index: 1; width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgb(255 255 255 / 16%); color: #fff; font-size: 1.4rem; cursor: pointer;
}
.viewer .close { top: calc(8px + env(safe-area-inset-top, 0px)); right: 12px; }
.viewer .nav { top: 42%; font-size: 2rem; line-height: 1; }
.viewer .prev { left: 10px; }
.viewer .next { right: 10px; }

.inspo { display: flex; gap: 12px; align-items: center; background: var(--accent-soft); border-radius: 14px; padding: 10px; margin-bottom: 4px; }
.inspo img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.inspo div { flex: 1; min-width: 0; font-size: 0.95rem; }
.inspo b { display: block; }
.inspo button { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; font: 600 0.9rem var(--sans); cursor: pointer; padding: 8px 4px; }

/* --- Order form --- */
.step { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 16px; }
.step > h2 { font-size: 1.3rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.step > h2 .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 700 0.95rem var(--sans);
  display: grid; place-items: center;
}
.hint { color: var(--ink-soft); font-size: 0.92rem; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
label .opt { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=tel], input[type=email], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  font: 17px var(--sans); /* 16px+ stops iPhone zooming in on focus */
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%237a6259' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.line { border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 14px 14px; margin-bottom: 12px; }
.line .bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; }
.line .each { color: var(--ink-soft); font-size: 0.95rem; flex: 1; text-align: right; }
.line .fixed { min-height: 48px; display: flex; align-items: center; color: var(--ink-soft); }
.line .remove { background: none; border: 0; color: var(--ink-soft); font: 600 0.95rem var(--sans); text-decoration: underline; padding: 8px 0; cursor: pointer; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 48px; height: 44px; border: 0; background: var(--grey); font: 600 1.4rem var(--sans); color: var(--ink); cursor: pointer; }
.qty button:active { background: var(--line); }
.qty span { min-width: 40px; text-align: center; font-weight: 700; font-size: 1.1rem; }

.add-line { width: 100%; min-height: 48px; border: 1.5px dashed var(--accent); border-radius: 14px; background: none; color: var(--accent); font: 600 1rem var(--sans); cursor: pointer; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.cal-head strong { font-family: var(--serif); font-size: 1.15rem; }
.cal-head button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 1.2rem; color: var(--ink); cursor: pointer; }
.cal-head button:disabled { opacity: 0.3; cursor: default; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); padding: 4px 0; }
.cal button {
  aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 12px;
  background: var(--mint); color: var(--mint-ink); font: 700 1rem var(--sans); cursor: pointer;
}
.cal button:disabled { background: transparent; color: #c9bcb4; font-weight: 400; cursor: default; text-decoration: line-through; text-decoration-color: transparent; }
.cal button.selected { background: var(--accent); color: #fff; }
.cal button.today:disabled { text-decoration: underline; text-decoration-color: currentColor; }

.windows { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.windows label { margin: 0; }
.windows input { position: absolute; opacity: 0; pointer-events: none; }
.windows span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer;
}
.windows input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.windows input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

.photo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-pick img { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; }

.total {
  background: var(--accent-soft); border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.total .amt { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; }
.total .note { width: 100%; color: var(--ink-soft); font-size: 0.92rem; }

.error {
  background: #fdecec; color: #9b1c1c; border: 1px solid #f5c2c2;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-weight: 600;
}
.done { text-align: center; padding: 32px 16px; }
.done .big { font-size: 3rem; }
.done h2 { margin: 8px 0 12px; }
.done p { margin-bottom: 10px; }
.summary { text-align: left; background: var(--grey); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }

.loading { text-align: center; color: var(--ink-soft); padding: 48px 0; }
[hidden] { display: none !important; }
