.ai-chat-widget {
    /* Sports Factory brand palette: navy (#132F55) / hover blue (#00429d), matching .btn-brand and button[type=submit] */
    --ai-chat-brand: var(--main-primary, #132f55);
    --ai-chat-brand-border: var(--main-primary-border, #00429d);
    --ai-chat-brand-light: var(--main-primary-light, #e5edfa);
    --ai-chat-heading: var(--main-primary-heading, #253d4e);
    --ai-chat-accent: var(--main-primary-mouse-over, #81b13d);
    --ai-chat-edge: 22px;
    --ai-chat-mobile-edge: 16px;
    --ai-chat-whatsapp-size: 58px;
    --ai-chat-whatsapp-mobile-size: 52px;
    --ai-chat-widget-gap: 12px;
    position: fixed;
    inset-inline-end: calc(var(--ai-chat-edge) + var(--ai-chat-whatsapp-size) + var(--ai-chat-widget-gap));
    bottom: 24px;
    z-index: 10000;
    font-family: inherit;
    color: var(--ai-chat-heading);
    direction: inherit;
}

.ai-chat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    border: 0;
    border-radius: 999px;
    background: var(--ai-chat-brand);
    color: #ffffff;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(19, 47, 85, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    white-space: nowrap;
}

.ai-chat-toggle:hover,
.ai-chat-toggle:focus {
    color: #ffffff;
    background: var(--ai-chat-brand-border);
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(19, 47, 85, 0.38);
}

.ai-chat-toggle-icon {
    font-size: 18px;
    line-height: 1;
}

.ai-chat-panel {
    position: fixed;
    inset-inline-end: var(--ai-chat-edge);
    bottom: 96px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(37, 61, 78, 0.1);
    box-shadow: 0 22px 70px rgba(37, 61, 78, 0.26);
}

.ai-chat-panel.is-open {
    display: flex;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--ai-chat-brand), var(--ai-chat-brand-border));
    color: #ffffff;
}

.ai-chat-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.ai-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.92;
}

.ai-chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ai-chat-accent);
}

.ai-chat-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ai-chat-clear,
.ai-chat-close {
    border: 0;
    color: #ffffff;
    cursor: pointer;
}

.ai-chat-clear {
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 12px;
    font-weight: 700;
}

.ai-chat-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 22px;
    line-height: 1;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}

.ai-chat-message {
    display: flex;
    margin-bottom: 12px;
}

.ai-chat-message-user {
    justify-content: flex-end;
}

.ai-chat-message-assistant {
    justify-content: flex-start;
}

.ai-chat-bubble {
    max-width: 82%;
    border-radius: 18px;
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.5;
    text-align: start;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-chat-message-user .ai-chat-bubble {
    border-end-end-radius: 6px;
    background: var(--ai-chat-brand);
    color: #ffffff;
}

.ai-chat-message-assistant .ai-chat-bubble {
    border-end-start-radius: 6px;
    background: #ffffff;
    color: var(--ai-chat-heading);
    border: 1px solid rgba(37, 61, 78, 0.1);
}

.ai-chat-typing .ai-chat-bubble {
    color: #6b7280;
    font-style: italic;
}

.ai-chat-products {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 4px 0 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.ai-chat-products::-webkit-scrollbar {
    height: 6px;
}

.ai-chat-products::-webkit-scrollbar-thumb {
    background: rgba(37, 61, 78, 0.18);
    border-radius: 999px;
}

.ai-chat-product-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 168px;
    width: 168px;
    scroll-snap-align: start;
    padding: 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(37, 61, 78, 0.1);
    box-shadow: 0 6px 18px rgba(37, 61, 78, 0.06);
}

.ai-chat-product-image-wrap {
    width: 100%;
    min-width: 0;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

.ai-chat-product-image-wrap.is-empty {
    background: repeating-linear-gradient(
        -45deg,
        #f1f5f9,
        #f1f5f9 8px,
        #e5e7eb 8px,
        #e5e7eb 16px
    );
}

.ai-chat-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ai-chat-product-content {
    min-width: 0;
    flex: 1;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
}

.ai-chat-product-name {
    color: var(--ai-chat-heading);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    text-align: start;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-chat-product-meta {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    text-align: start;
}

.ai-chat-product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.ai-chat-product-price {
    color: var(--ai-chat-heading);
    font-size: 13px;
    font-weight: 900;
}

.ai-chat-product-stock {
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.ai-chat-product-stock.is-in-stock {
    background: var(--ai-chat-brand-light);
    color: var(--ai-chat-brand-border);
}

.ai-chat-product-stock.is-out-stock {
    background: #fee2e2;
    color: #991b1b;
}

.ai-chat-product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 9px;
}

.ai-chat-product-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    /* margin-top: 9px;
    width: 100%;
    min-height: 32px; */
    border-radius: 8px;
    background: var(--ai-chat-brand);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.ai-chat-product-button:hover {
    color: #ffffff;
    background: var(--ai-chat-brand-border);
    text-decoration: none;
}

.ai-chat-product-icon-button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    position: relative;
}

.ai-chat-product-icon-button svg {
    width: 16px;
    height: 16px;
}

.ai-chat-product-icon-button.is-loading svg {
    visibility: hidden;
}

.ai-chat-product-icon-button.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    animation: ai-chat-spin 0.6s linear infinite;
}

@keyframes ai-chat-spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-chat-product-add-button {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.ai-chat-product-add-button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.ai-chat-product-add-button.is-added {
    background: var(--ai-chat-accent);
}

.ai-chat-privacy {
    padding: 7px 14px;
    background: #ffffff;
    color: #6b7280;
    font-size: 11px;
    text-align: start;
    border-top: 1px solid rgba(37, 61, 78, 0.1);
}

.ai-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid rgba(37, 61, 78, 0.1);
}

.ai-chat-input {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 90px;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid rgba(37, 61, 78, 0.18);
    padding: 11px 12px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--ai-chat-heading);
    outline: none;
    text-align: start;
}

