:root {
  --delivery-accent: #059669;
  --delivery-bg: #f3f4f6;
  --delivery-toolbar-h: 56px;
}

* { box-sizing: border-box; }

.delivery-body {
  margin: 0;
  font-family: Inter, "Segoe UI", "Noto Sans Georgian", system-ui, sans-serif;
  background: var(--delivery-bg);
  color: #111;
  min-height: 100dvh;
  padding: 0 !important;
}

@media screen {
  body.delivery-body {
    padding: 0 !important;
    background: var(--delivery-bg) !important;
    width: auto !important;
    min-height: 100dvh !important;
  }
}

.hidden { display: none !important; }

.delivery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  gap: 14px;
  color: #64748b;
}

.delivery-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--delivery-accent);
  border-radius: 50%;
  animation: delivery-spin 0.8s linear infinite;
}

@keyframes delivery-spin { to { transform: rotate(360deg); } }

.delivery-error {
  max-width: 420px;
  margin: 40px auto;
  padding: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #b91c1c;
  text-align: center;
}

.delivery-app {
  min-height: 100dvh;
  padding-top: calc(var(--delivery-toolbar-h) + env(safe-area-inset-top, 0px));
}

.delivery-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.delivery-toolbar-inner {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.delivery-toolbar-inner::-webkit-scrollbar { display: none; }

.delivery-btn {
  flex: 0 0 auto;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111;
  border-radius: 10px;
  padding: 10px 14px;
  font: 600 0.82rem/1 Inter, system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.delivery-btn:active { transform: scale(0.98); }

.delivery-btn-primary {
  background: var(--delivery-accent);
  border-color: var(--delivery-accent);
  color: #fff;
}

.delivery-btn-ghost {
  background: #f9fafb;
}

.delivery-doc {
  padding: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.delivery-doc .a4-page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  min-height: auto !important;
}

.delivery-doc .contact-grid {
  grid-template-columns: 1fr;
}

.delivery-doc .delivery-box .address {
  font-size: 1.25rem;
}

.delivery-doc .contact-card .value.phone {
  font-size: 1.1rem;
}

.toast {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #111;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  z-index: 200;
  transition: transform 0.25s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok { background: #059669; }
.toast.err { background: #dc2626; }

@media print {
  .delivery-toolbar,
  .toast,
  .delivery-loading,
  .delivery-error {
    display: none !important;
  }

  .delivery-app {
    padding-top: 0;
  }

  .delivery-doc {
    padding: 0;
    max-width: none;
  }

  .delivery-doc .a4-page {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }

  body.delivery-body {
    background: #fff;
  }
}

@media (min-width: 640px) {
  .delivery-doc .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}
