/**
 * T&T Jewelry AI Advisor — Styles
 * BEM: tt-aiv-*  |  Luxury Gold  |  Mobile-first
 */

/* ── FAB vertical alignment — single source of truth ── */
.tt-back-to-top,
.tt-aiv-bubble,
.tt-sa-toc-fab {
    right: var(--fab-right, 20px) !important;
    width: var(--fab-size, 54px) !important;
    height: var(--fab-size, 54px) !important;
}
.tt-back-to-top {
    bottom: var(--fab-bottom, 20px) !important;
    border-radius: 50% !important;
}
.tt-back-to-top svg {
    width: 24px !important;
    height: 24px !important;
}

/* ══════════════════════════════════════════════
 * BUBBLE — Luxury Gold FAB
 * ══════════════════════════════════════════════ */

.tt-aiv-bubble {
    position: fixed;
    bottom: calc(var(--fab-bottom, 20px) + var(--fab-size, 54px) + var(--fab-gap, 12px));
    right: var(--fab-right, 20px);
    z-index: 999991;
    width: var(--fab-size, 54px);
    height: var(--fab-size, 54px);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 30%, #2a2824, #1e1c18 50%, #161412);
    border: 1.5px solid #c9a96e;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.35),
                0 2px 8px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(201, 169, 110, 0.15);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 250ms ease,
                opacity 300ms ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.tt-aiv-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 32px rgba(201, 169, 110, 0.5),
                0 2px 12px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(245, 213, 140, 0.2);
}

.tt-aiv-bubble:active {
    transform: scale(0.95);
}

.tt-aiv-bubble--hidden {
    display: none;
}

.tt-aiv-bubble__icon {
    width: calc(var(--fab-size, 54px) * 0.85);
    height: calc(var(--fab-size, 54px) * 0.85);
    flex-shrink: 0;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 1px 2px rgba(201, 169, 110, 0.3));
}

.tt-aiv-bubble__bell {
    width: calc(var(--fab-size, 54px) * 0.6);
    height: calc(var(--fab-size, 54px) * 0.6);
    flex-shrink: 0;
    animation: ttAivBellRing 4s ease-in-out infinite;
    transform-origin: 50% 25%;
    filter: drop-shadow(0 1px 3px rgba(201, 169, 110, 0.5));
}

.tt-aiv-bubble:hover .tt-aiv-bubble__bell {
    animation: ttAivBellHit 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes ttAivBellRing {
    0%, 80%, 100% { transform: rotate(0deg); }
    84% { transform: rotate(8deg); }
    88% { transform: rotate(-8deg); }
    92% { transform: rotate(5deg); }
    96% { transform: rotate(-3deg); }
}

@keyframes ttAivBellHit {
    0% { transform: rotate(0deg) scale(1); }
    10% { transform: rotate(14deg) scale(1.1); }
    20% { transform: rotate(-12deg) scale(1.1); }
    30% { transform: rotate(10deg) scale(1.05); }
    40% { transform: rotate(-8deg) scale(1.05); }
    50% { transform: rotate(5deg) scale(1); }
    60% { transform: rotate(-3deg); }
    70% { transform: rotate(2deg); }
    100% { transform: rotate(0deg); }
}

/* ── Breathing Glow — Apple Watch style ── */

.tt-aiv-bubble__glow {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 110, 0.3) 0%, transparent 70%);
    animation: ttAivBreathe 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ttAivBreathe {
    0%, 100% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1.6); opacity: 0; }
}

.tt-aiv-bubble__pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid rgba(201, 169, 110, 0.3);
    animation: ttAivPulse 4s ease-in-out infinite 1s;
    pointer-events: none;
}

@keyframes ttAivPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.4); opacity: 0; }
}

/* ── Notification Badge — pulsing dot ── */

.tt-aiv-bubble__badge {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    border: 2.5px solid #fff;
    z-index: 2;
    animation: ttAivBadgePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    pointer-events: none;
}

.tt-aiv-bubble__badge::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.4);
    animation: ttAivBadgeRipple 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ttAivBadgePing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes ttAivBadgeRipple {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* ══════════════════════════════════════════════
 * PREVIEW — Teaser speech bubble
 * ══════════════════════════════════════════════ */

.tt-aiv-preview {
    position: fixed;
    bottom: calc(var(--fab-bottom, 20px) + (var(--fab-size, 54px) * 2) + (var(--fab-gap, 12px) * 2) + 8px);
    right: var(--fab-right, 20px);
    z-index: 999990;
    max-width: 250px;
    padding: 10px 28px 10px 14px;
    background: #1a1a18;
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 12px;
    color: #e8e0d0;
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 350ms ease, transform 400ms cubic-bezier(0.34, 1.4, 0.64, 1);
    pointer-events: none;
    cursor: pointer;
}

.tt-aiv-preview__tail {
    position: absolute;
    bottom: -8px;
    right: 22px;
    width: 16px;
    height: 8px;
    overflow: hidden;
}

.tt-aiv-preview__tail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translateX(-50%) rotate(45deg);
    background: #1a1a18;
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-top: none;
    border-left: none;
}

.tt-aiv-preview--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.tt-aiv-preview__content {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.tt-aiv-preview__text {
    flex: 1;
    min-width: 0;
}

.tt-aiv-preview__close {
    position: absolute;
    top: 2px;
    right: 6px;
    background: none;
    border: none;
    color: rgba(201, 169, 110, 0.5);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
    transition: color 200ms ease;
}

.tt-aiv-preview__close:hover {
    color: #c9a96e;
}

body.tt-aiv-open .tt-aiv-preview {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ══════════════════════════════════════════════
 * PANEL — Chat container
 * ══════════════════════════════════════════════ */

.tt-aiv-panel {
    position: fixed;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    background: #141412;
    border: 1px solid rgba(201, 169, 110, 0.2);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease, transform 280ms cubic-bezier(0.34, 1.2, 0.64, 1);
    bottom: 0;
    left: 0;
    right: 0;
    height: 72vh;
    height: 72dvh;
    max-height: 600px;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
}

.tt-aiv-panel--open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

body.tt-aiv-open {
    overflow: hidden !important;
}

.tt-aiv-overlay {
    position: fixed;
    inset: 0;
    z-index: 9989;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 280ms ease;
    -webkit-tap-highlight-color: transparent;
}

.tt-aiv-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 1025px) {
    .tt-aiv-panel {
        bottom: 24px;
        right: 24px;
        left: auto;
        width: 380px;
        height: 560px;
        max-height: calc(100vh - 120px);
        border-radius: 16px;
        transform: translateX(20px) scale(0.97);
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 169, 110, 0.15);
    }
    .tt-aiv-panel--open {
        transform: translateX(0) scale(1);
    }
}

/* ── Panel Header ── */

.tt-aiv-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
    flex-shrink: 0;
    background: linear-gradient(180deg, #1e1e1a 0%, #141412 100%);
}

.tt-aiv-panel__header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tt-aiv-panel__avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
}

.tt-aiv-panel__avatar svg {
    width: 100%;
    height: 100%;
}

.tt-aiv-panel__header-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tt-aiv-panel__header-name {
    font-weight: 700;
    font-size: 15px;
    color: #c9a96e;
    line-height: 1.2;
}

