/* Public order form + confirmation. Colours come from :root vars set by the theme. */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100vw; }
body { font-family: Arial, Helvetica, sans-serif; margin: 0; padding: 140px 10px 70px; background: #f9f9f9; color: #222; }
a { color: var(--c-dark); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* sticky header */
.sticky-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; color: #fff; padding: 8px 12px;
  background: linear-gradient(135deg, var(--c-dark) 0%, var(--c-primary) 100%); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.sticky-header h1 { margin: 0 0 8px; font-size: 1.05em; text-align: center; }
.deadline { margin: -4px 0 6px; text-align: center; font-size: .8em; color: #ffeb3b; font-weight: bold; }
.opens-at { font-size: 1.15em; text-align: center; }
.header-row { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.field-group { display: flex; align-items: center; gap: 4px; }
.field-group label { font-size: .75em; font-weight: bold; white-space: nowrap; }
.field-group input, .field-group select { padding: 6px 8px; border: none; border-radius: 4px; font-size: .9em; }
.field-group input { width: 120px; }
.field-group input[type=tel] { width: 130px; }
.field-group select { background: #fff; cursor: pointer; max-width: 200px; }
.header-totals { display: flex; gap: 10px; align-items: center; font-size: .82em; font-weight: bold; flex-wrap: wrap; }
.grand-total { color: #ffeb3b; font-size: 1.05em; }
.submit-btn { background: var(--c-accent); color: #fff; padding: 7px 14px; border: none; border-radius: 4px; font-size: .9em;
  font-weight: bold; cursor: pointer; white-space: nowrap; }
.submit-btn:hover { background: var(--c-header); }
.submit-btn[disabled] { opacity: .6; cursor: wait; }

/* errors */
.errors { background: #ffebee; border-left: 5px solid #c62828; color: #b71c1c; padding: 10px 14px; border-radius: 4px; margin: 10px 0; }
.errors ul { margin: 6px 0 0 18px; padding: 0; }

/* product tables */
.cat-title { color: var(--c-dark); border-bottom: 2px solid var(--c-primary); padding-bottom: 6px; margin: 22px 0 10px; font-size: 1.05em; }
.light-italic { font-style: italic; font-weight: normal; color: #666; font-size: .85em; }
table.products { width: 100%; border-collapse: collapse; margin-bottom: 15px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); font-size: .95em; }
table.products th, table.products td { border: 1px solid #ccc; padding: 8px 6px; text-align: left; vertical-align: middle; }
table.products thead th { background: var(--c-secondary); }
.qty-col { width: 90px; text-align: center !important; }
tr.selected { background: var(--c-bg) !important; box-shadow: inset 4px 0 0 var(--c-primary); }
tr.selected td { font-weight: bold; }
input.select-item { width: 22px; height: 22px; vertical-align: middle; margin: 0 8px 0 0; accent-color: var(--c-primary); cursor: pointer; }
td label { cursor: pointer; vertical-align: middle; }
input.qty { width: 100%; max-width: 80px; text-align: center; padding: 6px; font-size: 1em; border: 2px solid #ccc; border-radius: 4px; }
input.qty:not(:disabled) { border-color: var(--c-primary); background: var(--c-secondary); }
.total-row th { text-align: right; background: #fff8e1; }
.total-row td { text-align: center; font-weight: bold; color: var(--c-accent); background: #fff8e1; }
.price { white-space: nowrap; }

.product-thumb, .product-no-thumb { width: 40px; height: 40px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.product-thumb { object-fit: cover; cursor: zoom-in; border: 1px solid #ddd; }
.product-no-thumb { display: inline-flex; align-items: center; justify-content: center; background: #f0f0f0; color: #bbb; font-size: 1.2em; }

.privacy { font-size: .82em; color: #555; background: #fff; border: 1px dashed #ccc; padding: 8px 12px; border-radius: 6px; }

/* footer */
.sticky-footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: var(--c-dark); color: #fff;
  padding: 6px 10px; font-size: .72em; text-align: center; line-height: 1.5; }
.sticky-footer a { color: #ffeb3b; text-decoration: none; }
.sticky-footer .hl { color: #ffeb3b; font-weight: bold; }

/* image viewer */
.iv { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 9999; align-items: center; justify-content: center; flex-direction: column; }
.iv.open { display: flex; }
.iv img { max-width: 90vw; max-height: 75vh; border-radius: 8px; }
.iv-title { color: #fff; margin-top: 10px; }
.iv button { background: rgba(0,0,0,.5); color: #fff; border: none; font-size: 28px; cursor: pointer; padding: 10px 16px; border-radius: 4px; }
.iv .iv-close { position: absolute; top: 12px; right: 16px; font-size: 36px; background: none; }
.iv .iv-prev { position: absolute; left: 10px; top: 50%; }
.iv .iv-next { position: absolute; right: 10px; top: 50%; }
.iv-dots span { display: inline-block; width: 12px; height: 12px; margin: 10px 5px 0; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.iv-dots span.on { background: #fff; }
.hover-preview { display: none; position: fixed; background: #fff; padding: 5px; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.3); z-index: 9998; pointer-events: none; }
.hover-preview img { max-width: 300px; max-height: 300px; display: block; border-radius: 4px; }

/* closed + confirmation */
.closed-box, .confirm-box { max-width: 620px; margin: 0 auto; background: #fff; padding: 28px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.1); }
body.confirm-page, body.order-page:has(.closed-box) { padding-top: 30px; background: var(--c-bg); }
.closed-box h1, .confirm-box h1 { color: var(--c-dark); text-align: center; }
.order-number { text-align: center; font-size: 1.25em; background: #fff8e1; padding: 10px; border-radius: 6px; }
.order-number strong { color: var(--c-accent); }
.pickup { font-size: 1.15em; color: var(--c-accent); }
.confirm-items { width: 100%; border-collapse: collapse; margin: 14px 0; }
.confirm-items td { border-bottom: 1px solid #eee; padding: 6px 4px; }
.confirm-items .num { text-align: right; white-space: nowrap; }
.confirm-items .total td { font-weight: bold; font-size: 1.15em; color: var(--c-accent); border-top: 2px solid #ccc; }
.hint { font-size: .85em; color: #666; }
.center { text-align: center; }
.btn { display: inline-block; background: var(--c-primary); color: #fff; padding: 12px 24px; border-radius: 6px; text-decoration: none; }
.btn:hover { background: var(--c-dark); }

@media (min-width: 769px) {
  body { padding: 120px 20px 50px; }
  .sticky-header { padding: 10px 20px; }
  .sticky-header h1 { font-size: 1.25em; }
  .field-group input { width: 140px; }
  .sticky-footer { font-size: .82em; }
}
@media (max-width: 520px) {
  .sticky-header h1 { font-size: .85em; margin-bottom: 5px; }
  .field-group label { position: absolute; left: -9999px; }
  .field-group input, .field-group input[type=tel] { width: 46vw; font-size: .85em; padding: 6px 5px; }
  .field-group select { width: 46vw; max-width: none; font-size: .85em; padding: 6px 4px; }
  .header-totals { flex: 1 1 100%; justify-content: center; background: rgba(0,0,0,.25); padding: 8px; border-radius: 4px; }
  .header-totals .cat-total { display: none; }
  .grand-total { font-size: 1.25em; }
  .submit-btn { flex: 1 1 100%; padding: 11px; font-size: 1em; }
  table.products { font-size: .86em; }
  table.products th, table.products td { padding: 6px 4px; }
  .qty-col { width: 64px; }
  .sticky-footer { font-size: .62em; }
}