.ai-chat-input:focus {
    border-color: var(--ai-chat-brand);
    box-shadow: 0 0 0 3px rgba(19, 47, 85, 0.14);
}

.ai-chat-send {
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    background: var(--ai-chat-brand);
    color: #ffffff;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.ai-chat-send:hover,
.ai-chat-send:focus {
    background: var(--ai-chat-brand-border);
}

.ai-chat-send:disabled,
.ai-chat-input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media (max-width: 767px) {
    .ai-chat-widget {
        inset-inline-end: calc(var(--ai-chat-mobile-edge) + var(--ai-chat-whatsapp-mobile-size) + var(--ai-chat-widget-gap));
        bottom: 18px;
    }

    .ai-chat-toggle {
        min-height: 52px;
        padding: 0 15px;
    }

    .ai-chat-panel {
        inset-inline-end: var(--ai-chat-mobile-edge);
        bottom: 82px;
        width: calc(100vw - 32px);
        height: min(620px, calc(100vh - 108px));
        border-radius: 16px;
    }
}

@media (max-width: 420px) {
    .ai-chat-toggle-text {
        display: none;
    }

    .ai-chat-toggle {
        width: 52px;
        justify-content: center;
        padding: 0;
    }

    .ai-chat-bubble {
        max-width: 90%;
    }

    .ai-chat-product-card {
        flex: 0 0 142px;
        width: 142px;
    }

    .ai-chat-product-image-wrap {
        height: 92px;
    }
}

/* Product configuration */
.ai-chat-product-card {
    flex-basis: 232px;
    width: 232px;
}

.ai-chat-product-configuration {
    display: grid;
    gap: 8px;
    margin-top: 9px;
}

.ai-chat-product-field {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-align: start;
}

.ai-chat-product-select {
    width: 100%;
    min-height: 34px;
    border: 1px solid rgba(37, 61, 78, 0.18);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ai-chat-heading);
    padding: 6px 8px;
    font: inherit;
    font-size: 12px;
    outline: none;
}

.ai-chat-product-select:focus {
    border-color: var(--ai-chat-brand);
    box-shadow: 0 0 0 2px rgba(19, 47, 85, 0.12);
}

.ai-chat-product-quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.ai-chat-product-quantity-label {
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.ai-chat-quantity-controls {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(37, 61, 78, 0.16);
    border-radius: 8px;
    background: #ffffff;
}

.ai-chat-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    background: #f8fafc;
    color: var(--ai-chat-heading);
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}

.ai-chat-icon-button:hover:not(:disabled),
.ai-chat-icon-button:focus:not(:disabled) {
    background: var(--ai-chat-brand-light);
    color: var(--ai-chat-brand-border);
}