.tt-aiv-panel__header-sub {
    font-size: 11px;
    color: #a89060;
    font-weight: 500;
}

.tt-aiv-panel__header-status {
    font-size: 11px;
    color: rgba(201, 169, 110, 0.5);
    font-style: italic;
    margin-left: 4px;
}

.tt-aiv-panel__header-btns {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tt-aiv-panel__close,
.tt-aiv-panel__settings,
.tt-aiv-panel__order-btn,
.tt-aiv-panel__cart-btn {
    background: none;
    border: none;
    color: rgba(232, 224, 208, 0.5);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 150ms ease, background 150ms ease;
}

.tt-aiv-panel__close:hover,
.tt-aiv-panel__settings:hover,
.tt-aiv-panel__order-btn:hover,
.tt-aiv-panel__cart-btn:hover {
    color: #e8e0d0;
    background: rgba(201, 169, 110, 0.1);
}

/* ── Order Status Panel ── */
.tt-aiv-order-panel {
    background: linear-gradient(135deg, #1a1a18 0%, #0c0c0a 100%);
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
    max-height: 60vh;
    overflow-y: auto;
}
.tt-aiv-order-loading {
    padding: 20px;
    text-align: center;
    color: rgba(232, 224, 208, 0.5);
    font-size: 13px;
}
.tt-aiv-order-empty {
    padding: 24px 16px;
    text-align: center;
    color: rgba(232, 224, 208, 0.4);
}
.tt-aiv-order-empty svg { margin: 0 auto 8px; display: block; opacity: 0.4; }
.tt-aiv-order-empty p { margin: 0 0 12px; font-size: 13px; }
.tt-aiv-order-empty__btn {
    background: rgba(201, 169, 110, 0.1);
    border: 1px solid rgba(201, 169, 110, 0.2);
    color: #c9a96e;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.tt-aiv-order-card {
    padding: 14px 16px;
}
.tt-aiv-order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.tt-aiv-order-card__title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: #c9a96e;
    font-weight: 600;
}
.tt-aiv-order-card__badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 3px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.tt-aiv-order-card__date {
    font-size: 11px;
    color: rgba(232, 224, 208, 0.4);
    margin-bottom: 10px;
}
.tt-aiv-order-card__items {
    margin-bottom: 8px;
}
.tt-aiv-order-card__item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
    color: #e8e0d0;
    border-bottom: 1px solid rgba(201, 169, 110, 0.06);
}
.tt-aiv-order-card__divider {
    height: 1px;
    background: rgba(201, 169, 110, 0.15);
    margin: 8px 0;
}
.tt-aiv-order-card__row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 12px;
    color: rgba(232, 224, 208, 0.6);
}
.tt-aiv-order-card__row--clickable {
    cursor: pointer;
    padding: 8px 6px;
    border-radius: 4px;
    transition: background 150ms;
}
.tt-aiv-order-card__row--clickable:hover {
    background: rgba(201, 169, 110, 0.08);
}
.tt-aiv-order-card__total {
    color: #c9a96e;
    font-weight: 600;
}
.tt-aiv-order-card__close {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: rgba(201, 169, 110, 0.08);
    border: 1px solid rgba(201, 169, 110, 0.15);
    color: rgba(232, 224, 208, 0.6);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 150ms;
}
.tt-aiv-order-card__close:hover {
    background: rgba(201, 169, 110, 0.15);
    color: #e8e0d0;
}
.tt-aiv-order-card__back {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 7px;
    background: none;
    border: 1px solid rgba(201, 169, 110, 0.12);
    color: #c9a96e;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 150ms;
    text-align: center;
}
.tt-aiv-order-card__back:hover {
    background: rgba(201, 169, 110, 0.08);
}
.tt-aiv-order-list-item {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.08);
    cursor: pointer;
    border-radius: 4px;
    transition: background 150ms;
}
.tt-aiv-order-list-item:hover {
    background: rgba(201, 169, 110, 0.06);
}
.tt-aiv-order-list-item:last-of-type {
    border-bottom: none;
}
.tt-aiv-order-list-item__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.tt-aiv-order-list-item__id {
    font-size: 13px;
    font-weight: 600;
    color: #c9a96e;
}
.tt-aiv-order-list-item__info {
    font-size: 11px;
    color: rgba(232, 224, 208, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.tt-aiv-order-list-item__bottom {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(232, 224, 208, 0.4);
}

.tt-aiv-settings-wrap {
    position: relative;
}

.tt-aiv-settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a18;
    border: 1px solid rgba(201,169,110,.2);
    border-radius: 6px;
    padding: 4px;
    z-index: 100;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

.tt-aiv-settings-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    color: #e8e0d0;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
}

.tt-aiv-settings-menu__item:hover {
    background: rgba(201,169,110,.1);
}

/* ── Context Bar (removed) ── */

/* ── Messages Area ── */

.tt-aiv-panel__messages-wrap {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tt-aiv-panel__messages-wrap .tt-aiv-panel__messages {
    flex: 1;
}

.tt-aiv-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #121210;
}

.tt-aiv-panel__messages::-webkit-scrollbar { width: 3px; }
.tt-aiv-panel__messages::-webkit-scrollbar-track { background: transparent; }
.tt-aiv-panel__messages::-webkit-scrollbar-thumb { background: rgba(201, 169, 110, 0.2); border-radius: 2px; }
.tt-aiv-panel__messages::-webkit-scrollbar-thumb:hover { background: rgba(201, 169, 110, 0.4); }

/* ── Message Bubbles ── */

.tt-aiv-panel__msg {
    max-width: 85%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.65;
    word-wrap: break-word;
    animation: ttAivMsgIn 250ms cubic-bezier(0.34, 1.2, 0.64, 1);
    position: relative;
}

@keyframes ttAivMsgIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tt-aiv-panel__msg--assistant {
    align-self: flex-start;
    background: #1e1e1a;
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 4px 16px 16px 4px;
    color: #e8e0d0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.tt-aiv-panel__msg--assistant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #c9a96e, #d4b87a);
    border-radius: 4px 0 0 4px;
}

.tt-aiv-panel__msg--assistant a {
    color: #a8862a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tt-aiv-panel__msg--assistant a:hover {
    color: #c9a96e;
}

.tt-aiv-panel__msg--assistant strong {
    color: #c9a96e;
    font-weight: 700;
}

/* ── Product Cards ── */

.tt-aiv-panel__msg--products {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    max-width: 100%;
    align-self: flex-start;
    animation: ttAivMsgIn 300ms cubic-bezier(0.34, 1.2, 0.64, 1);
}

.tt-aiv-panel__msg--products::before {
    display: none;
}

.tt-aiv-products-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.tt-aiv-products-nav {
    flex: 0 0 24px;
    height: 24px;
    border: 1px solid rgba(201,169,110,0.3);
    border-radius: 50%;
    background: #1e1e1a;
    color: #c9a96e;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 150ms, border-color 150ms;
    padding: 0;
}

.tt-aiv-products-nav:hover {
    background: #2a2a26;
    border-color: #c9a96e;
}

.tt-aiv-products {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

.tt-aiv-products::-webkit-scrollbar {
    display: none;
}

.tt-aiv-product {
    flex: 0 0 130px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    border: 1.5px solid rgba(201, 169, 110, 0.25);
    background: #141412;
    transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
    position: relative;
}

.tt-aiv-product:hover {
    border-color: rgba(201, 169, 110, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 110, 0.2);
}

.tt-aiv-product__badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    background: #c9a96e;
    color: #0c0c0a;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

.tt-aiv-product__img {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #0c0c0a;
    cursor: pointer;
}

.tt-aiv-product__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.tt-aiv-product:hover .tt-aiv-product__img img {
    transform: scale(1.05);
}

.tt-aiv-product__detail {
    padding: 6px 6px 4px;
    flex: 1;
    min-height: 0;
}

.tt-aiv-product__name {
    font-size: 11px;
    color: #e8e0d0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-aiv-product__price {
    font-size: 11px;
    font-weight: 600;
    color: #c9a96e;
    margin-top: 2px;
}

.tt-aiv-product__buy {
    display: block;
    width: calc(100% - 8px);
    margin: 2px 4px 4px;
    padding: 6px 0;
    background: linear-gradient(135deg, #d4b878, #c9a96e, #a8862a);
    color: #1a1a18;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    text-shadow: 0 1px 0 rgba(255,255,255,.15);
    border: 1px solid rgba(212,184,120,.7);
    border-radius: 3px;
    cursor: pointer;
    transition: background 150ms, color 150ms, box-shadow 150ms;
    position: relative;
    overflow: hidden;
    animation: ttBuyPulse 2s ease-in-out 3;
}

.tt-aiv-product__buy::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    animation: ttBuyShimmer 2s ease-in-out 3;
}

@keyframes ttBuyShimmer {
    0%   { left: -100%; }
    100% { left: 150%; }
}

@keyframes ttBuyPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,169,110,0); }
    50%      { box-shadow: 0 0 10px 2px rgba(201,169,110,.45); }
}

