/* Angelina's Pasticceria — black / silver / pink-rose-gold, pink bow theme.
   Dark elegant header & footer over a light airy body. Mobile-first (390px). */

:root {
  --near-black: #141114;
  --soft-black: #221d21;
  --silver: #c9ccd1;
  --silver-light: #e8eaee;
  --rose-gold: #b76e79;
  --rose-dark: #8d4f5a;   /* text-safe rose on light backgrounds (AA) */
  --rose-deep: #7c4550;   /* hover/pressed state that keeps white text AA */
  --blush: #f3c6d3;       /* decorative only — never a text color */
  --paper: #fdf9f6;       /* cream content background */
  --card: #ffffff;
  --ink: #2b242a;
  --ink-soft: #5c525a;
  --ok: #2e7d4f;
  --warn: #a33c3c;

  --font-display: Georgia, 'Times New Roman', 'Noto Serif', serif;
  --font-body: Georgia, 'Times New Roman', 'Noto Serif', serif;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 17, 20, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

/* ---------------------------------------------------------------- header */

.site-header {
  background: var(--near-black);
  color: var(--silver-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 2px solid var(--rose-gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--silver-light);
  text-decoration: none;
  min-width: 0;
}

.bow-mark { width: 34px; height: 22px; color: var(--blush); flex: none; }
.logo-mark { width: auto; height: 40px; flex: none; }
.bow-small { width: 44px; height: 28px; color: var(--rose-gold); }
.bow-placeholder { width: 96px; height: 62px; color: var(--rose-gold); }

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav { display: flex; align-items: center; gap: 16px; }
.site-nav a {
  color: var(--silver);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 2px; /* ~44px tap target */
  white-space: nowrap;
}
.site-nav a.active, .site-nav a:hover { color: #fff; border-bottom: 2px solid var(--rose-gold); }

.cart-link, .site-nav a.cart-link { position: relative; display: inline-flex; align-items: center; padding: 10px 8px; min-height: 44px; }
.cart-link svg { width: 24px; height: 24px; }
.cart-count {
  position: absolute;
  top: 0;
  right: -4px;
  background: var(--rose-dark); /* AA with white text (rose-gold is not) */
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ main */

main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 56px; }

.hero { text-align: center; padding: 18px 0 6px; }
.hero-logo { width: min(340px, 78vw); height: auto; margin: 0 auto 6px; }
.hero h1.hero-title { font-size: clamp(22px, 4.6vw, 30px); color: var(--rose-dark); }
.hero h1, h1 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--near-black);
  font-size: clamp(28px, 6vw, 40px);
  margin: 0 0 8px;
}
.hero p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto; }

/* ------------------------------------------------------------- menu grid */

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 22px;
}
@media (min-width: 560px) { .menu-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }

.menu-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--silver-light);
}

.card-photo { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--paper); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fbf3ee, #f7e9ef);
}
.item-detail .photo-placeholder { min-height: 220px; }

.sold-out .card-photo img, .sold-out .detail-photo img { filter: saturate(0.35) brightness(1.02); }

.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h2 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 600; }
.card-body h2 a { color: var(--near-black); text-decoration: none; }
.card-desc { margin: 0; color: var(--ink-soft); font-size: 15px; flex: 1; }

.card-meta { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }
.price { font-weight: 700; color: var(--near-black); font-size: 17px; }
.pack { color: var(--ink-soft); font-size: 14px; }