.ai-chat-icon-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.ai-chat-quantity-input {
    width: 42px;
    height: 30px;
    border: 0;
    border-inline: 1px solid rgba(37, 61, 78, 0.12);
    color: var(--ai-chat-heading);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.ai-chat-quantity-input::-webkit-outer-spin-button,
.ai-chat-quantity-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.ai-chat-inline-error {
    min-height: 0;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    text-align: start;
}

.ai-chat-inline-error:empty {
    display: none;
}

.ai-chat-product-view-button {
    background: #ffffff;
    color: var(--ai-chat-brand-border);
    border: 1px solid var(--ai-chat-brand-border);
}

.ai-chat-product-view-button:hover {
    background: var(--ai-chat-brand-light);
    color: var(--ai-chat-brand-border);
}

/* Structured cart */
.ai-chat-cart {
    width: 100%;
    margin: 4px 0 14px;
    overflow: hidden;
    border: 1px solid rgba(37, 61, 78, 0.11);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(37, 61, 78, 0.07);
    text-align: start;
}

.ai-chat-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    border-bottom: 1px solid rgba(37, 61, 78, 0.09);
    background: linear-gradient(135deg, var(--ai-chat-brand-light), #ffffff);
}

.ai-chat-cart-title {
    color: var(--ai-chat-heading);
    font-size: 14px;
    font-weight: 900;
}

.ai-chat-cart-count {
    border-radius: 999px;
    background: #ffffff;
    color: var(--ai-chat-brand-border);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
}

.ai-chat-cart-empty {
    padding: 18px 14px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.ai-chat-cart-item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid rgba(37, 61, 78, 0.08);
}

.ai-chat-cart-item-image-wrap {
    width: 62px;
    height: 62px;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f9;
}

.ai-chat-cart-item-image-wrap.is-empty {
    background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 7px, #e5e7eb 7px, #e5e7eb 14px);
}

.ai-chat-cart-item-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-chat-cart-item-body {
    min-width: 0;
}

.ai-chat-cart-item-name {
    display: block;
    color: var(--ai-chat-heading);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    text-decoration: none;
}

.ai-chat-cart-item-name:hover {
    color: var(--ai-chat-brand-border);
    text-decoration: none;
}

.ai-chat-cart-item-options,
.ai-chat-cart-item-pricing {
    margin-top: 4px;
    color: #64748b;
    font-size: 10px;
    line-height: 1.35;
}

.ai-chat-cart-item-pricing {
    color: #334155;
    font-weight: 700;
}

.ai-chat-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.ai-chat-cart-item-actions .ai-chat-icon-button {
    width: 27px;
    height: 27px;
    border: 1px solid rgba(37, 61, 78, 0.12);
    border-radius: 7px;
}

.ai-chat-cart-item-quantity {
    min-width: 24px;
    color: var(--ai-chat-heading);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.ai-chat-cart-remove {
    margin-inline-start: auto;
    border: 0;
    background: transparent;
    color: #b91c1c;
    padding: 4px 2px;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.ai-chat-cart-remove:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ai-chat-cart-summary {
    padding: 12px 13px 13px;
    background: #fbfdff;
}

.ai-chat-cart-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 11px;
}

.ai-chat-cart-summary-row.is-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(37, 61, 78, 0.16);
    color: var(--ai-chat-heading);
    font-size: 13px;
    font-weight: 900;
}

.ai-chat-cart-summary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 11px;
}

.ai-chat-cart-link,
.ai-chat-cart-clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 8px;
    padding: 7px 9px;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.ai-chat-cart-link.is-primary {
    border: 1px solid var(--ai-chat-brand);
    background: var(--ai-chat-brand);
    color: #ffffff;
}

.ai-chat-cart-link.is-secondary {
    border: 1px solid var(--ai-chat-brand-border);
    background: #ffffff;
    color: var(--ai-chat-brand-border);
}

.ai-chat-cart-clear-button {
    grid-column: 1 / -1;
    border: 1px solid #fecaca;
    background: #fff7f7;
    color: #b91c1c;
}

.ai-chat-cart-link:hover,
.ai-chat-cart-clear-button:hover {
    text-decoration: none;
    filter: brightness(0.98);
}

.ai-chat-cart-link[aria-disabled="true"],
.ai-chat-cart-clear-button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

@media (max-width: 420px) {
    .ai-chat-product-card {
        flex-basis: 210px;
        width: 210px;
    }

    .ai-chat-cart-item {
        grid-template-columns: 54px minmax(0, 1fr);
        padding: 10px;
    }

    .ai-chat-cart-item-image-wrap {
        width: 54px;
        height: 54px;
    }
}


