@font-face {
  font-family: 'NexaRust';
  src: url('/static/fonts/NexaRustSans-BlackShadow1.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:  #111111;
  --green2: #333333;
  --light:  #f5f5f5;
  --border: #ddd;
  --text:   #212121;
  --muted:  #666666;
  --error:  #c62828;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.12);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--light); }

/* ── Header ── */
.top-nav { background: var(--green); color: #fff; padding: 14px 16px; font-size: 1.1rem; font-weight: 600; position: sticky; top: 0; z-index: 100; }
.app-title { font-size: 1.1rem; font-weight: 600; margin: 0; }

/* ── Layout ── */
.screen { display: flex; flex-direction: column; min-height: calc(100vh - 52px); }
.screen.hidden { display: none; }
.form-layout { display: flex; flex: 1; height: calc(100vh - 52px); }

/* ── Menu panel ── */
.menu-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.category-tabs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.cat-btn { flex-shrink: 0; padding: 8px 16px; border: 2px solid var(--border); border-radius: 20px; background: #fff; font-size: .9rem; cursor: pointer; transition: all .15s; }
.cat-btn.active, .cat-btn:focus-visible { border-color: var(--green); color: var(--green); font-weight: 600; outline: 2px solid var(--green); outline-offset: 2px; }
.items-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 12px; }
.items-list { display: contents; }

/* ── Item card ── */
.item-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.item-card:focus-visible, .item-card:hover { border-color: var(--green); outline: none; }
.item-photo { width: 100%; aspect-ratio: 1; object-fit: cover; background: #e0e0e0; display: block; }
.item-photo-placeholder { width: 100%; aspect-ratio: 1; background: linear-gradient(135deg, #e0e0e0, #bdbdbd); display: none; align-items: center; justify-content: center; color: var(--muted); font-size: .75rem; text-align: center; padding: 8px; }
.item-info { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.item-name { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.item-desc { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.item-price { font-size: .9rem; color: var(--green); font-weight: 700; }
.item-price-unknown { font-size: .85rem; color: var(--muted); font-style: italic; }
.item-add { margin: 0 10px 10px; padding: 7px; border: none; border-radius: 6px; background: var(--green); color: #fff; font-size: .85rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.item-add:hover, .item-add:focus-visible { background: var(--green2); outline: 2px solid var(--green); outline-offset: 2px; }
.item-add.in-cart { background: #333333; }

/* ── Cart panel ── */
.cart-panel { width: 340px; background: #fff; border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.drawer-handle { display: none; }
.customer-fields { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
input, textarea { padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
input[aria-required="true"] { border-left: 3px solid var(--green); }
.hidden { display: none !important; }
.datetime-row { display: flex; gap: 10px; }
.datetime-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.datetime-field label { font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.datetime-field input[type="date"],
.datetime-field select { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .95rem; box-sizing: border-box; background: #fff; appearance: auto; }
.datetime-field input:focus-visible,
.datetime-field select:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.field-error { display: block; font-size: .85rem; color: #c62828; margin-top: 4px; }
.field-invalid { border-color: #c62828 !important; outline-color: #c62828 !important; }
.req-star { color: #c62828; }
.email-confirm-row { display: flex; flex-direction: column; gap: 2px; }
.email-confirm-row input { width: 100%; }
.event-details-section { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.event-label { font-size: .85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 4px; }
.headcount-row { display: flex; flex-direction: column; gap: 2px; }
.headcount-row input { width: 100%; }
.yn-group { display: flex; flex-direction: column; gap: 4px; }
.yn-toggle { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; width: fit-content; }
.yn-btn { padding: 8px 24px; border: none; background: #fff; font-size: .9rem; cursor: pointer; transition: background .15s; }
.yn-btn.active { background: var(--green); color: #fff; font-weight: 600; }
.yn-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.order-cutoff-notice { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.fulfillment-toggle { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.fulfill-btn { flex: 1; padding: 9px; border: none; background: #fff; font-size: .9rem; cursor: pointer; transition: background .15s; }
.fulfill-btn.active { background: var(--green); color: #fff; font-weight: 600; }
.fulfill-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.cart-items { flex: 1; padding: 12px; overflow-y: auto; }
.details-divider { display: none; }
.cart-empty { color: var(--muted); font-size: .9rem; text-align: center; padding: 24px 0; }
.cart-line { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.cart-line-name { flex: 1; }
.cart-line-mods { font-size: .82rem; color: var(--muted); }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.cart-qty-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 50%; background: #fff; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.cart-qty-btn:focus-visible { outline: 2px solid var(--green); }
textarea { resize: vertical; min-height: 60px; margin: 8px 12px 0; width: calc(100% - 24px); }
.submit-btn { margin: 12px; padding: 14px; border: none; border-radius: var(--radius); background: var(--green); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s; }
.submit-btn:hover, .submit-btn:focus-visible { background: var(--green2); outline: 2px solid var(--green); outline-offset: 2px; }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.submit-error { margin: 0 12px 12px; padding: 10px 12px; background: #ffebee; border: 1px solid var(--error); border-radius: 6px; color: var(--error); font-size: .9rem; }

/* ── Spinner ── */
.spinner { width: 20px; height: 20px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Customization sheet ── */
.cust-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; }
.cust-sheet { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px,100%); max-height: 80vh; background: #fff; border-radius: 16px 16px 0 0; z-index: 201; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 -4px 24px rgba(0,0,0,.2); }
.cust-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 1.1rem; }
#cust-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; padding: 4px 8px; }
#cust-close:focus-visible { outline: 2px solid var(--green); border-radius: 4px; }
.cust-groups { overflow-y: auto; padding: 12px 16px; flex: 1; }
.cust-min-error { padding: 8px 16px; background: #ffebee; color: #c62828; font-size: .85rem; border-top: 1px solid #ffcdd2; }
fieldset.cust-group { border: none; margin: 0 0 16px; padding: 0; min-width: 0; }
.cust-group-label { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.cust-option { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.cust-option label { font-size: .95rem; cursor: pointer; }
.cust-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.cust-footer { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.cust-qty { display: flex; align-items: center; gap: 10px; }
.qty-btn { width: 36px; height: 36px; border: 2px solid var(--green); border-radius: 50%; background: #fff; color: var(--green); font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.qty-num { font-size: 1.1rem; font-weight: 700; min-width: 24px; text-align: center; }
.cust-add { flex: 1; padding: 12px; border: none; border-radius: var(--radius); background: var(--green); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; }
.cust-add:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ── Mobile cart FAB ── */
.cart-fab { position: fixed; bottom: 20px; right: 20px; padding: 14px 20px; border: none; border-radius: 30px; background: var(--green); color: #fff; font-weight: 700; font-size: 1rem; box-shadow: 0 4px 16px rgba(0,0,0,.25); cursor: pointer; z-index: 100; display: none; }
.cart-fab:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 768px) { .cart-fab { display: block; } }
.cart-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 149; }

/* ── Submit confirm modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: #fff; border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,.25); padding: 28px 24px; max-width: 380px; width: 100%; }
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.modal-body { font-size: .95rem; line-height: 1.5; color: var(--text); margin-bottom: 8px; }
.modal-body-sm { font-size: .8rem; color: var(--muted); margin-bottom: 16px; }
.modal-email { font-size: 1rem; font-weight: 700; color: var(--green); word-break: break-all; margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; }
.modal-cancel-btn { flex: 1; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font-size: .95rem; cursor: pointer; }
.modal-cancel-btn:hover { background: var(--light); }
.modal-confirm-btn { flex: 1; padding: 11px; border: none; border-radius: var(--radius); background: var(--green); color: #fff; font-size: .95rem; font-weight: 700; cursor: pointer; }
.modal-confirm-btn:hover { background: var(--green2); }
.modal-cancel-btn:focus-visible, .modal-confirm-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ── Confirmation ── */
.confirm-card { max-width: 440px; margin: 60px auto; padding: 40px 32px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.confirm-icon { font-size: 3rem; color: var(--green); margin-bottom: 16px; }
.confirm-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.confirm-body { font-size: 1rem; line-height: 1.5; margin-bottom: 12px; }
.confirm-note { font-size: .9rem; color: var(--muted); margin-bottom: 24px; }
.confirm-note a { color: var(--green); }

/* ── Delivery fee ── */
.delivery-fee-row { background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 6px; padding: 8px 12px; font-size: .9rem; font-weight: 600; color: #2e7d32; }
#delivery-instructions { margin: 0; width: 100%; min-height: 60px; }

/* ── Mobile ── */
/* Desktop: restore original order (form first, cart below) */
@media (min-width: 769px) {
  .customer-fields { order: 1; }
  .cart-items      { order: 2; }
  #dropoff-notes   { order: 3; }
  .details-divider { order: 4; }
  #submit-btn      { order: 5; }
  #submit-error    { order: 6; }
}

@media (max-width: 768px) {
  .form-layout { flex-direction: column; height: auto; }
  .menu-panel { min-height: 60vh; }
  .cart-panel { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; max-height: 80vh; border-radius: 16px 16px 0 0; border-left: none; border-top: 1px solid var(--border); z-index: 150; transform: translateY(100%); transition: transform .3s ease; box-shadow: 0 -4px 24px rgba(0,0,0,.15); overflow-y: auto; }
  .cart-panel.open { transform: translateY(0); }
  .drawer-handle { display: flex; justify-content: center; padding: 10px; }
  #drawer-close-btn { background: none; border: none; color: var(--muted); font-size: .9rem; cursor: pointer; }
  #drawer-close-btn:focus-visible { outline: 2px solid var(--green); border-radius: 4px; }
  /* On mobile: cart fills only what it needs, rest scrolls */
  .cart-items { flex: none; overflow-y: visible; }
  .details-divider {
    display: block;
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted);
    padding: 10px 12px 6px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
}

/* ── Landing page ── */
.landing-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--light);
}
.landing-inner {
  text-align: center;
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center;
}
.landing-logo {
  margin: 0 0 52px;
  display: flex; justify-content: center; align-items: center;
  width: 100%;
}
.landing-logo-img {
  display: block;
  width: clamp(240px, 76vw, 560px);
  height: auto;
}
.landing-cta {
  display: inline-block;
  background: var(--green); color: #fff;
  padding: 18px 52px;
  border-radius: 50px;
  font-size: 1.1rem; font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.15s;
  margin-bottom: 28px;
}
.landing-cta:hover { background: var(--green2); transform: translateY(-2px); }
.landing-cta:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.landing-contact {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-height: 44px;
  color: var(--green);
  padding: 11px 34px;
  border: 2px solid var(--green);
  border-radius: 50px;
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 28px;
}
.landing-contact:hover { background: var(--green); color: #fff; }
.landing-contact:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.landing-addr {
  color: var(--muted); font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.closure-banner {
  background: var(--error);
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 12px 20px;
  border-radius: var(--radius);
  margin-bottom: 32px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 4px;
  letter-spacing: 0.02em;
}