.tt-aiv-product__buy:hover {
    background: linear-gradient(135deg, #d4b878, #c9a96e);
    color: #0c0c0a;
    box-shadow: 0 2px 12px rgba(201,169,110,.5);
}

.tt-aiv-product__soldout {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(211, 47, 47, 0.85);
    color: #fff;
    font-size: 8px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 2;
}

.tt-aiv-product--soldout {
    opacity: 0.5;
}

.tt-aiv-product--in-cart {
    border-color: rgba(100, 200, 100, 0.4);
}

.tt-aiv-product__cart-tag {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(40, 120, 60, 0.9);
    color: #fff;
    font-size: 8px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 3;
}

.tt-aiv-product__buy--in-cart {
    background: rgba(100, 200, 100, 0.1) !important;
    border-color: rgba(100, 200, 100, 0.3) !important;
    color: #6c6 !important;
    cursor: default !important;
}

@media (max-width: 480px) {
    .tt-aiv-product { flex: 0 0 115px; }
}

/* ══════════════════════════════════════════════
 * LIGHTBOX — Product image gallery
 * ══════════════════════════════════════════════ */

.tt-aiv-lb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 250ms ease;
}

.tt-aiv-lb--open {
    opacity: 1;
}

.tt-aiv-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.tt-aiv-lb__container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 85vh;
    z-index: 1;
}

.tt-aiv-lb__close {
    position: absolute;
    top: -36px;
    right: -8px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #e8e0d0;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 150ms;
    z-index: 2;
}

.tt-aiv-lb__close:hover {
    opacity: 1;
}

.tt-aiv-lb__body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tt-aiv-lb__img-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(201, 169, 110, 0.3);
    background: #0c0c0a;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.tt-aiv-lb__img {
    display: block;
    max-width: 70vw;
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 200ms ease;
}

.tt-aiv-lb__arrow {
    flex: 0 0 40px;
    height: 40px;
    border: 1.5px solid rgba(201, 169, 110, 0.4);
    border-radius: 50%;
    background: rgba(30, 30, 26, 0.8);
    color: #c9a96e;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms, border-color 150ms, transform 150ms;
}

.tt-aiv-lb__arrow:hover {
    background: rgba(201, 169, 110, 0.15);
    border-color: #c9a96e;
    transform: scale(1.1);
}

.tt-aiv-lb__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 12px;
    padding: 0 52px;
}

.tt-aiv-lb__title {
    color: #e8e0d0;
    font-size: 13px;
    font-weight: 500;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-aiv-lb__counter {
    color: rgba(232, 224, 208, 0.5);
    font-size: 12px;
}

/* ── Lightbox price + action buttons ── */

.tt-aiv-lb__price {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #c9a96e;
    margin-top: 8px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tt-aiv-lb__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.tt-aiv-lb__buy {
    padding: 10px 28px;
    background: linear-gradient(135deg, #c9a96e, #a8862a);
    color: #0c0c0a;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 150ms, box-shadow 150ms;
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.3);
    font-family: inherit;
}

.tt-aiv-lb__buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(201, 169, 110, 0.45);
}

.tt-aiv-lb__buy:active {
    transform: scale(0.97);
}

.tt-aiv-lb__cta {
    display: inline-block;
    padding: 8px 16px;
    background: none;
    color: rgba(232, 224, 208, 0.6);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(232, 224, 208, 0.2);
    border-radius: 6px;
    transition: color 150ms, border-color 150ms;
}

.tt-aiv-lb__cta:hover {
    color: #e8e0d0;
    border-color: rgba(232, 224, 208, 0.5);
}

@media (max-width: 480px) {
    .tt-aiv-lb__img {
        max-width: 85vw;
        max-height: 50vh;
    }

    .tt-aiv-lb__arrow {
        flex: 0 0 34px;
        height: 34px;
        font-size: 18px;
    }

    .tt-aiv-lb__body {
        gap: 6px;
    }

    .tt-aiv-lb__footer {
        padding: 0 40px;
    }

    .tt-aiv-lb__title {
        font-size: 12px;
    }

    .tt-aiv-lb__price {
        font-size: 14px;
        margin-top: 6px;
    }

    .tt-aiv-lb__actions {
        gap: 8px;
        margin-top: 8px;
    }

    .tt-aiv-lb__buy {
        padding: 9px 20px;
        font-size: 13px;
    }

    .tt-aiv-lb__cta {
        padding: 7px 12px;
        font-size: 11px;
    }
}

.tt-aiv-panel__msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #c9a96e, #a8862a);
    color: #fff;
    border-radius: 16px 4px 4px 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.2);
    border: none;
}

/* Typing indicator */
.tt-aiv-panel__msg--typing {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
}

.tt-aiv-panel__msg--typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c9a96e;
    animation: ttAivTyping 1.2s ease-in-out infinite;
}

.tt-aiv-panel__msg--typing span:nth-child(2) { animation-delay: 0.15s; }
.tt-aiv-panel__msg--typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ttAivTyping {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* ── Scroll FAB ── */

.tt-aiv-panel__scroll-fab {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(201, 169, 110, 0.25);
    background: #1e1e1a;
    color: #c9a96e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: opacity 200ms ease, transform 200ms ease;
    z-index: 2;
}

.tt-aiv-panel__scroll-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}