.badge {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-left { background: var(--blush); color: var(--near-black); }
.badge-soldout { background: var(--near-black); color: var(--silver-light); border: 1px solid var(--rose-gold); }
.badge-onphoto { position: absolute; top: 10px; left: 10px; }

/* --------------------------------------------------------------- buttons */

.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  min-height: 46px;
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--rose-dark); color: #fff; }
.btn-primary:hover { background: var(--rose-deep); }
.btn-secondary { background: var(--silver-light); color: var(--near-black); }
.btn-danger { background: var(--warn); color: #fff; }
.btn-disabled { background: var(--silver-light); color: var(--ink-soft); cursor: not-allowed; }
.btn-wide { width: 100%; }

/* ------------------------------------------------------------ item detail */

.item-detail { display: grid; gap: 22px; margin-top: 10px; }
@media (min-width: 760px) { .item-detail { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.detail-photo { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--card); }
.detail-body h1 { margin-top: 0; }
.detail-desc { color: var(--ink); font-size: 17px; }
.back-link { margin-top: 18px; }

.qty-row { display: flex; align-items: center; gap: 14px; margin: 18px 0 12px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--silver); border-radius: 999px; overflow: hidden; background: #fff; }
.qty-btn {
  font-size: 22px; border: none; background: none; width: 46px; height: 46px; cursor: pointer; color: var(--rose-dark);
}
.qty-stepper input {
  width: 52px; text-align: center; border: none; font: inherit; font-weight: 700; height: 46px;
  -moz-appearance: textfield; appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* -------------------------------------------------------- order & status */

.order-section { max-width: 640px; margin: 0 auto; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--silver-light);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
}
.cart-line .line-name { flex: 1; min-width: 0; }
.cart-line .line-name strong { display: block; }
.cart-line .line-name span { color: var(--ink-soft); font-size: 14px; }
.line-remove {
  background: none; border: none; color: var(--rose-dark); font-size: 20px; cursor: pointer;
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.cart-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding: 10px 4px; }

.form-grid { display: grid; gap: 14px; margin-top: 8px; }
.form-grid label { font-weight: 600; font-size: 15px; display: block; margin-bottom: 4px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; font: inherit; padding: 12px; border: 1px solid var(--silver);
  border-radius: 10px; background: #fff; min-height: 46px;
}
.form-grid textarea { min-height: 72px; resize: vertical; }

.notice { border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.notice-error { background: #fbeaea; color: var(--warn); border: 1px solid #eec7c7; }
.notice-ok { background: #e9f5ee; color: var(--ok); border: 1px solid #c4e3d1; }
.notice-info { background: var(--silver-light); color: var(--ink); }

.status-wrap { display: flex; justify-content: center; padding: 30px 0; }
.status-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--silver-light);
  padding: 30px 26px; max-width: 520px; width: 100%; text-align: center;
}
.status-card h1 { font-size: 26px; }
.status-card .order-lines { text-align: left; margin: 18px 0; border-top: 1px solid var(--silver-light); padding-top: 14px; }
.status-card .order-lines p { margin: 6px 0; display: flex; justify-content: space-between; gap: 10px; }
.status-instructions { text-align: left; background: var(--paper); border-radius: 10px; padding: 14px; white-space: pre-wrap; }

.spinner {
  width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--silver-light); border-top-color: var(--rose-gold);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- about */

.about-wrap { max-width: 680px; margin: 0 auto; }
.about-body { white-space: pre-wrap; font-size: 17px; }
.about-photos { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 560px) { .about-photos { grid-template-columns: 1fr 1fr; } }
.about-photos img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  background: var(--near-black);
  color: var(--silver);
  text-align: center;
  padding: 30px 16px 36px;
  margin-top: 40px;
}
.bow-divider { margin-bottom: 6px; }
.footer-word { font-family: var(--font-display); color: var(--silver-light); font-size: 18px; margin: 4px 0; }
.footer-note { font-size: 14px; margin: 4px 0 0; color: var(--silver); }

.empty-note { text-align: center; color: var(--ink-soft); grid-column: 1 / -1; padding: 30px 0; }

/* ------------------------------------------------------------- admin ---- */

.admin main { max-width: 760px; }
/* In the admin the TABS are the sticky navigation, not the header — a
   sticky header of varying height would slide over them on scroll. */
.admin .site-header { position: static; }
.admin-tabs {
  display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 2px solid var(--silver-light); margin: 6px 0 18px; padding-bottom: 0;
  position: sticky; top: 0; background: var(--paper); z-index: 10;
}
.admin-tabs button {
  font: inherit; font-weight: 700; border: none; background: none; cursor: pointer;
  padding: 12px 14px; color: var(--ink-soft); white-space: nowrap; min-height: 46px;
  border-bottom: 3px solid transparent;
}
.admin-tabs button.active { color: var(--rose-dark); border-bottom-color: var(--rose-gold); }

.admin-card {
  background: var(--card); border: 1px solid var(--silver-light); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px;
}
.admin-card h3 { margin: 0 0 4px; font-size: 17px; }
.admin-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-row .grow { flex: 1; min-width: 0; }
.item-row h3 { line-height: 1.3; }
.deal-row { margin-top: 10px; }
.deal-row .grow { line-height: 1.3; }
.deal-fields { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
/* Phones: the stock stepper and the deal inputs drop to their own line so
   names never get squeezed into a 3-word-wide column. */
@media (max-width: 560px) {
  .item-row .grow { flex-basis: calc(100% - 74px); }
  .item-row .stock-stepper { margin-left: 74px; }
  .deal-row .grow { flex-basis: 100%; }
  .deal-row { margin-top: 14px; }
}
.muted { color: var(--ink-soft); font-size: 14px; }

.stock-stepper { display: inline-flex; align-items: center; gap: 2px; }
.stock-stepper button {
  width: 46px; height: 46px; font-size: 20px; font-weight: 700; border-radius: 10px;
  border: 1px solid var(--silver); background: #fff; cursor: pointer; color: var(--rose-dark);
}
.stock-stepper .stock-num {
  width: 56px; min-height: 44px; text-align: center; font-weight: 700; font-size: 17px;
  border: 1px solid var(--silver-light); border-radius: 10px; font-family: inherit;
  -moz-appearance: textfield; appearance: textfield;
}

.order-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.order-card-actions .btn { padding: 10px 14px; min-height: 44px; font-size: 14.5px; }
.contact-links a { margin-right: 12px; font-weight: 600; }

.attention { border-left: 4px solid var(--warn); }
.status-pill { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--silver-light); }
.status-pill.paid { background: #e9f5ee; color: var(--ok); }
.status-pill.pending { background: #fdf3d7; color: #6f5713; }
.status-pill.fulfilled { background: var(--silver-light); color: var(--ink); }
.status-pill.canceled, .status-pill.expired { background: #fbeaea; color: var(--warn); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar select, .filter-bar input { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--silver); min-height: 46px; background: #fff; }

.config-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
.config-dot.ok { background: var(--ok); }
.config-dot.missing { background: var(--warn); }

.login-card { max-width: 380px; margin: 60px auto; }

@media (max-width: 420px) {
  /* The full wordmark must fit untruncated beside the nav at 390px. */
  .wordmark { font-size: 14.5px; letter-spacing: 0; }
  .bow-mark { width: 26px; height: 17px; }
  .logo-mark { height: 32px; }
  .site-header { padding: 12px 10px; gap: 8px; }
  .site-nav { gap: 8px; }
  .site-nav a { font-size: 14px; }
  main { padding: 16px 12px 48px; }
}

/* ------------------------------------------------------- categories ---- */

.cat-nav {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 2px 10px; margin: 8px 0 4px; scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  flex: none; white-space: nowrap; text-decoration: none; font-weight: 700; font-size: 14px;
  color: var(--rose-dark); background: var(--card); border: 1px solid var(--silver-light);
  border-radius: 999px; padding: 10px 14px; min-height: 40px; display: inline-flex; align-items: center;
}
.cat-nav a:hover { border-color: var(--rose-gold); }

.menu-section { margin-top: 26px; scroll-margin-top: 84px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 4px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 4.6vw, 28px);
  color: var(--near-black); margin: 0; padding-bottom: 6px; border-bottom: 2px solid var(--blush);
}
.section-blurb { margin: 0; color: var(--ink-soft); font-size: 15px; }
.menu-section .menu-grid { margin-top: 14px; }
.card-body h3 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 600; }
.card-body h3 a { color: var(--near-black); text-decoration: none; }

.cat-label {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--rose-dark); text-decoration: none; margin-bottom: 4px;
}
.cat-label:hover { text-decoration: underline; }
.admin-cat-head {
  font-family: var(--font-display); font-size: 18px; color: var(--rose-dark);
  margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--blush);
}

/* ------------------------------------------------------------ deals ---- */
.badge-deal { background: var(--near-black); color: var(--blush); }
.section-deal { margin: 2px 0 0; color: var(--rose-dark); font-weight: 700; font-size: 15px; flex-basis: 100%; }
.detail-deal {
  background: var(--blush); color: var(--near-black); border-radius: 10px; padding: 10px 14px;
  font-weight: 600; margin: 8px 0 12px;
}
.cart-discount { display: flex; justify-content: space-between; color: var(--ok); font-weight: 700; padding: 2px 4px; }
.cart-subtotal { display: flex; justify-content: space-between; color: var(--ink-soft); padding: 8px 4px 0; }

/* ------------------------------------------------------ photo gallery -- */
.gallery-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.gallery-strip::-webkit-scrollbar { display: none; }
.gallery-thumb {
  flex: none; width: 84px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; background: var(--card); cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active { border-color: var(--rose-gold); }
.gallery-thumb:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 2px; }

/* admin photo strip + crop adjuster */
.admin-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.admin-photo { width: 132px; }
.admin-photo .thumb { width: 132px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 2px solid transparent; display: block; }
.admin-photo.primary .thumb { border-color: var(--rose-gold); }
.admin-photo .tag { display: block; font-size: 12px; font-weight: 700; color: var(--rose-dark); margin: 4px 0 2px; min-height: 16px; }
.admin-photo .acts { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-photo .acts button {
  font: inherit; font-size: 12.5px; font-weight: 700; border: 1px solid var(--silver); background: #fff;
  border-radius: 8px; padding: 6px 8px; min-height: 34px; cursor: pointer; color: var(--ink);
}
.crop-modal { position: fixed; inset: 0; background: rgba(20,17,20,0.72); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.crop-card { background: var(--card); border-radius: var(--radius); padding: 16px; width: min(100%, 460px); }
.crop-frame {
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: #000;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
/* Before the original loads the photo covers the frame; once loaded the
   adjuster sets explicit width/height/left/top for pan + zoom. */
.crop-frame img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); }
.crop-zoom input[type="range"] { flex: 1; min-height: 32px; accent-color: var(--rose-dark); }
.crop-zoom-label { min-width: 3.2em; text-align: right; font-weight: 700; color: var(--ink); }
.crop-hint { text-align: center; color: var(--ink-soft); font-size: 14px; margin: 8px 0 12px; }

/* ---------------------------------------------------- package sizes ---- */
/* Menu card: one "$8.00 bag of 6" chip per size. */
.size-option { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.size-option .price { font-size: 15px; }
.size-option.sold-out { opacity: 0.55; text-decoration: line-through; }
/* Item page: radio list of sizes. */
.size-picker { border: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.size-picker legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.size-choice {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--silver); border-radius: 10px; background: #fff;
}
.size-choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--rose-dark); flex: none; }
.size-choice:has(input:checked) { border-color: var(--rose-gold); background: var(--blush); }
.size-choice.sold-out { color: var(--ink-soft); cursor: default; }
.size-choice-label { flex: 1; font-weight: 600; }
.size-choice-price { font-weight: 700; }
/* Admin list: one stock stepper per extra size. */
.size-rows { display: grid; gap: 6px; margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--silver-light); }
/* Admin editor: one row per extra size. */
.size-edit-head, .size-edit-row { display: grid; grid-template-columns: 1.5fr 0.9fr 0.7fr 0.8fr auto auto; gap: 6px; align-items: center; }
.size-edit-head { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; margin-top: 6px; }
.size-edit-row { margin-top: 6px; }
.form-grid .size-edit-row input:not([type="checkbox"]) { min-height: 42px; padding: 8px 10px; }
.form-grid .size-edit-row label { display: flex; align-items: center; gap: 4px; font-size: 13px; margin: 0; white-space: nowrap; }
.size-edit-row label input { width: 20px; height: 20px; min-height: 0; }
.size-edit-row [data-remove-size] {
  width: 42px; height: 42px; border: 1px solid var(--silver); background: #fff; border-radius: 10px;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--warn);
}
@media (max-width: 560px) {
  .size-edit-head { display: none; }
  .size-edit-row { grid-template-columns: 1fr 1fr; }
  .size-edit-row [data-sf="label"] { grid-column: 1 / -1; }
}

/* ------------------------------------------------- category editor ---- */
.cat-edit-row { display: grid; grid-template-columns: auto 1.1fr 1.6fr auto auto; gap: 6px; align-items: center; margin-top: 6px; }
.cat-edit-row input {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--silver); border-radius: 10px;
  background: #fff; min-height: 42px;
}
.cat-move { display: flex; gap: 2px; }
.cat-move button, .cat-edit-row [data-cat-remove] {
  width: 36px; height: 42px; border: 1px solid var(--silver); background: #fff; border-radius: 10px;
  font: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}
.cat-edit-row [data-cat-remove] { font-size: 22px; line-height: 1; color: var(--warn); }
.cat-count { font-size: 12.5px; white-space: nowrap; }
@media (max-width: 560px) {
  .cat-edit-row { grid-template-columns: auto 1fr auto auto; }
  .cat-edit-row [data-cf="blurb"] { grid-column: 1 / -1; }
}