/* ── Checkout card ─────────────────────────────────────────────────────────── */

.ai-chat-checkout {
    width: 100%;
    margin: 4px 0 14px;
    border: 1px solid rgba(37, 61, 78, 0.11);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(37, 61, 78, 0.07);
    text-align: start;
    overflow: hidden;
}

.ai-chat-checkout-header {
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--ai-chat-brand), var(--ai-chat-brand-border));
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.ai-chat-checkout-summary {
    padding: 7px 14px;
    background: var(--ai-chat-brand-light);
    color: var(--ai-chat-brand-border);
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid rgba(37, 61, 78, 0.07);
}

/* Body — padded wrapper for all form content */
.ai-chat-checkout-body {
    padding: 10px 14px 14px;
}

/* Section — visually groups related fields */
.ai-chat-checkout-section {
    margin-bottom: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(37, 61, 78, 0.07);
}

.ai-chat-checkout-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.ai-chat-checkout-section-title {
    margin-bottom: 8px;
    color: var(--ai-chat-heading);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
}

/* Two-column row (first name / last name, email / phone) */
.ai-chat-checkout-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ai-chat-checkout-row .ai-chat-checkout-field {
    margin-bottom: 0;
}

/* Individual field */
.ai-chat-checkout-field {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
}

.ai-chat-checkout-field:last-child {
    margin-bottom: 0;
}

.ai-chat-checkout-label {
    color: var(--ai-chat-heading);
    font-size: 11px;
    font-weight: 700;
    text-align: start;
    opacity: 0.85;
}

/* Inputs and selects */
.ai-chat-checkout-input,
.ai-chat-checkout-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(37, 61, 78, 0.18);
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    color: var(--ai-chat-heading);
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}

.ai-chat-checkout-input:focus,
.ai-chat-checkout-select:focus {
    border-color: var(--ai-chat-brand);
    box-shadow: 0 0 0 3px var(--ai-chat-brand-light);
}

.ai-chat-checkout-input::placeholder {
    color: #9ca3af;
}

/* Saved-address select (full width inside addr section) */
.ai-chat-checkout-section > .ai-chat-checkout-select {
    display: block;
    width: 100%;
}

/* Gateway / card-type radio pill cards */
.ai-chat-gw-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-chat-gw-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 72px;
    padding: 7px 12px;
    border: 1.5px solid rgba(37, 61, 78, 0.15);
    border-radius: 8px;
    background: #fff;
    color: var(--ai-chat-heading);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, color 0.18s;
    user-select: none;
}

.ai-chat-gw-card:hover {
    border-color: var(--ai-chat-brand);
    background: var(--ai-chat-brand-light);
}

.ai-chat-gw-card.is-selected {
    border-color: var(--ai-chat-brand);
    background: var(--ai-chat-brand-light);
    color: var(--ai-chat-brand-border);
    font-weight: 700;
}

.ai-chat-gw-card-radio {
    /* Accessible but visually hidden */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.ai-chat-gw-card-name {
    pointer-events: none;
    line-height: 1.2;
}

/* Error area */
.ai-chat-checkout-error {
    margin-top: 8px;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
    min-height: 0;
    text-align: start;
    line-height: 1.4;
}

.ai-chat-checkout-error:empty {
    display: none;
}

/* Place Order button */
.ai-chat-checkout-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    background: var(--ai-chat-brand);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.18s, opacity 0.18s;
}

.ai-chat-checkout-btn:not(:disabled):hover {
    background: var(--ai-chat-brand-border);
    color: #ffffff;
    text-decoration: none;
}

.ai-chat-checkout-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Result card (after order placed) */
.ai-chat-checkout-result {
    /* inherits .ai-chat-checkout, just content changes */
}

.ai-chat-checkout-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    color: var(--ai-chat-brand-border);
    font-size: 14px;
    font-weight: 800;
}

.ai-chat-checkout-note {
    padding: 10px 14px 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

.ai-chat-checkout-btn-pay {
    display: block;
    margin: 10px 14px 14px;
    padding: 11px;
    background: var(--ai-chat-brand);
    color: #ffffff;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background 0.18s;
    width: calc(100% - 28px);
    box-sizing: border-box;
}

.ai-chat-checkout-btn-pay:hover {
    background: var(--ai-chat-brand-border);
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 420px) {
    .ai-chat-checkout-row {
        grid-template-columns: 1fr;
    }

    .ai-chat-gw-card {
        flex-basis: calc(50% - 3px);
    }
}