/* ── Action Bar ── */

.tt-aiv-panel__action-bar {
    display: flex;
    gap: 8px;
    padding: 6px 14px;
    flex-shrink: 0;
    border-top: 1px solid rgba(201, 169, 110, 0.1);
    background: #161614;
}

.tt-aiv-panel__action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(201, 169, 110, 0.15);
    background: transparent;
    color: rgba(232, 224, 208, 0.5);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.tt-aiv-panel__action-btn:hover {
    color: #e8e0d0;
    background: rgba(201, 169, 110, 0.08);
}

.tt-aiv-panel__action-btn--clear:hover {
    border-color: rgba(211, 47, 47, 0.4);
    background: rgba(211, 47, 47, 0.1);
    color: #ef5350;
}

.tt-aiv-panel__action-btn--reset:hover {
    border-color: rgba(201, 169, 110, 0.4);
    background: rgba(201, 169, 110, 0.1);
    color: #c9a96e;
}

/* ── Message Wrapper (timestamp + actions) ── */

.tt-aiv-panel__msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    animation: ttAivMsgIn 250ms cubic-bezier(0.34, 1.2, 0.64, 1);
}

.tt-aiv-panel__msg-wrap .tt-aiv-panel__msg {
    animation: none;
}

.tt-aiv-panel__msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 200ms ease;
}

.tt-aiv-panel__msg-wrap:hover .tt-aiv-panel__msg-meta,
.tt-aiv-panel__msg-meta--visible {
    opacity: 1;
}

.tt-aiv-panel__msg-wrap--user .tt-aiv-panel__msg-meta {
    justify-content: flex-end;
}

.tt-aiv-panel__msg-time {
    font-size: 10px;
    color: rgba(232, 224, 208, 0.35);
}

.tt-aiv-panel__msg-action {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: rgba(232, 224, 208, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
    transition: color 150ms ease, background 150ms ease;
}

.tt-aiv-panel__msg-action:hover {
    color: #e8e0d0;
    background: rgba(201, 169, 110, 0.1);
}

.tt-aiv-panel__msg-action--active {
    color: #c9a96e !important;
}

/* ── Date Divider ── */

.tt-aiv-panel__date-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.tt-aiv-panel__date-divider::before,
.tt-aiv-panel__date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(201, 169, 110, 0.12);
}

.tt-aiv-panel__date-divider span {
    font-size: 10px;
    color: rgba(232, 224, 208, 0.35);
    white-space: nowrap;
    font-weight: 500;
}

/* ── Error Message + Retry ── */

.tt-aiv-panel__msg--error {
    border-color: rgba(211, 47, 47, 0.3) !important;
    background: rgba(211, 47, 47, 0.08) !important;
}

.tt-aiv-panel__retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(201, 169, 110, 0.25);
    background: #1e1e1a;
    color: #c9a96e;
    font-size: 12px;
    cursor: pointer;
    transition: background 150ms ease;
}

.tt-aiv-panel__retry-btn:hover {
    background: rgba(201, 169, 110, 0.1);
}

/* ── History Loading ── */

.tt-aiv-panel__history-loading {
    display: flex;
    gap: 5px;
    justify-content: center;
    padding: 24px;
}

.tt-aiv-panel__history-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c9a96e;
    animation: ttAivTyping 1.2s ease-in-out infinite;
}

.tt-aiv-panel__history-loading span:nth-child(2) { animation-delay: 0.15s; }
.tt-aiv-panel__history-loading span:nth-child(3) { animation-delay: 0.3s; }

/* ══════════════════════════════════════════════
 * FOOTER / INPUT
 * ══════════════════════════════════════════════ */

.tt-aiv-panel__footer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(201, 169, 110, 0.15);
    flex-shrink: 0;
    background: #161614;
}

.tt-aiv-panel__input-wrap {
    flex: 1;
    min-width: 0;
}

.tt-aiv-panel__input {
    width: 100%;
    box-sizing: border-box;
    resize: none;
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 12px;
    background: #1a1a18;
    color: #e8e0d0;
    padding: 10px 14px;
    font-size: 16px;
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.45;
    max-height: 100px;
    overflow-y: auto;
    scrollbar-width: none;
    outline: none;
    -webkit-appearance: none;
    touch-action: manipulation;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.tt-aiv-panel__input::-webkit-scrollbar { display: none; }

.tt-aiv-panel__input:focus {
    border-color: #c9a96e;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.tt-aiv-panel__input::placeholder {
    color: rgba(232, 224, 208, 0.35);
}

.tt-aiv-panel__send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #c9a96e;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 150ms ease, background 150ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.tt-aiv-panel__send:hover {
    background: #a8862a;
    transform: scale(1.05);
}

.tt-aiv-panel__send:active {
    transform: scale(0.92);
}

.tt-aiv-panel__send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ══════════════════════════════════════════════
 * CONFIRM DIALOG
 * ══════════════════════════════════════════════ */

.tt-aiv-confirm {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 300ms ease, backdrop-filter 300ms ease;
}

.tt-aiv-confirm--visible {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tt-aiv-confirm__box {
    width: 100%;
    max-width: 320px;
    background: #1a1a18;
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: opacity 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tt-aiv-confirm--visible .tt-aiv-confirm__box {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.tt-aiv-confirm__inner { position: relative; }

.tt-aiv-confirm__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 20px;
}

.tt-aiv-confirm__icon--danger {
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.3);
    color: #ef5350;
}

.tt-aiv-confirm__icon--reset {
    background: rgba(201, 169, 110, 0.1);
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: #c9a96e;
}

.tt-aiv-confirm__title {
    font-size: 16px;
    font-weight: 700;
    color: #e8e0d0;
    text-align: center;
    margin-bottom: 8px;
}

.tt-aiv-confirm__msg {
    font-size: 13px;
    color: rgba(232, 224, 208, 0.6);
    text-align: center;
    line-height: 1.55;
    margin-bottom: 22px;
}

.tt-aiv-confirm__divider {
    height: 1px;
    background: rgba(201, 169, 110, 0.12);
    margin-bottom: 18px;
}

.tt-aiv-confirm__actions {
    display: flex;
    gap: 10px;
}

.tt-aiv-confirm__btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
    border: 1px solid transparent;
}

.tt-aiv-confirm__btn:active {
    transform: scale(0.97);
}

.tt-aiv-confirm__btn--cancel {
    background: #222220;
    border-color: rgba(201, 169, 110, 0.15);
    color: rgba(232, 224, 208, 0.6);
}

.tt-aiv-confirm__btn--cancel:hover {
    background: #2a2a26;
    color: #e8e0d0;
}

.tt-aiv-confirm__btn--ok {
    background: #c9a96e;
    color: #fff;
    font-weight: 600;
}

.tt-aiv-confirm__btn--ok:hover {
    background: #a8862a;
}

.tt-aiv-confirm__btn--ok--danger {
    background: #d32f2f;
    color: #fff;
}

.tt-aiv-confirm__btn--ok--danger:hover {
    background: #c62828;
}

