/* "Ask our deals assistant" (assistant.js). Self-contained: shared by the storefront and the Next pages. */
.dod-assist-fab,
.dod-assist {
  --da-action: #086b24;
  --da-action-hover: #05551c;
  --da-cream: #faf9f5;
  --da-sage: #eaf5e7;
  --da-ink: #171c19;
  --da-muted: #475348;
  --da-line: #e1e5df;
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  box-sizing: border-box;
}
.dod-assist *,
.dod-assist *::before,
.dod-assist *::after {
  box-sizing: border-box;
}

.dod-assist-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 28;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--da-action);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(16, 40, 27, 0.22);
  cursor: pointer;
}
.dod-assist-fab:hover {
  background: var(--da-action-hover);
}
.dod-assist-fab:focus-visible,
.dod-assist :focus-visible {
  outline: 3px solid var(--da-action);
  outline-offset: 2px;
}
.dod-assist-fab:focus-visible {
  outline-color: var(--da-ink);
}
.dod-assist-fab svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.dod-assist-fab[aria-expanded='true'] {
  display: none;
}

.dod-assist {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-height: min(640px, calc(100dvh - 40px));
  border: 1px solid var(--da-line);
  border-radius: 18px;
  background: var(--da-cream);
  color: var(--da-ink);
  box-shadow: 0 18px 48px rgba(16, 40, 27, 0.22);
  overflow: hidden;
}
.dod-assist[hidden],
.dod-assist [hidden] {
  display: none !important;
}

.dod-assist__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 12px 18px;
  border-bottom: 1px solid var(--da-line);
  background: #fff;
}
.dod-assist__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.dod-assist__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--da-ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.dod-assist__close:hover {
  background: #eeede6;
}

.dod-assist__log {
  flex: 1 1 auto;
  min-height: 160px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.dod-assist__msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.dod-assist__msg p {
  margin: 0;
}
.dod-assist__msg p + p {
  margin-top: 0.6em;
}
.dod-assist__msg--bot,
.dod-assist__msg--pending {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--da-line);
  border-bottom-left-radius: 4px;
}
.dod-assist__msg--user {
  align-self: flex-end;
  background: var(--da-action);
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}
.dod-assist__msg--error {
  align-self: flex-start;
  background: #fbe9e7;
  color: #8a1c12;
}
.dod-assist__msg--pending {
  color: var(--da-muted);
  font-style: italic;
}
.dod-assist__msg a {
  color: var(--da-action);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dod-assist__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.dod-assist__chip {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #c9cfc6;
  border-radius: 999px;
  background: var(--da-sage);
  color: var(--da-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.dod-assist__chip:hover {
  border-color: var(--da-action);
}

.dod-assist__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 12px 6px;
  border-top: 1px solid var(--da-line);
  background: #fff;
}
.dod-assist__input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 12px;
  border: 1px solid #c9cfc6;
  border-radius: 12px;
  background: #fff;
  color: var(--da-ink);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming in */
  line-height: 1.35;
  resize: none;
}
.dod-assist__input:focus-visible {
  outline-offset: 0;
}
.dod-assist__send {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--da-action);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.dod-assist__send:hover {
  background: var(--da-action-hover);
}
.dod-assist__send:disabled {
  opacity: 0.6;
  cursor: progress;
}
.dod-assist__note {
  margin: 0;
  padding: 2px 16px 12px;
  background: #fff;
  color: var(--da-muted);
  font-size: 12px;
}
.dod-assist__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 639.98px) {
  .dod-assist-fab {
    right: 16px;
    bottom: 16px;
    padding: 0 16px 0 12px;
  }
  .dod-assist-fab .dod-assist-fab__long {
    display: none;
  }
  .dod-assist {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 88dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .dod-assist__form {
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
}

@media (min-width: 640px) {
  .dod-assist-fab .dod-assist-fab__short {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .dod-assist:not([hidden]) {
    animation: dod-assist-in 160ms ease-out;
  }
  @keyframes dod-assist-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }
}

@media print {
  .dod-assist-fab,
  .dod-assist {
    display: none !important;
  }
}
