/* ==========================================================================
   Lucia (לוציה) — Order in Advance (/zamow)
   Uses the same design tokens/fonts as style.css. Kept in its own file so
   the rest of the site's stylesheet stays untouched.
   ========================================================================== */

.order-page { padding-top: 6px; padding-bottom: 140px; }

.order-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--header-h) + 28px) 20px 8px;
  text-align: center;
}
.order-hero h1 .he { font-size: 26px; font-weight: 800; }
.order-hero p.he {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.order-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 20px 4px;
}
.order-section-title {
  margin: 0 4px 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.order-section-title .he { display: block; font-size: 16px; font-weight: 700; }
.order-section-title .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- category quick-jump nav ---------- */
.order-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 2px 14px;
  margin: 0 -4px 6px;
  position: sticky;
  top: var(--header-h);
  background: var(--paper);
  z-index: 40;
}
.order-cat-nav[hidden] { display: none; }

.order-cat-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-he);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.order-cat-pill:active { transform: scale(0.96); }
.order-cat-pill.active,
.order-cat-pill:hover,
.order-cat-pill:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* category section labels inside the order product list — reuses the
   main menu's .menu-group-label look for visual consistency */
.order-group-label { margin-top: 24px; scroll-margin-top: calc(var(--header-h) + 54px); }
.product-list .order-group-label:first-child { margin-top: 0; }
.product-list > .order-group-label,
.product-list > .trelovsky-category-block {
  flex-basis: 100%;
  width: 100%;
}
.product-list > .trelovsky-category-block .trelovsky-group-label {
  scroll-margin-top: calc(var(--header-h) + 54px);
}

/* ---------- product cards ---------- */
.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-card {
  flex: 1 1 calc((100% - 16px) / 3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s ease, background .15s ease;
  box-sizing: border-box;
}
.product-card.in-cart { border-color: var(--accent); background: var(--paper-soft); }

.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper-soft);
  box-shadow: 0 2px 6px rgba(36,35,31,0.12), inset 0 0 0 1px rgba(20,18,14,0.06);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb img.supplier-photo {
  filter: saturate(0.82) sepia(0.14) contrast(0.96) brightness(1.04);
}
.product-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 16px; }

.product-info { width: 100%; }
.product-name {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc { display: none; }
.product-price { font-size: 10px; font-weight: 700; color: var(--accent); margin-top: 1px; }
.product-price .half-note { font-size: 8.5px; font-weight: 600; color: var(--muted); display: block; }

.qty-stepper {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: var(--paper-soft);
  border-radius: 999px;
  padding: 2px;
  margin-top: 3px;
}
.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(36,35,31,0.16);
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.qty-btn:active { transform: scale(0.9); }
.qty-btn.plus { background: var(--accent); color: #fff; }
.qty-value { min-width: 16px; text-align: center; font-size: 11px; font-weight: 700; }

.order-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
}

/* ---------- custom request ---------- */
.custom-request textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: var(--font-he);
  font-size: 14px;
  color: var(--ink);
  resize: vertical;
  background: var(--paper);
}
.custom-request textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.custom-request p.hint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.order-lead-time-note {
  background: #f6efe4;
  border: 1px solid #d9c7a8;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #5a4a32;
  margin: 10px 0 16px;
}

/* ---------- form fields (pickup + customer) ---------- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.field-grid .field.full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: var(--font-he);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  direction: rtl;
}
.field input[type="tel"],
.field input[type="date"],
.field input[type="time"] { direction: ltr; text-align: right; }
.field input:focus { outline: none; border-color: var(--accent); }
.field input.invalid { border-color: var(--warn); }
.field .error-msg {
  display: none;
  color: var(--warn);
  font-size: 11.5px;
  margin-top: 5px;
}
.field.invalid .error-msg { display: block; }

/* ---------- sticky cart bar ---------- */
.order-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(36,35,31,0.10);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.order-cart-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.order-cart-total { flex: 0 0 auto; }
.order-cart-total .label { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: 0.08em; }
.order-cart-total .value { display: block; font-size: 19px; font-weight: 800; color: var(--ink); }
.order-cart-cta {
  flex: 1 1 auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 15px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s ease, transform .12s ease;
}
.order-cart-cta:active { transform: scale(0.98); }
.order-cart-cta:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- summary ---------- */
.order-summary-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--paper-soft);
}
.order-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.order-summary-row:last-of-type { border-bottom: none; }
.order-summary-row .k { color: var(--muted); flex: 0 0 auto; }
.order-summary-row .v { font-weight: 700; text-align: left; }
.order-summary-items { margin-top: 2px; }
.order-summary-items .item-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0;
}
.order-summary-items .item-row .name { color: var(--ink); }
.order-summary-items .item-row .price { color: var(--muted); }
.order-summary-request {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink);
}
.order-summary-request .k { color: var(--muted); display: block; margin-bottom: 2px; }
.order-summary-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 800;
}

.order-confirm-btn {
  width: 100%;
  margin-top: 18px;
  background: #2f9e5c;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 18px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47,158,92,0.35);
  transition: opacity .15s ease, transform .12s ease, box-shadow .15s ease;
}
.order-confirm-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(47,158,92,0.3); }
.order-confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.order-back-to-menu-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  padding: 13px;
  text-align: center;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.order-back-to-menu-btn:active { transform: scale(0.98); }

.order-submit-error {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fbeae5;
  color: var(--warn);
  font-size: 13px;
  text-align: center;
}
.order-submit-error.visible { display: block; }

/* ---------- confirmation screen ---------- */
.order-confirmation {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--header-h) + 40px) 24px 60px;
  text-align: center;
}
.order-confirmation .check-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 34px;
}
.order-confirmation h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.order-confirmation .order-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin: 14px 0 20px;
}
.order-confirmation .order-summary-box { text-align: right; margin-top: 20px; }

.confirm-screenshot-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.confirm-calendar-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 11px 22px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.confirm-calendar-btn:active { transform: scale(0.97); }

.confirm-contact-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.confirm-contact-phone {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  margin-inline-start: 4px;
}

.order-loading { display: none; text-align: center; padding: 20px; color: var(--muted); font-size: 13.5px; }
.order-loading.visible { display: block; }

@media (max-width: 480px) {
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .field { grid-column: 1 / -1; }
}