.tt-aiv-confirm__hint {
    text-align: center;
    font-size: 10px;
    color: rgba(232, 224, 208, 0.3);
    margin-top: 12px;
}

/* ══════════════════════════════════════════════
 * RESPONSIVE
 * ══════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .tt-aiv-panel__close,
    .tt-aiv-panel__action-btn,
    .tt-aiv-panel__msg-action,
    .tt-aiv-panel__scroll-fab,
    .tt-aiv-panel__send,
    .tt-aiv-panel__retry-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

@media (min-width: 1025px) {
    .tt-aiv-preview {
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .tt-aiv-bubble__badge {
        width: 12px;
        height: 12px;
        top: 0;
        right: 0;
    }
    .tt-aiv-preview {
        max-width: 220px;
        font-size: 12px;
        padding: 8px 24px 8px 10px;
    }
    .tt-aiv-panel {
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .tt-aiv-panel__close,
    .tt-aiv-panel__action-btn,
    .tt-aiv-panel__msg-action {
        min-height: 44px;
        min-width: 44px;
    }
    .tt-aiv-panel__msg {
        font-size: 13.5px;
    }
}

@media (min-width: 481px) and (max-width: 1024px) {
    .tt-aiv-panel {
        height: 80vh;
        height: 80dvh;
        max-height: 680px;
    }
}

@media (max-height: 500px) and (max-width: 1024px) {
    .tt-aiv-panel {
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .tt-aiv-panel__header { padding: 6px 14px; }
    .tt-aiv-panel__avatar { width: 28px; height: 28px; }
    .tt-aiv-panel__action-bar { padding: 4px 14px; }
    .tt-aiv-panel__msg { font-size: 13px; padding: 8px 12px; }
    .tt-aiv-panel__footer { padding: 6px 12px max(8px, env(safe-area-inset-bottom)); }
}

/* ── Icon Morph — cross rotates to × while shrinking ── */

.tt-aiv-panel--open ~ .tt-aiv-bubble,
body.tt-aiv-open .tt-aiv-bubble {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5) rotate(135deg);
}

body.tt-aiv-open .tt-aiv-bubble__glow,
body.tt-aiv-open .tt-aiv-bubble__pulse,
body.tt-aiv-open .tt-aiv-bubble__badge {
    animation: none;
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .tt-aiv-bubble,
    .tt-aiv-panel,
    .tt-aiv-preview,
    .tt-aiv-panel__msg,
    .tt-aiv-bubble__pulse,
    .tt-aiv-bubble__glow,
    .tt-aiv-bubble__badge,
    .tt-aiv-bubble__badge::after {
        transition: none;
        animation: none;
    }
}

/* ══════════════════════════════════════════
 * CART ADD-TO-CART STATUS
 * ══════════════════════════════════════════ */

