/*
 * Bay, the OndjangoBay virtual assistant: the panel shell (BAY-01.3) and its
 * response components (BAY-01.4: cards, forms, the confirm, notices).
 *
 * Markup: resources/views/partials/bay-panel.blade.php. Behaviour: bay-panel.js.
 * Plain CSS, loaded with asset_v() (Vite cannot rebuild in this project).
 *
 * The panel wears the support bubble's own classes, which ship in custom.css
 * (.ondjangobay-chatbot-container / -toggle / -box / -header / -close / -messages),
 * so it looks like the bubble it replaces. This file only adds what the shell
 * needs on top: the hidden attribute as the single show/hide switch, the Bay
 * message and option styles, the notices and commands, visible focus, and the
 * full-height panel below 480px.
 */

/* Stacking order along the bottom of the storefront (agreed with DI-01.2's
   partials/consent-banner, whose .ob-consent is z-index 10000):

     the page and its own overlays
       < the closed Bay bubble        9999   (custom.css .ondjangobay-chatbot-container)
       < the consent banner          10000   (it must not hide under a bubble nobody opened)
       < the OPEN Bay dialog          10001   (bay-panel.js sets .bay-panel--open)

   The visitor opened Bay on purpose and it is a modal dialog (aria-modal), so while it
   is open nothing may cover its Retry, options, Back or Restart; on a phone the panel
   is full height. Closing Bay drops it back below the banner, which is still waiting
   for its answer. */
.bay-panel.bay-panel--open {
    z-index: 10001;
}

/* One switch for showing and hiding: the hidden attribute. custom.css gives
   .ondjangobay-chatbot-box display:none, so an open dialog must say flex. */
.bay-panel [hidden] {
    display: none !important;
}

.bay-panel .bay-panel__dialog:not([hidden]) {
    display: flex;
}

.bay-panel__bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.bay-panel__icon {
    display: block;
}

.bay-panel__dialog {
    position: relative;
    max-height: calc(100vh - 40px);
    font-size: 14px;
    color: #1f2937;
}

.bay-panel__dialog:focus {
    outline: none;
}

.bay-panel__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ messages */

.bay-panel__messages {
    min-height: 0;
}

.bay-msg {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 14px;
    line-height: 1.45;
    white-space: pre-line;          /* text arrives as text: keep its line breaks */
    overflow-wrap: anywhere;
    animation: ondjangobay-slideIn 0.25s ease;
}

.bay-msg--bot,
.bay-msg--agent {
    align-self: flex-start;
    background: #e9f3ff;
    color: #1f2937;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bay-msg--agent {
    background: #fff4e5;
}

.bay-msg--customer {
    align-self: flex-end;
    background: #f99e1c;
    color: #111827;
}

.bay-msg--system {
    align-self: center;
    max-width: 95%;
    background: transparent;
    color: #4b5563;
    font-size: 12.5px;
    text-align: center;
    box-shadow: none;
}

/* ------------------------------------------------------------------ options */

.bay-panel__options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px;
    background: #f9f9f9;
}

.bay-panel__options:not(:empty) {
    padding-bottom: 10px;
}

.bay-panel__option {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #f99e1c;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bay-panel__option:hover:not([disabled]) {
    background: #fff4e5;
}

