.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;
}

.assistive-order-button {
  right: max(1.25rem, env(safe-area-inset-right));
  top: auto;
  bottom: calc(max(1.25rem, env(safe-area-inset-bottom)) + 4.8rem);
  z-index: 39;
  width: 4.25rem;
  height: 4.25rem;
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(145deg, #d4ad69, #8f6129 68%, #5d3d1b);
}

.assistive-order-button .assistive-order-icon {
  width: 2rem;
  height: 2rem;
}

.assistive-order-button .assistive-order-icon::before,
.assistive-order-button .assistive-order-icon::after,
.assistive-order-button .assistive-order-icon i,
.assistive-order-button .assistive-order-icon b {
  display: none;
}

.assistive-order-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistive-order-label {
  top: auto;
  right: calc(100% + 0.65rem);
  bottom: 50%;
  left: auto;
  transform: translateY(50%);
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
}

.order-assistant {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 55;
  width: min(410px, calc(100vw - 2rem));
  height: min(680px, calc(100dvh - 2rem));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  color: #211d19;
  background: #fffdf9;
  border: 1px solid rgba(215, 175, 106, 0.42);
  border-radius: 1.45rem;
  box-shadow: 0 2rem 5rem rgba(38, 28, 18, 0.32);
  animation: orderAssistantIn 220ms ease both;
}

.order-assistant__header {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  color: #fff;
  background: linear-gradient(125deg, #171411 0 73%, #a87a39 73.3% 74%, #d4ad69 74.3% 100%);
}

.order-assistant__identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.order-assistant__avatar {
  width: 2.8rem;
  height: 2.8rem;
  display: grid;
  place-items: center;
  flex: 0 0 2.8rem;
  color: #171411;
  background: linear-gradient(145deg, #f6dcaa, #b47e36);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 0.9rem;
  font: 600 1.65rem/1 Georgia, serif;
}

.order-assistant__identity h2 {
  margin: 0;
  font: 600 1.05rem/1.15 Georgia, serif;
}

.order-assistant__identity p {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.75rem;
}

.order-assistant__identity i {
  width: 0.45rem;
  height: 0.45rem;
  display: inline-block;
  margin-right: 0.25rem;
  background: #5fd58a;
  border-radius: 50%;
}

.order-assistant__minimize {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.order-progress {
  padding: 0.75rem 1rem 0.7rem;
  background: #f5efe5;
  border-bottom: 1px solid #e8ddcd;
}

.order-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  color: #766653;
  font-size: 0.75rem;
}

.order-progress__meta strong { color: #8f6129; }

.order-progress__track {
  height: 0.35rem;
  overflow: hidden;
  background: #ded1bf;
  border-radius: 999px;
}

.order-progress__track span {
  width: 20%;
  height: 100%;
  display: block;
  background: linear-gradient(90deg, #93642a, #d4ad69);
  border-radius: inherit;
  transition: width 220ms ease;
}

.order-chat {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  background:
    radial-gradient(circle at 100% 0, rgba(212, 173, 105, 0.09), transparent 12rem),
    #fbf8f3;
  scrollbar-width: thin;
  scrollbar-color: #cdbb9f transparent;
}

.order-message {
  max-width: 86%;
  margin: 0 0 0.75rem;
  padding: 0.72rem 0.85rem;
  white-space: pre-line;
  border-radius: 1rem 1rem 1rem 0.25rem;
  color: #51473d;
  background: #eee7dd;
  font-size: 0.88rem;
  line-height: 1.48;
  box-shadow: 0 0.3rem 0.8rem rgba(57, 43, 29, 0.06);
}

.order-message--user {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, #a3763a, #785023);
  border-radius: 1rem 1rem 0.25rem 1rem;
}

.order-message--summary {
  max-width: 100%;
  color: #302820;
  background: #fff;
  border: 1px solid #e2d4c0;
  font-size: 0.82rem;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
  background: #fbf8f3;
}

.order-actions:empty { display: none; }

.order-action {
  min-height: 2.45rem;
  flex: 1 1 auto;
  padding: 0.55rem 0.8rem;
  color: #6d4a22;
  background: #fffaf2;
  border: 1px solid #c99f63;
  border-radius: 0.8rem;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.order-action--primary {
  color: #fff;
  background: #171411;
  border-color: #171411;
}

.order-action--danger {
  color: #983f35;
  border-color: #d8aaa4;
}

.order-composer {
  display: flex;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border-top: 1px solid #e8dfd4;
}

.order-composer input {
  min-width: 0;
  height: 2.75rem;
  flex: 1;
  padding: 0 0.85rem;
  color: #28221c;
  background: #f7f3ed;
  border: 1px solid #ded4c7;
  border-radius: 0.85rem;
  outline: none;
  font: inherit;
  font-size: 0.9rem;
}

.order-composer input:focus {
  border-color: #ae8146;
  box-shadow: 0 0 0 3px rgba(174, 129, 70, 0.14);
}

.order-composer button {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: #a47438;
  border-radius: 0.85rem;
  cursor: pointer;
}

.order-composer button svg {
  width: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.order-assistant__error {
  min-height: 0;
  margin: 0;
  padding: 0 1rem;
  color: #a13f35;
  background: #fbf8f3;
  font-size: 0.76rem;
}

.order-assistant__error:not(:empty) { padding-bottom: 0.65rem; }

.order-assistant__privacy {
  margin: 0;
  padding: 0 0.85rem 0.7rem;
  color: #8d8174;
  background: #fff;
  text-align: center;
  font-size: 0.75rem;
}

.order-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem;
  color: #574b3e;
  background: #fff9ef;
  border: 1px solid #e1ceb0;
  border-radius: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.order-consent input { margin-top: 0.15rem; accent-color: #93642a; }

.order-editor {
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
  background: #fbf8f3;
}

.order-editor h3 {
  margin: 0 0 0.8rem;
  font: 600 1.2rem Georgia, serif;
}

.order-editor label {
  display: block;
  margin-bottom: 0.65rem;
  color: #625649;
  font-size: 0.75rem;
  font-weight: 700;
}

.order-editor input {
  width: 100%;
  height: 2.5rem;
  margin-top: 0.3rem;
  padding: 0 0.7rem;
  background: #fff;
  border: 1px solid #d9cdbd;
  border-radius: 0.65rem;
  font: inherit;
}

.order-editor__item {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e0d4c4;
  border-radius: 0.85rem;
}

.order-editor__item header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
}

.order-editor__item button {
  color: #a13f35;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.order-editor__grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 0.55rem;
}

.order-editor__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.order-editor__buttons .order-action { flex: 1; }

.order-assistant-open .whatsapp-chat {
  opacity: 0;
  pointer-events: none;
}

@keyframes orderAssistantIn {
  from { opacity: 0; transform: translateY(1rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
  .assistive-order-button {
    right: max(0.8rem, env(safe-area-inset-right));
    bottom: calc(max(0.8rem, env(safe-area-inset-bottom)) + 4.4rem);
    width: 3.75rem;
    height: 3.75rem;
  }

  .assistive-order-label { display: none; }

  .order-assistant {
    right: max(0.5rem, env(safe-area-inset-right));
    bottom: max(0.5rem, env(safe-area-inset-bottom));
    width: calc(100vw - 1rem);
    height: min(700px, calc(100dvh - 1rem));
    border-radius: 1.2rem;
  }

  .order-assistant__header { min-height: 4.25rem; }
  .order-message { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  .order-assistant { animation: none; }
  .order-progress__track span { transition: none; }
}