.tt-aiv-cart-status {
    margin: 6px 48px 4px 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.tt-aiv-cart-status--loading {
    background: rgba(201,169,110,0.08);
    color: #c9a96e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tt-aiv-cart-spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(201,169,110,0.3);
    border-top-color: #c9a96e;
    border-radius: 50%;
    animation: ttCartSpin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes ttCartSpin {
    to { transform: rotate(360deg); }
}

.tt-aiv-cart-status--ok {
    background: rgba(46,160,67,0.1);
    border: 1px solid rgba(46,160,67,0.25);
    color: #e8e0d0;
}

.tt-aiv-cart-status--err {
    background: rgba(200,50,50,0.1);
    border: 1px solid rgba(200,50,50,0.25);
    color: #e8a0a0;
}

.tt-aiv-cart-icon {
    font-weight: 700;
    margin-right: 4px;
}

.tt-aiv-cart-status--ok .tt-aiv-cart-icon { color: #2ea043; }
.tt-aiv-cart-status--err .tt-aiv-cart-icon { color: #c83232; }

.tt-aiv-cart-detail {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-aiv-cart-checkout {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #c9a96e, #a8884e);
    color: #0c0c0a !important;
    font-weight: 600;
    font-size: 13px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s;
}

.tt-aiv-cart-checkout:hover {
    opacity: 0.85;
}

/* ══════════════════════════════════════════
 * QR PAYMENT BLOCK + QUICK REPLIES
 * ══════════════════════════════════════════ */

/* ═══ QR Payment Block — Dark Luxury ═══ */
.tt-aiv-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0;
    background: linear-gradient(180deg, #1a1a18 0%, #0c0c0a 100%);
    border: 1px solid rgba(201,169,110,0.25);
    border-radius: 4px;
    margin: 4px 0;
    overflow: hidden;
}

/* Header */
.tt-aiv-qr-header {
    width: 100%;
    text-align: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid rgba(201,169,110,0.12);
}
.tt-aiv-qr-header__status {
    font-family: 'Cinzel Decorative', 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    color: #c9a96e;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.tt-aiv-qr-header__order {
    font-size: 11.5px;
    color: rgba(232,224,208,0.5);
    letter-spacing: 0.5px;
}
.tt-aiv-qr-header__order strong {
    color: #e8e0d0;
}

/* QR Image area */
.tt-aiv-qr-imgwrap {
    padding: 16px;
    width: 100%;
    display: flex;
    justify-content: center;
}
.tt-aiv-qr-imgframe {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 16px rgba(201,169,110,0.08);
}
.tt-aiv-qr-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 6px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
.tt-aiv-qr-logo img {
    display: block;
    border-radius: 3px;
}
.tt-aiv-qr-img {
    width: 170px;
    height: 170px;
    border-radius: 4px;
    border: none;
    display: block;
    background: #fff;
    padding: 0;
}
@media (max-width: 480px) {
    .tt-aiv-qr-img { width: 150px; height: 150px; }
    .tt-aiv-qr-imgframe { padding: 10px; }
}
.tt-aiv-qr-scanlabel {
    font-size: 10px;
    color: rgba(232,224,208,0.35);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    margin-top: -8px;
    margin-bottom: 12px;
}

/* Fallback bank info */
.tt-aiv-qr-fallback {
    font-size: 12px;
    color: #e8e0d0;
    line-height: 1.6;
    text-align: center;
    width: 100%;
    padding: 0 16px;
}
.tt-aiv-qr-fallback strong {
    color: #c9a96e;
}

/* Amount + memo */
.tt-aiv-qr-details {
    width: 100%;
    padding: 12px 16px;
    border-top: 1px solid rgba(201,169,110,0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tt-aiv-qr-details__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(232,224,208,0.6);
}
.tt-aiv-qr-details__row strong {
    color: #e8e0d0;
    font-size: 12.5px;
}
.tt-aiv-qr-amount {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    color: #f5d58c;
    text-align: center;
    padding: 8px 16px 4px;
    letter-spacing: 1px;
}

.tt-aiv-copy-btn {
    background: none;
    border: 1px solid rgba(201,169,110,0.2);
    border-radius: 2px;
    padding: 1px 6px;
    cursor: pointer;
    font-size: 10px;
    color: #c9a96e;
    vertical-align: middle;
    transition: all 0.2s;
}
.tt-aiv-copy-btn:hover {
    background: rgba(201,169,110,0.1);
    border-color: rgba(201,169,110,0.4);
}

/* Reserve countdown */
.tt-aiv-qr-reserve {
    font-size: 12px;
    color: #c9a96e;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(201,169,110,0.06);
    text-align: center;
    width: 100%;
    transition: background 0.5s, color 0.5s;
}
.tt-aiv-qr-reserve__icon {
    display: inline-block;
    animation: tt-aiv-pulse 2s ease-in-out infinite;
}
.tt-aiv-qr-reserve--warn {
    color: #e0a830;
    background: rgba(224,168,48,0.08);
}
.tt-aiv-qr-reserve--danger {
    color: #e04040;
    background: rgba(224,64,64,0.08);
    animation: tt-aiv-reserve-pulse 1s ease-in-out infinite;
}
.tt-aiv-qr-reserve--paid {
    color: #4aba70;
    background: rgba(74,186,112,0.08);
    animation: none;
}
@keyframes tt-aiv-reserve-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes tt-aiv-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Discount status */
.tt-aiv-qr-status {
    font-size: 11px;
    color: #e0a830;
    font-weight: 500;
    padding: 4px 16px 8px;
    text-align: center;
    width: 100%;
}
.tt-aiv-qr-status--neutral {
    color: rgba(232,224,208,0.4);
}
.tt-aiv-qr-status--paid {
    color: #4aba70;
}

/* Order link */
.tt-aiv-qr-link {
    font-size: 11px;
    color: rgba(201,169,110,0.6);
    text-decoration: none;
    font-weight: 400;
    letter-spacing: 0.3px;
    padding: 4px 16px;
}
.tt-aiv-qr-link:hover {
    color: #c9a96e;
}

/* Order details collapsible */
.tt-aiv-qr-order-details {
    width: 100%;
    border-top: 1px solid rgba(201,169,110,0.1);
}
.tt-aiv-qr-order-details summary {
    cursor: pointer;
    color: rgba(201,169,110,0.7);
    font-size: 11.5px;
    padding: 10px 16px;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    list-style: none;
}
.tt-aiv-qr-order-details summary::-webkit-details-marker { display: none; }
.tt-aiv-qr-order-details summary::before {
    content: '▸ ';
    font-size: 10px;
}
.tt-aiv-qr-order-details[open] summary::before {
    content: '▾ ';
}
.tt-aiv-qr-order-details[open] summary {
    color: #c9a96e;
}
.tt-aiv-qr-order-details__body {
    padding: 0 16px 12px;
    font-size: 11.5px;
    color: rgba(232,224,208,0.7);
    line-height: 1.6;
}
.tt-aiv-qr-od__section {
    margin-bottom: 4px;
}
.tt-aiv-qr-od__item {
    padding-left: 10px;
    color: rgba(232,224,208,0.55);
    font-size: 11px;
}

/* Action buttons */
.tt-aiv-qr-actions {
    display: flex;
    gap: 0;
    width: 100%;
    border-top: 1px solid rgba(201,169,110,0.12);
}
.tt-aiv-qr-actions__btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: 0.3px;
}
.tt-aiv-qr-actions__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.tt-aiv-qr-actions__btn--confirm {
    background: linear-gradient(135deg, #c9a96e, #dbb870);
    color: #0c0c0a;
}
.tt-aiv-qr-actions__btn--confirm:hover {
    background: linear-gradient(135deg, #dbb870, #f5d58c);
}
.tt-aiv-qr-actions__btn--cancel {
    background: rgba(255,255,255,0.03);
    color: rgba(232,224,208,0.4);
    border-left: 1px solid rgba(201,169,110,0.12);
}
.tt-aiv-qr-actions__btn--cancel:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(232,224,208,0.6);
}

/* Quick Reply Buttons */
/* ── Quick Reply Buttons (inline in bubble) ── */
.tt-aiv-qr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(201, 169, 110, 0.15);
}

.tt-aiv-qr--grid {
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 110, 0.3) transparent;
}

.tt-aiv-qr__btn {
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.15), rgba(201, 169, 110, 0.08));
    border: 1px solid rgba(201, 169, 110, 0.4);
    color: #e8e0d0;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    flex: 0 0 auto;
}

.tt-aiv-qr__btn:hover,
.tt-aiv-qr__btn:active {
    background: linear-gradient(135deg, #c9a96e, #a8884a);
    color: #111;
    border-color: #c9a96e;
}

.tt-aiv-qr__btn--subtle {
    background: transparent;
    border-style: dashed;
    color: #a09880;
    font-size: 12px;
}

/* 2-3 options: equal width side by side */
.tt-aiv-qr:not(.tt-aiv-qr--grid) .tt-aiv-qr__btn {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
}

/* Grid mode: compact pills for many options */
.tt-aiv-qr--grid .tt-aiv-qr__btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Footer input locked during checkout */
.tt-aiv-input--locked {
    opacity: 0.5;
    cursor: not-allowed;
}
.tt-aiv-input--locked::placeholder {
    color: rgba(201, 169, 110, 0.4);
}

/* Inline input form (open_input action inside bubble) */
.tt-aiv-inline-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(201, 169, 110, 0.15);
    align-items: center;
}
.tt-aiv-inline-input-field {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: #e8e0d0;
    padding: 9px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.tt-aiv-inline-input-field::placeholder {
    color: rgba(201, 169, 110, 0.45);
}
.tt-aiv-inline-input-field:focus {
    border-color: rgba(201, 169, 110, 0.7);
    background: rgba(255, 255, 255, 0.08);
}
.tt-aiv-inline-input-submit {
    flex-shrink: 0;
    background: linear-gradient(135deg, #c9a96e, #a8884a);
    color: #111;
    border: none;
    padding: 9px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.tt-aiv-inline-input-submit:hover,
.tt-aiv-inline-input-submit:active {
    background: linear-gradient(135deg, #d4b87a, #c9a96e);
}

/* ══════════════════════════════════════════════
 * UNIFIED ORDER FLOW CARD — sticky above footer
 * Phases: selecting → cart → checkout → payment
 * ══════════════════════════════════════════════ */

.tt-of {
    border-top: 1px solid rgba(201, 169, 110, 0.2);
    max-height: 55vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 169, 110, 0.3) transparent;
}

.tt-of__card {
    background: linear-gradient(160deg, #1a1916 0%, #141310 100%);
    padding: 10px 12px;
    font-size: 13px;
    color: #e8e0d0;
    position: relative;
}

.tt-of__card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.5), transparent);
}

/* ── Phase indicator ── */
.tt-of__phase-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.tt-of__phase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.2);
    flex-shrink: 0;
}

.tt-of__phase-dot--active {
    background: #c9a96e;
    box-shadow: 0 0 6px rgba(201, 169, 110, 0.5);
    animation: tt-of-pulse 1.5s ease-in-out infinite;
}

.tt-of__phase-dot--done {
    background: #60c060;
}

@keyframes tt-of-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tt-of__phase-label {
    font-size: 11px;
    font-weight: 600;
    color: #c9a96e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

/* ── Toggle collapse/expand ── */
.tt-of__toggle {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 4px;
    color: #888;
    font-size: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 150ms;
    font-family: inherit;
    line-height: 1;
    margin-left: auto;
}

.tt-of__toggle:hover {
    color: #c9a96e;
    border-color: rgba(201, 169, 110, 0.5);
    background: rgba(201, 169, 110, 0.08);
}

/* ── Collapsed bar ── */
.tt-of__collapsed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(160deg, #1a1916 0%, #141310 100%);
    cursor: pointer;
    border-top: 1px solid rgba(201, 169, 110, 0.2);
    transition: background 150ms;
}

.tt-of__collapsed:hover {
    background: linear-gradient(160deg, #1e1d1a 0%, #181714 100%);
}

.tt-of__collapsed-label {
    flex: 1;
    font-size: 12px;
    color: #c9a96e;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-of__collapsed-arrow {
    flex-shrink: 0;
    font-size: 10px;
    color: #888;
    transition: transform 200ms;
}

.tt-of__collapsed--checkout {
    cursor: default;
}

.tt-of__collapsed-cancel {
    flex-shrink: 0;
    padding: 3px 10px;
    font-size: 11px;
    color: #e8e0d0;
    background: rgba(255, 80, 80, 0.15);
    border: 1px solid rgba(255, 80, 80, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: background 150ms;
}

.tt-of__collapsed-cancel:hover {
    background: rgba(255, 80, 80, 0.3);
}

/* ── Product section (selecting phase) ── */
.tt-of__product {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.12);
}

.tt-of__img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(201, 169, 110, 0.25);
    flex-shrink: 0;
}

.tt-of__info {
    flex: 1;
    min-width: 0;
}

.tt-of__code {
    font-size: 10px;
    color: #c9a96e;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tt-of__name {
    font-weight: 500;
    font-size: 12px;
    color: #d0c8b8;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tt-of__price {
    font-size: 14px;
    font-weight: 700;
    color: #c9a96e;
    margin-top: 3px;
}

/* ── Attributes & Pills ── */
.tt-of__attrs {
    padding: 8px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-of__attr {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
}

.tt-of__attr-label {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
    padding-top: 4px;
}

.tt-of__attr--done .tt-of__attr-label {
    color: #b0a890;
}

.tt-of__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tt-of__pill {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    color: #b0a890;
    background: rgba(201, 169, 110, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 150ms ease;
    font-family: inherit;
    line-height: 1.2;
}

.tt-of__pill:hover {
    background: rgba(201, 169, 110, 0.15);
    border-color: rgba(201, 169, 110, 0.45);
    color: #c9a96e;
}

.tt-of__pill:active {
    transform: scale(0.96);
}

.tt-of__pill--selected {
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.25), rgba(201, 169, 110, 0.12));
    border-color: #c9a96e;
    color: #c9a96e;
    font-weight: 600;
    cursor: pointer;
}

/* ── Buttons ── */
.tt-of__btn {
    display: block;
    width: 100%;
    padding: 9px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 150ms, box-shadow 150ms;
    font-family: inherit;
}

.tt-of__btn--add,
.tt-of__btn--primary {
    background: linear-gradient(135deg, #c9a96e, #a8862a);
    color: #0c0c0a;
    box-shadow: 0 2px 12px rgba(201, 169, 110, 0.25);
    letter-spacing: 0.3px;
}

.tt-of__btn--add:hover,
.tt-of__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.35);
}

.tt-of__btn--secondary {
    background: rgba(201, 169, 110, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.2);
    color: #c9a96e;
}

.tt-of__btn--secondary:hover {
    background: rgba(201, 169, 110, 0.12);
}

.tt-of__btn--loading {
    background: rgba(201, 169, 110, 0.15) !important;
    color: #c9a96e !important;
    box-shadow: none !important;
    cursor: wait !important;
}

/* ── Cart items (cart phase) ── */
.tt-of__cart-items {
    padding: 4px 0;
}

.tt-of__cart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(201, 169, 110, 0.08);
}