.bay-panel__option[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* ------------------------------------------------------------------ notices and commands */

.bay-panel__notice {
    padding: 8px 12px;
    background: #f9f9f9;
    color: #4b5563;
    font-size: 12.5px;
}

.bay-panel__notice--alert {
    color: #b42318;
}

.bay-panel__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.bay-panel__footer:not(:has(> :not([hidden]))) {
    display: none;
}

.bay-panel__command {
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: #f1f1f1;
    color: #1f2937;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.bay-panel__command[disabled] {
    opacity: 0.6;
    cursor: default;
}

.bay-panel__command--end {
    margin-left: auto;
}

/* ------------------------------------------------------------------ live chat (BAY-11.2) */

.bay-panel__bubble {
    position: relative;
}

.bay-panel__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

.bay-panel__badge[hidden] {
    display: none;
}

.bay-panel__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bay-panel__composer {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    padding: 8px 12px;
    border-top: 1px solid #e5e7eb;
}

.bay-panel__composer[hidden] {
    display: none;
}

.bay-panel__composer-input {
    flex: 1 1 auto;
    min-width: 0;
    max-height: 120px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    resize: vertical;
}

.bay-panel__composer-send {
    flex: 0 0 auto;
}

.bay-msg--agent {
    white-space: pre-wrap;
}

.bay-panel__noscript {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 20px;
    background: #f99e1c;
    color: #111827;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

/* ------------------------------------------------------------------ response components (BAY-01.4)

   Cards, forms, the confirm and the action links sit inside the conversation
   (the messages log, a flex column); notices sit above the options. Every word in
   them arrives from the server: nothing here prints text. */

.bay-card,
.bay-form,
.bay-confirm,
.bay-actions {
    align-self: stretch;
    max-width: 100%;
    animation: ondjangobay-slideIn 0.25s ease;
}

.bay-card {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    line-height: 1.4;
}

.bay-card__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin-bottom: 6px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.bay-card__caption {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
}

.bay-card__text {
    margin: 0 0 8px;
    color: #374151;
}

.bay-card__list {
    margin: 0;
}

.bay-card__list:empty {
    display: none;
}

.bay-card__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border-top: 1px dashed #eef0f3;
}

.bay-card__row:first-child {
    border-top: 0;
}

.bay-card__label {
    flex: 0 1 auto;
    margin: 0;
    color: #6b7280;
    font-size: 12.5px;
}

.bay-card__value {
    flex: 1 1 auto;
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.bay-card__row--amount .bay-card__value {
    font-weight: 600;
    white-space: nowrap;           /* a printed amount never breaks between the number and "Kz" */
}

.bay-card__row--status .bay-card__value {
    font-weight: 600;
}

.bay-card__actions,
.bay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
}

.bay-card__actions {
    margin-top: 8px;
}

.bay-link {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bay-card__select,
.bay-action,
.bay-confirm__option,
.bay-form__submit {
    padding: 7px 12px;
    border: 1px solid #f99e1c;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    cursor: pointer;
}

a.bay-action {
    padding: 7px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #b45309;
}

.bay-card__select:hover:not([disabled]),
.bay-action:hover:not([disabled]),
.bay-confirm__option:hover:not([disabled]) {
    background: #fff4e5;
}

.bay-form__submit {
    border-color: #f99e1c;
    background: #f99e1c;
    color: #111827;
    font-weight: 600;
}

.bay-card__select[disabled],
.bay-action[disabled],
.bay-confirm__option[disabled],
.bay-form__submit[disabled],
.bay-form__input[disabled] {
    opacity: 0.6;
    cursor: default;
}

/* A form inside the conversation (§3.1): one field is one line with its Send button. */
.bay-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.bay-form--inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}

.bay-form--inline .bay-form__field {
    flex: 1 1 160px;
    min-width: 0;
}

.bay-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bay-form__label {
    color: #374151;
    font-size: 12.5px;
    font-weight: 600;
}

.bay-form__input {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 16px;               /* below 16px iOS zooms the page on focus */
    box-sizing: border-box;
}

textarea.bay-form__input {
    min-height: 76px;
    resize: vertical;
}

.bay-form__input[aria-invalid="true"] {
    border-color: #b42318;
}

.bay-form__help {
    color: #6b7280;
    font-size: 12px;
}

.bay-form__error {
    color: #b42318;
    font-size: 12.5px;
}

.bay-form--inline .bay-form__submit {
    align-self: flex-end;
    min-height: 38px;
}

/* "Did this solve your issue?" */
.bay-confirm {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bay-confirm__prompt {
    align-self: flex-start;
    max-width: 85%;
    margin: 0;
    padding: 9px 13px;
    border-radius: 14px;
    background: #e9f3ff;
    color: #1f2937;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.bay-confirm__options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Notices above the options: the queue, the inactivity countdown. */
.bay-panel__notices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px;
    background: #f9f9f9;
}

.bay-panel__notices:not(:empty) {
    padding-bottom: 8px;
}

.bay-notice {
    padding: 8px 10px;
    border-left: 3px solid #1d4ed8;
    border-radius: 8px;
    background: #eef4ff;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.4;
}

.bay-notice--inactivity {
    border-left-color: #b45309;
    background: #fff7ed;
}

.bay-notice__countdown {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    font-weight: 600;
}

.bay-notice__time {
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ keyboard focus */

.bay-panel button:focus-visible,
.bay-panel a:focus-visible,
.bay-panel input:focus-visible,
.bay-panel select:focus-visible,
.bay-panel textarea:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ small screens: full height */

@media (max-width: 479.98px) {
    .bay-panel .bay-panel__dialog {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bay-panel .bay-panel__dialog,
    .bay-msg,
    .bay-card,
    .bay-form,
    .bay-confirm,
    .bay-actions {
        animation: none;
    }
}

/* BAY-12.1 (§12): the button on a notice ("I'm still here", "Continue where I left off"). */
.bay-notice__button {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bay-notice__button:disabled {
    opacity: .6;
    cursor: default;
}


/* ------------------------------------------------------------------ g41: Bey is the chat button (client deck "Bring Bey back", 01-10-2026)
   Mascot in its own shape (not cropped), no orange bubble behind it, fixed bottom-right 24 px (16 px mobile),
   ~64 px desktop / 56 px mobile, slight lift on hover, small orange unread badge on Bey's top-right,
   hidden while the cart drawer or a modal is open. */
.ondjangobay-chatbot-container:has(#bay-panel-bubble) { right: 24px; bottom: 24px; }
#bay-panel-bubble.bay-panel__bubble {
    width: 64px; height: 64px; padding: 0; border: 0; border-radius: 0;
    background: transparent; box-shadow: none; font-size: 0; line-height: 0;
    transition: transform .18s ease;
}
#bay-panel-bubble.bay-panel__bubble:hover { transform: translateY(-3px); box-shadow: none; }
#bay-panel-bubble:focus-visible { outline: 3px solid #F99E1C; outline-offset: 2px; border-radius: 50%; }
.bay-panel__bey { width: 64px; height: 64px; object-fit: contain; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .22)); }
.bay-panel__bey-head { width: 22px; height: 22px; vertical-align: middle; margin-right: 6px; object-fit: contain; }
#bay-panel-bubble .bay-panel__badge { top: -2px; right: -2px; background: #F99E1C; color: #161616; }
body:has(.cart-dropdown.opened) #bay-panel-bubble,
body:has(.modal.show) #bay-panel-bubble { display: none !important; }
@media (max-width: 767px) {
    .ondjangobay-chatbot-container:has(#bay-panel-bubble) { right: 16px; bottom: 16px; }
    #bay-panel-bubble.bay-panel__bubble, .bay-panel__bey { width: 56px; height: 56px; }
}


/* ------------------------------------------------------------------ g55 (client QA deck "Chat & Customer Support", 02-10-2026) */

/* A roomier panel on a wide screen: the whole conversation now stays in it (BUG-003). */
@media (min-width: 480px) {
    .bay-panel .bay-panel__dialog {
        width: 360px;
        height: min(620px, calc(100vh - 110px));
    }
}

/* BUG-015: every bubble says when; the customer's lines to the team say Sent / Seen. */
.bay-msg__text {
    display: block;
}

.bay-msg__meta {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
    opacity: .72;
    text-align: right;
}

.bay-msg--bot .bay-msg__meta,
.bay-msg--agent .bay-msg__meta {
    text-align: left;
}

.bay-msg__meta[data-bay-status="read"] {
    opacity: .9;
    font-weight: 600;
}

/* BUG-009: photos as thumbnails. */
.bay-msg__photo {
    display: block;
    margin-top: 6px;
}

.bay-msg__photo img {
    display: block;
    max-width: 180px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

/* BUG-002: the long first menu in two columns (one on a phone); a person and «write» stand out. */
.bay-panel__options--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 44vh;
    overflow-y: auto;
}

.bay-panel__options--grid .bay-panel__option {
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.25;
}

@media (max-width: 359.98px) {
    .bay-panel__options--grid {
        grid-template-columns: 1fr;
    }
}

.bay-panel__option--person {
    background: #f99e1c;
    color: #111827;
    font-weight: 600;
}

.bay-panel__option--person:hover:not([disabled]) {
    background: #f7a93d;
}

.bay-panel__option--write {
    border-style: dashed;
}

/* The composer: text box, «Foto», «Enviar». */
.bay-panel__composer {
    flex-wrap: wrap;
}

.bay-panel__composer-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bay-panel__composer-attach {
    white-space: nowrap;
}

/* BUG-011: the guest's «follow without signing in» form has a title. */
.bay-form__title {
    color: #1f2937;
    font-weight: 600;
}

.bay-notice--closed {
    border-left-color: #6b7280;
    background: #f3f4f6;
}

/* BUG-030: on the seller dashboard the storefront's custom.css is not loaded — the panel brings
   the base look of the bubble's classes itself (same values as custom.css). */
.bay-panel[data-surface="vendor"].ondjangobay-chatbot-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1060;
    font-family: "Segoe UI", Arial, sans-serif;
}

.bay-panel[data-surface="vendor"] .ondjangobay-chatbot-box {
    flex-direction: column;   /* shown and hidden by the hidden attribute only (see the top of this file) */
    width: 360px;
    height: min(620px, calc(100vh - 110px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
    margin-bottom: 12px;
    overflow: hidden;
}

.bay-panel[data-surface="vendor"] .ondjangobay-chatbot-header {
    background: linear-gradient(135deg, #f99e1c, #000);
    color: #fff;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bay-panel[data-surface="vendor"] .ondjangobay-chatbot-close {
    background: rgba(255, 255, 255, .2);
    border: none;
    color: #fff;
    font-size: 22px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 1;
    cursor: pointer;
}

.bay-panel[data-surface="vendor"] .ondjangobay-chatbot-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9f9;
}

.bay-panel[data-surface="vendor"] .bay-panel__bubble {
    cursor: pointer;
}

@media (max-width: 479.98px) {
    .bay-panel[data-surface="vendor"].ondjangobay-chatbot-container { right: 16px; bottom: 16px; }
    .bay-panel[data-surface="vendor"] .bay-panel__dialog { width: 100%; height: 100%; height: 100dvh; margin: 0; border-radius: 0; }
}

@keyframes ondjangobay-slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------ g92 (client deck "Bay chat", 08-10-2026) */

/* The conversation keeps at least half of the panel; the topics scroll (or fold, bay-panel.js) below it. */
.bay-panel .bay-panel__messages {
    flex: 1 1 0%;
    min-height: 50%;
}

.bay-panel .bay-panel__options {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-top: 8px;
}

.bay-panel .bay-panel__options--grid {
    max-height: none;
}

.bay-panel .bay-panel__options--grid .bay-panel__option {
    padding: 7px 10px;
    min-height: 40px;
}

/* «Tópicos ▾»: one row after the first choice. */
.bay-panel__topics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #f99e1c;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bay-panel__topics:hover {
    background: #fff4e5;
}

.bay-panel__topics:focus-visible,
.bay-panel__chip-remove:focus-visible,
.bay-panel__confirm .bay-panel__command:focus-visible {
    outline: 3px solid #f99e1c;
    outline-offset: 2px;
}

.bay-panel__topics-caret {
    font-size: 15px;
    color: #6b7280;
}

.bay-panel__topics-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bay-panel__topics-list.bay-panel__options--grid {
    display: grid;
}

/* The locked bar while Bay helps: says when writing opens (no disabled box that looks broken). */
.bay-panel__locked {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.bay-panel__locked-text {
    display: block;
    padding: 7px 12px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

/* Waiting for an operator: photos active, text still locked. */
.bay-panel__waiting {
    flex: 0 0 100%;
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.bay-panel__locked-inline {
    flex: 1 1 0%;
    align-self: stretch;
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 8px 10px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
    color: #4b5563;
    font-size: 12.5px;
    line-height: 1.35;
}

.bay-panel__composer-actions .bay-panel__command {
    min-height: 36px;
}

.bay-panel__composer-send:not([disabled]) {
    background: #f99e1c;
    color: #111827;
    font-weight: 600;
}

/* A photo picked, sent with «Enviar» (or why it cannot be). */
.bay-panel__chip {
    flex: 0 0 100%;
    order: 9;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 10px;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #7c2d12;
    font-size: 12.5px;
    line-height: 1.3;
}

.bay-panel__chip--error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.bay-panel__chip-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bay-panel__chip--error .bay-panel__chip-text {
    white-space: normal;
}

.bay-panel__chip-remove {
    flex: 0 0 auto;
    width: 40px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* «Começar uma nova conversa?» — only when there is a conversation with the team.
   g102 (= g100 on dev): in the flow, in the composer's place (it was an absolute sheet that covered the text box,
   «Foto» and «Enviar»). */
.bay-panel__confirm {
    position: relative;
    flex: 0 0 auto;
    z-index: 2;
    box-shadow: 0 -8px 18px rgba(17, 24, 39, 0.12);
    padding: 12px;
    border-top: 1px solid #fde68a;
    background: #fffbeb;
}

.bay-panel__confirm-text {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
}

.bay-panel__confirm-hint {
    margin: 2px 0 8px;
    color: #4b5563;
    font-size: 12.5px;
}

.bay-panel__confirm-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.bay-panel__confirm .bay-panel__command {
    min-height: 36px;
}

.bay-panel__confirm-yes {
    background: #f99e1c;
    color: #111827;
    font-weight: 600;
}

/* Cart and checkout: the panel opens only from the bubble, bottom-LEFT and narrower, so the
   totals and «Finalizar compra» on the right stay visible. */
@media (min-width: 768px) {
    .bay-panel.bay-panel--quiet.bay-panel--open.ondjangobay-chatbot-container,
    .bay-panel.bay-panel--quiet.bay-panel--open.ondjangobay-chatbot-container:has(#bay-panel-bubble) {
        right: auto;
        left: 24px;
    }

    .bay-panel.bay-panel--quiet .bay-panel__dialog {
        width: 340px;
    }
}

/* A wide screen: a slightly taller panel and compact rows, so the conversation keeps half of it and the
   whole first menu (with «Falar com uma pessoa») still fits without scrolling. */
@media (min-width: 480px) {
    .bay-panel .bay-panel__dialog,
    .bay-panel[data-surface="vendor"] .ondjangobay-chatbot-box {
        height: min(700px, calc(100vh - 100px));
    }

    .bay-panel .bay-panel__options--grid .bay-panel__option,
    .bay-panel .bay-panel__topics {
        min-height: 36px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .bay-panel .bay-panel__footer {
        padding: 6px 12px;
    }
}

/* g102: while «Começar uma nova conversa?» is open, the composer and the footer step aside (Cancelar brings them back). */
.bay-panel .bay-panel__dialog:has(.bay-panel__confirm:not([hidden])) [data-bay-live="form"],
.bay-panel .bay-panel__dialog:has(.bay-panel__confirm:not([hidden])) .bay-panel__footer {
    display: none;
}

/* ================================================================= buyer QA
   audit, 28-10-2026 — F6, for the Bay launcher.

   config('bay_triage.enabled') is true, so the bubble on screen is
   #bay-panel-bubble from partials/bay-panel, and THIS file is loaded from that
   partial — i.e. after custom.css. The g41 block above sets
   `bottom:16px` at max-width:767px, which is what put the launcher inside the
   mobile bottom nav (.sticky-footer from layouts/bottom_footer), over
   "Pesquisar" at 375px. --odb-bottomnav-h is defined in custom.css; the
   fallback keeps this rule honest if that file is ever loaded differently.
   ========================================================================= */
@media (max-width: 767px) {
    body:has(.sticky-footer) .ondjangobay-chatbot-container:has(#bay-panel-bubble) {
        bottom: calc(var(--odb-bottomnav-h, 69px) + 16px);
    }
}

/* F6, second half — the launcher over the Pay button on cart and checkout.
   bay-panel.js adds .bay-panel--quiet on /cart and /checkout; the g92 rule
   above already moves the OPEN panel bottom-left there "so the totals and
   «Finalizar compra» on the right stay visible". The closed launcher was left
   bottom-right and at 768px it still clipped the edge of the Pay button, so it
   now follows the same decision: smaller, and on the left from 768px up.
   44px is the minimum that is still a real tap target. */
.bay-panel--quiet #bay-panel-bubble.bay-panel__bubble,
.bay-panel--quiet #bay-panel-bubble .bay-panel__bey {
    width: 44px;
    height: 44px;
}
@media (min-width: 768px) {
    .bay-panel.bay-panel--quiet.ondjangobay-chatbot-container,
    .bay-panel.bay-panel--quiet.ondjangobay-chatbot-container:has(#bay-panel-bubble) {
        right: auto;
        left: 24px;
    }
}
