/* Chat ordering («اطلب بالدردشة»): the floating button and the chat window. Loaded only when the store's switch is on. */
.co-fab { position: fixed; inset-inline-start: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 1040; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; border: 0; border-radius: 23px;
  background: var(--theme-color, #30b6c5); color: #fff; font: 600 14px/1 'Noto Sans Arabic', Tahoma, sans-serif; box-shadow: 0 8px 22px rgba(15, 23, 42, .22); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.co-fab--above { bottom: calc(140px + env(safe-area-inset-bottom)); }
.co-fab svg { width: 20px; height: 20px; }
html.co-open .co-fab, html.vo-open .co-fab, html.co-open .vo-fab { display: none; }
.co-modal { position: fixed; top: 0; left: 0; right: 0; height: 100%; z-index: 2147482000; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .5); font-family: 'Noto Sans Arabic', Tahoma, sans-serif; }
.co-modal[hidden] { display: none; }
/* everything hidden inside the window stays hidden, whatever display the site's own stylesheet gives the tag */
.co-modal [hidden] { display: none !important; }
.co-sheet { box-sizing: border-box; width: 100%; max-width: 520px; height: min(720px, 94%); display: flex; flex-direction: column; padding: 14px 14px calc(12px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #fff; color: #0f172a; }
.co-head { flex: none; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.co-head h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 700; line-height: 1.6; }
.co-new { height: 34px; padding: 0 12px; border: 0; border-radius: 17px; background: #f1f5f9; color: #334155; font: 600 12.5px/1 'Noto Sans Arabic', Tahoma, sans-serif; cursor: pointer; }
.co-x { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #475569; cursor: pointer; }
.co-x svg { width: 16px; height: 16px; }
.co-talk { flex: 1; min-height: 56px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px; }
.co-line { max-width: 86%; margin: 0; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.co-line--assistant { align-self: flex-start; background: #f1f5f9; color: #0f172a; border-start-start-radius: 6px; }
.co-line--user { align-self: flex-end; background: var(--theme-color, #30b6c5); color: #fff; border-start-end-radius: 6px; }
.co-choices { align-self: stretch; display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 4px; }
.co-choice { max-width: 100%; min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--theme-color, #30b6c5); border-radius: 20px; background: #fff; color: #0f172a; font: 600 14px/1.6 'Noto Sans Arabic', Tahoma, sans-serif; text-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.co-choice:active { background: #e6f6f8; }
.co-line--wait { display: inline-flex; gap: 5px; align-items: center; min-height: 26px; }
.co-line--wait i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: co-wait 1.1s ease-in-out infinite; }
.co-line--wait i:nth-child(2) { animation-delay: .18s; }
.co-line--wait i:nth-child(3) { animation-delay: .36s; }
@keyframes co-wait { 0%, 70%, 100% { transform: translateY(0); opacity: .5; } 35% { transform: translateY(-4px); opacity: 1; } }
/* the card never hides its buttons: when the order is long, only its list of lines scrolls */
.co-draft { flex: 0 1 auto; min-height: 0; max-height: 64%; display: flex; flex-direction: column; margin-top: 8px; padding: 12px 14px; border-radius: 16px; background: #f5f6f8; }
.co-draft > * { flex: none; }
.co-draft h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; line-height: 1.7; }
.co-draft-store { margin: 0 0 6px; font-size: 13px; color: #64748b; }
.co-draft > .co-draft-lines { flex: 0 1 auto; min-height: 38px; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.co-draft-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid #e6eaee; font-size: 14px; line-height: 1.7; }
.co-draft-lines li:first-child { border-top: 0; }
.co-draft-lines li span:last-child { flex: none; color: #334155; }
.co-draft-total { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid #e6eaee; font-size: 14px; font-weight: 700; }
.co-draft-more, .co-draft-note { margin: 4px 0 0; font-size: 12.5px; line-height: 1.7; color: #64748b; }
.co-draft-send { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid #e6eaee; font-size: 14px; font-weight: 700; line-height: 1.7; }
.co-draft-send span { display: block; font-weight: 400; font-size: 13px; color: #475569; }
.co-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* the send button takes a row of its own; «أضفه للسلة» and «إلغاء» share the next */
.co-draft-actions .co-btn--wide { flex: 1 0 100%; }
.co-btn { flex: 1; min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; background: #e9edf2; color: #0f172a; font: 600 15px/1 'Noto Sans Arabic', Tahoma, sans-serif; cursor: pointer; }
.co-btn:disabled { opacity: .6; cursor: default; }
.co-btn--main { background: var(--theme-color, #30b6c5); color: #fff; }
.co-status { flex: none; margin: 6px 2px 0; font-size: 13px; line-height: 1.7; color: #64748b; }
.co-status:empty { display: none; }
.co-status[data-kind="error"] { color: #b3261e; }
.co-form { flex: none; display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
/* 16px: a smaller font makes the iPhone zoom the page when the box is tapped */
.co-input { flex: 1; box-sizing: border-box; min-height: 46px; max-height: 120px; padding: 10px 14px; border: 1.5px solid #e2e8f0; border-radius: 16px; background: #fff; color: #0f172a; font: 400 16px/1.6 'Noto Sans Arabic', Tahoma, sans-serif; resize: none; outline: none; }
.co-input:focus { border-color: var(--theme-color, #30b6c5); }
.co-input:disabled { background: #f8fafc; }
.co-send { flex: none; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--theme-color, #30b6c5); color: #fff; cursor: pointer; }
.co-send svg { width: 20px; height: 20px; }
.co-send:disabled { opacity: .5; cursor: default; }
html.dark-mode .co-sheet { background: var(--dm-bg, #26262e); color: #edf1f3; }
html.dark-mode .co-new, html.dark-mode .co-x, html.dark-mode .co-btn, html.dark-mode .co-line--assistant, html.dark-mode .co-draft { background: var(--dm-surface, #33333d); color: #edf1f3; }
html.dark-mode .co-status, html.dark-mode .co-draft-store, html.dark-mode .co-draft-more, html.dark-mode .co-draft-note, html.dark-mode .co-draft-lines li span:last-child { color: #a3adb5; }
html.dark-mode .co-status[data-kind="error"] { color: #ff9d92; }
html.dark-mode .co-draft-lines li, html.dark-mode .co-draft-total, html.dark-mode .co-draft-send { border-color: #45464f; }
html.dark-mode .co-draft-send span { color: #a3adb5; }
html.dark-mode .co-btn--main, html.dark-mode .co-line--user { background: var(--theme-color, #30b6c5); color: #fff; }
html.dark-mode .co-choice { background: transparent; color: #edf1f3; }
html.dark-mode .co-input { background: var(--dm-surface, #33333d); border-color: #45464f; color: #edf1f3; }
@media (min-width: 700px) { .co-modal { align-items: center; } .co-sheet { border-radius: 22px; } }
@media (prefers-reduced-motion: reduce) { .co-line--wait i { animation: none; } }