.tt-of__cart-row:last-child {
    border-bottom: none;
}

.tt-of__cart-img {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    object-fit: cover;
    border: 1px solid rgba(201, 169, 110, 0.15);
    flex-shrink: 0;
}

.tt-of__cart-info {
    flex: 1;
    min-width: 0;
}

.tt-of__cart-name {
    font-size: 12px;
    font-weight: 500;
    color: #d0c8b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-of__cart-price {
    font-size: 12px;
    color: #c9a96e;
    margin-top: 1px;
}

.tt-of__cart-actions-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.tt-of__cart-edit {
    width: 22px;
    height: 22px;
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.06);
    color: #c9a96e;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 150ms;
}

.tt-of__cart-edit:hover {
    background: rgba(201, 169, 110, 0.15);
    border-color: rgba(201, 169, 110, 0.5);
}

.tt-of__cart-rm {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 80, 80, 0.25);
    border-radius: 50%;
    background: rgba(255, 80, 80, 0.06);
    color: #ff6060;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: inherit;
    line-height: 1;
    transition: all 150ms;
}

.tt-of__cart-rm:hover {
    background: rgba(255, 80, 80, 0.15);
    border-color: rgba(255, 80, 80, 0.5);
}

.tt-of__cart-footer {
    padding-top: 8px;
    border-top: 1px solid rgba(201, 169, 110, 0.15);
}

.tt-of__cart-total {
    font-size: 13px;
    color: #c9a96e;
    text-align: right;
    margin-bottom: 6px;
}

.tt-of__cart-total strong {
    font-size: 15px;
}

.tt-of__cart-actions {
    display: flex;
    gap: 8px;
}

.tt-of__cart-actions .tt-of__btn--secondary {
    flex: 1;
    margin-top: 0;
}

.tt-of__cart-actions .tt-of__btn--primary {
    flex: 2;
    margin-top: 0;
}

/* ── Checkout phase ── */
.tt-of__progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tt-of__progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(201, 169, 110, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.tt-of__progress-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #c9a96e, #f5d58c);
    border-radius: 2px;
    transition: width 400ms ease;
}

.tt-of__progress-text {
    font-size: 10px;
    color: #888;
    white-space: nowrap;
}

.tt-of__checkout-summary {
    padding: 6px 0;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.1);
}

.tt-of__checkout-items {
    font-size: 12px;
    color: #b0a890;
}

.tt-of__fields {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tt-of__field {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 12px;
}

.tt-of__field--done {
    color: #d0c8b8;
}

.tt-of__field--empty {
    color: #666;
}

.tt-of__field-icon {
    flex-shrink: 0;
    font-size: 11px;
    width: 18px;
    text-align: center;
}

.tt-of__field-label {
    flex-shrink: 0;
    font-size: 11px;
    color: #999;
    width: 80px;
}

.tt-of__field-val {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-of__field--done .tt-of__field-val {
    color: #e8e0d0;
    font-weight: 500;
}

.tt-of__field--empty .tt-of__field-val {
    font-style: italic;
}

.tt-of__note {
    padding: 6px 8px;
    margin-top: 6px;
    background: rgba(201, 169, 110, 0.06);
    border-radius: 6px;
    font-size: 11px;
    color: #b0a890;
}

.tt-of__checkout-ready {
    text-align: center;
    padding: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: #60c060;
    background: rgba(80, 180, 80, 0.08);
    border-radius: 6px;
}

.tt-of__checkout-hint {
    text-align: center;
    padding: 6px;
    margin-top: 6px;
    font-size: 11px;
    color: #888;
}

.tt-of__empty-cart {
    text-align: center;
    padding: 10px 8px;
    font-size: 12px;
    color: #666;
    opacity: .7;
}

/* ── Payment phase ── */
.tt-of__qr {
    text-align: center;
    padding: 10px 0;
}

.tt-of__qr img {
    max-width: 180px;
    border-radius: 8px;
    border: 2px solid rgba(201, 169, 110, 0.3);
}

.tt-of__pay-total {
    text-align: center;
    font-size: 14px;
    color: #c9a96e;
    margin-bottom: 4px;
}

.tt-of__pay-id {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
}

.tt-of__pay-hint {
    text-align: center;
    font-size: 11px;
    color: #60c060;
    padding: 6px;
    background: rgba(80, 180, 80, 0.06);
    border-radius: 6px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .tt-of {
        max-height: 45vh;
    }

    .tt-of__card {
        padding: 8px 10px;
        font-size: 12px;
    }

    .tt-of__img {
        width: 42px;
        height: 42px;
    }

    .tt-of__cart-img {
        width: 28px;
        height: 28px;
    }

    .tt-of__qr img {
        max-width: 150px;
    }
}

/* ═══ Cart Toast Notification ═══ */
.tt-aiv-toast {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(201, 169, 110, 0.15);
    border: 1px solid rgba(201, 169, 110, 0.3);
    color: #c9a96e;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 10;
    backdrop-filter: blur(8px);
}
.tt-aiv-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══ Checkout Step Card ═══ */
.tt-cs-card {
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.1) 0%, rgba(201, 169, 110, 0.04) 100%);
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
}
.tt-cs__header {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #e8e0d0;
    letter-spacing: 0.3px;
}
.tt-cs__progress {
    height: 3px;
    background: rgba(201, 169, 110, 0.12);
    margin: 0 14px;
    border-radius: 2px;
    overflow: hidden;
}
.tt-cs__progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c9a96e, #f5d58c);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.tt-cs__step-num {
    padding: 6px 14px 10px;
    font-size: 11px;
    color: #a09880;
    text-align: right;
}

/* ═══ Checkout Order Card (in chat bubble) ═══ */
.tt-co-card {
    background: rgba(201, 169, 110, 0.06);
    border: 1px solid rgba(201, 169, 110, 0.25);
    border-radius: 4px;
    overflow: hidden;
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.5;
}

.tt-co__header {
    background: rgba(201, 169, 110, 0.12);
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13px;
    color: #c9a96e;
    border-bottom: 1px solid rgba(201, 169, 110, 0.15);
}

.tt-co__section {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(201, 169, 110, 0.1);
}

.tt-co__section:last-child {
    border-bottom: none;
}

.tt-co__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    color: #e8e0d0;
}
.tt-co__item + .tt-co__item {
    border-top: 1px solid rgba(201, 169, 110, 0.08);
}
.tt-co__thumb {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(201, 169, 110, 0.2);
}
.tt-co__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 169, 110, 0.08);
    font-size: 20px;
}
.tt-co__item-info {
    flex: 1;
    min-width: 0;
}
.tt-co__item-name {
    font-size: 13px;
    font-weight: 500;
    color: #e8e0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tt-co__variant {
    font-size: 11px;
    color: #a09880;
    margin-top: 1px;
}
.tt-co__item-meta {
    font-size: 12px;
    color: #c9a96e;
    margin-top: 2px;
    font-weight: 600;
}

.tt-co__info div {
    padding: 2px 0;
    color: #d4d0c8;
    font-size: 12px;
}

.tt-co__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    color: #d4d0c8;
    font-size: 12px;
}

.tt-co__row--discount {
    color: #5cb85c;
}

.tt-co__row--total {
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid rgba(201, 169, 110, 0.2);
    font-weight: 700;
    font-size: 14px;
    color: #c9a96e;
}

.tt-co__footer {
    padding: 8px 12px;
    font-size: 12px;
    color: #a09880;
    text-align: center;
}

.tt-co-card--mini .tt-co__header {
    font-size: 12px;
    padding: 6px 12px;
}

.tt-co-card--mini .tt-co__row {
    font-size: 12px;
}

/* ═══ Suggestion Chips ═══ */
.tt-aiv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 4px;
    animation: ttChipsFadeIn .4s ease;
}

.tt-aiv-chips__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: rgba(201,169,110,.08);
    border: 1px solid rgba(201,169,110,.3);
    border-radius: 20px;
    color: #e8e0d0;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.tt-aiv-chips__btn:hover {
    background: linear-gradient(135deg, #c9a96e, #a8862a);
    color: #1a1a18;
    border-color: #c9a96e;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(201,169,110,.3);
}

.tt-aiv-chips__icon {
    font-size: 14px;
    line-height: 1;
}

@keyframes ttChipsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Size Guide Image in Chat ═══ */
.tt-aiv-size-guide {
    margin: 8px 0 4px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(201,169,110,.25);
    cursor: pointer;
    transition: border-color .2s;
}

.tt-aiv-size-guide:hover {
    border-color: rgba(201,169,110,.6);
}

.tt-aiv-size-guide img {
    display: block;
    width: 100%;
    height: auto;
}

.tt-aiv-size-guide__label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(201,169,110,.08);
    font-size: 11px;
    color: rgba(201,169,110,.8);
    border-top: 1px solid rgba(201,169,110,.12);
}

.tt-aiv-size-guide__label::before {
    content: '👆';
    font-size: 13px;
}

/* ──────────────────────────────────────────────────────────
 * Accessibility & UX polish (added 2026-05-17)
 * ────────────────────────────────────────────────────────── */

/* Focus ring rõ ràng cho keyboard user — chỉ hiện khi tab, không hiện khi click chuột */
.tt-aiv-bubble:focus-visible,
.tt-aiv-panel__send:focus-visible,
.tt-aiv-panel__close:focus-visible,
.tt-aiv-panel__cart-btn:focus-visible,
.tt-aiv-panel__order-btn:focus-visible,
.tt-aiv-panel__settings:focus-visible,
.tt-aiv-panel__retry-btn:focus-visible,
.tt-aiv-preview__close:focus-visible,
.tt-aiv-settings-menu__item:focus-visible {
    outline: 2px solid #c9a96e;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(201, 169, 110, 0.25);
}

/* Send button rõ ràng khi disabled (input rỗng hoặc đang stream) */
.tt-aiv-panel__send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.tt-aiv-panel__send:not(:disabled):active {
    transform: scale(0.94);
}

/* Tôn trọng user prefers-reduced-motion: tắt mọi animation không thiết yếu */
@media (prefers-reduced-motion: reduce) {
    .tt-aiv-bubble__bell,
    .tt-aiv-bubble__glow,
    .tt-aiv-bubble__pulse,
    .tt-aiv-panel__msg--typing span,
    .tt-aiv-panel,
    .tt-aiv-preview,
    .tt-aiv-overlay {
        animation: none !important;
        transition: none !important;
    }
}
