/* Comfortrek v132 — premium customer support widget */
#live-chat-widget{font-family:inherit}
#chat-toggle-btn.cr-chat-toggle{width:60px;height:60px;border-radius:20px;border:1px solid rgba(255,255,255,.14);background:linear-gradient(145deg,#1d1f1d,#0d0f0e);color:#fff;box-shadow:0 16px 40px rgba(0,0,0,.28);font-size:23px;transition:transform .2s ease,box-shadow .2s ease}
#chat-toggle-btn.cr-chat-toggle:hover{transform:translateY(-2px);box-shadow:0 20px 48px rgba(0,0,0,.34)}
#chat-window.cr-chat-window{width:min(390px,calc(100vw - 28px));height:min(620px,calc(100vh - 105px));background:var(--surface,#fff);border:1px solid rgba(30,32,30,.12);border-radius:22px;box-shadow:0 24px 70px rgba(0,0,0,.28);overflow:hidden;flex-direction:column;color:var(--text,#191b19)}
.cr-chat-head{padding:15px 17px;border-bottom:1px solid var(--line,rgba(0,0,0,.1));background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(247,246,242,.98));display:flex;align-items:center;gap:11px}
.cr-agent-avatar{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(145deg,#d9a06c,#9e5c38);color:#fff;font-weight:800;font-size:14px;box-shadow:0 8px 18px rgba(135,78,45,.2)}
.cr-agent-meta{min-width:0;flex:1}.cr-agent-name{font-weight:800;font-size:.92rem;line-height:1.1}.cr-agent-role{font-size:.7rem;color:var(--slate,#6d716e);margin-top:3px}.cr-agent-status{font-size:.68rem;color:#4d7c58;margin-top:3px}.cr-agent-status:before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:#4d7c58;margin-right:5px}
.cr-chat-close{border:0;background:transparent;color:var(--slate,#6d716e);font-size:21px;cursor:pointer;width:34px;height:34px;border-radius:10px}.cr-chat-close:hover{background:rgba(0,0,0,.06)}
.cr-chat-context{padding:9px 13px;background:rgba(181,113,66,.06);border-bottom:1px solid var(--line,rgba(0,0,0,.08));font-size:.7rem;color:var(--slate,#6d716e);display:none}.cr-chat-context.active{display:block}.cr-chat-context strong{color:var(--text,#191b19)}
#chat-messages-box.cr-chat-messages{flex:1;overflow-y:auto;padding:15px 13px 12px;scroll-behavior:smooth;background:var(--surface,#fff)}
.cr-chat-row{display:flex;margin:0 0 10px}.cr-chat-row.customer{justify-content:flex-end}.cr-chat-row.support{justify-content:flex-start}.cr-chat-bubble{max-width:84%;padding:10px 12px;border-radius:16px;font-size:.82rem;line-height:1.48;white-space:pre-wrap;word-break:break-word}.cr-chat-row.customer .cr-chat-bubble{background:#8d4e2f;color:#fff;border-bottom-right-radius:5px}.cr-chat-row.support .cr-chat-bubble{background:rgba(30,32,30,.055);color:var(--text,#191b19);border-bottom-left-radius:5px}.cr-chat-label{font-size:.62rem;color:var(--slate,#777);margin:0 0 4px 3px}.cr-chat-typing{display:inline-flex;gap:4px;align-items:center}.cr-chat-typing i{width:5px;height:5px;border-radius:50%;background:#8b8e8b;animation:crDot 1s infinite}.cr-chat-typing i:nth-child(2){animation-delay:.15s}.cr-chat-typing i:nth-child(3){animation-delay:.3s}@keyframes crDot{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}
.cr-chat-quick{display:flex;gap:7px;overflow:auto;padding:0 13px 10px;background:var(--surface,#fff)}.cr-chat-quick button{white-space:nowrap;border:1px solid var(--line,rgba(0,0,0,.12));background:transparent;color:inherit;border-radius:999px;padding:7px 10px;font:inherit;font-size:.68rem;cursor:pointer}.cr-chat-quick button:hover{background:rgba(0,0,0,.04)}
.cr-chat-compose{display:flex;gap:8px;padding:10px 11px 11px;border-top:1px solid var(--line,rgba(0,0,0,.1));background:var(--surface,#fff)}.cr-chat-compose input{min-width:0;flex:1;height:42px;border:1px solid var(--line,rgba(0,0,0,.14));background:transparent;color:inherit;border-radius:13px;padding:0 12px;font:inherit;font-size:.8rem;outline:none}.cr-chat-compose input:focus{border-color:#9e5c38;box-shadow:0 0 0 3px rgba(158,92,56,.1)}.cr-chat-compose button{height:42px;border:0;border-radius:13px;background:#9e5c38;color:#fff;padding:0 15px;font-weight:750;cursor:pointer}.cr-chat-compose button:disabled{opacity:.55;cursor:not-allowed}
.cr-handoff{margin:2px 13px 10px;padding:9px 11px;border-radius:12px;background:rgba(77,124,88,.08);border:1px solid rgba(77,124,88,.18);font-size:.7rem;color:#4d7c58;display:none}.cr-handoff.active{display:block}
@media(max-width:600px){#live-chat-widget{right:12px!important;bottom:76px!important}#chat-window.cr-chat-window{width:calc(100vw - 24px);height:min(650px,calc(100vh - 92px));border-radius:20px}.cr-chat-bubble{max-width:88%}}

/* v131 conversation realism: connection state + natural typing rhythm */
.cr-connection-bubble{display:flex;align-items:center;gap:8px;color:var(--slate,#6d716e);font-size:.74rem;background:rgba(30,32,30,.045)!important}
.cr-connection-dot{width:7px;height:7px;border-radius:50%;background:#9e5c38;box-shadow:0 0 0 4px rgba(158,92,56,.10);animation:crPulse 1.1s ease-in-out infinite}
.cr-chat-typing{min-width:72px;min-height:20px}
.cr-chat-typing .cr-typing-text{font-size:.64rem;color:var(--slate,#777);margin-left:4px}
.cr-fresh-reply{animation:crReplyIn .22s ease-out both}
@keyframes crPulse{0%,100%{opacity:.45;transform:scale(.85)}50%{opacity:1;transform:scale(1)}}
@keyframes crReplyIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}


/* v132 mobile support launcher + popup layering fix */
#live-chat-widget.cr-support-widget{
    left:auto!important;
    right:18px!important;
    bottom:22px!important;
    z-index:2147483000!important;
    width:auto;
    height:auto;
}
#chat-toggle-btn.cr-chat-toggle{
    position:relative;
    z-index:2;
    display:grid;
    place-items:center;
    margin:0;
    cursor:pointer;
}
.cr-support-greeting{
    position:absolute;
    right:0;
    bottom:70px;
    z-index:3;
    white-space:nowrap;
    padding:8px 12px;
    border:1px solid rgba(30,32,30,.12);
    border-radius:999px;
    background:var(--surface,#fff);
    color:var(--text,#191b19);
    box-shadow:0 8px 24px rgba(0,0,0,.16);
    font-size:.74rem;
    line-height:1;
    font-weight:650;
    pointer-events:none;
    animation:crGreetingIn .45s ease-out both;
}
.cr-support-greeting:after{
    content:"";
    position:absolute;
    right:18px;
    bottom:-6px;
    width:10px;
    height:10px;
    background:var(--surface,#fff);
    border-right:1px solid rgba(30,32,30,.12);
    border-bottom:1px solid rgba(30,32,30,.12);
    transform:rotate(45deg);
}
/* Keep the support window above every site header/nav and independent from page stacking contexts. */
#chat-window.cr-chat-window{
    position:fixed!important;
    right:18px!important;
    bottom:94px!important;
    z-index:2147483001!important;
    max-height:calc(100vh - 112px)!important;
}
@keyframes crGreetingIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(max-width:600px){
    #live-chat-widget.cr-support-widget{right:14px!important;bottom:78px!important}
    .cr-support-greeting{right:0;bottom:68px;font-size:.72rem;padding:8px 11px}
    #chat-window.cr-chat-window{
        position:fixed!important;
        right:10px!important;
        left:10px!important;
        bottom:76px!important;
        width:auto!important;
        height:min(650px,calc(100dvh - 92px))!important;
        max-height:calc(100dvh - 92px)!important;
        z-index:2147483001!important;
    }
}

/* v133 launcher alignment hard-fix: keep BOTH the launcher and greeting on the right.
   The launcher is intentionally fixed to the viewport instead of relying on the footer
   widget's containing block, which can be altered by storefront/theme CSS. */
#live-chat-widget.cr-support-widget{
    position:fixed!important;
    left:auto!important;
    top:auto!important;
    right:14px!important;
    bottom:78px!important;
    width:60px!important;
    height:60px!important;
    min-width:60px!important;
    min-height:60px!important;
    margin:0!important;
    padding:0!important;
    z-index:2147483640!important;
}
#live-chat-widget.cr-support-widget > #chat-toggle-btn.cr-chat-toggle{
    position:fixed!important;
    left:auto!important;
    top:auto!important;
    right:14px!important;
    bottom:78px!important;
    width:60px!important;
    height:60px!important;
    margin:0!important;
    z-index:2147483641!important;
}
#live-chat-widget.cr-support-widget > .cr-support-greeting{
    position:fixed!important;
    left:auto!important;
    top:auto!important;
    right:14px!important;
    bottom:146px!important;
    z-index:2147483642!important;
}
@media(max-width:600px){
    #live-chat-widget.cr-support-widget{
        right:14px!important;
        bottom:78px!important;
    }
    #live-chat-widget.cr-support-widget > #chat-toggle-btn.cr-chat-toggle{
        right:14px!important;
        bottom:78px!important;
    }
    #live-chat-widget.cr-support-widget > .cr-support-greeting{
        right:14px!important;
        bottom:146px!important;
    }
}

/* v134 premium support conversation surface */
.cr-chat-head{min-height:76px;padding:14px 16px;background:linear-gradient(145deg,#fffdf9,#f5f3ee)}
.cr-agent-avatar{width:46px;height:46px;border-radius:50%;font-size:13px;border:3px solid rgba(255,255,255,.9);box-shadow:0 5px 16px rgba(0,0,0,.16);position:relative}
.cr-agent-avatar:after{content:"";position:absolute;right:-1px;bottom:0;width:10px;height:10px;border-radius:50%;background:#4d9b67;border:2px solid #fff}
.cr-message-agent{display:flex;align-items:center;gap:7px;margin:0 0 4px 3px}
.cr-message-avatar{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#d9a06c,#9e5c38);color:#fff;font-size:8px;font-weight:800;box-shadow:0 3px 8px rgba(0,0,0,.12);flex:none}
.cr-message-agent .cr-chat-label{margin:0}
.cr-customer-card{margin:9px 13px 5px;padding:11px 12px;border:1px solid rgba(181,113,66,.18);border-radius:15px;background:linear-gradient(145deg,rgba(181,113,66,.08),rgba(255,255,255,.55));font-size:.72rem}
.cr-customer-card[hidden]{display:none}
.cr-card-eyebrow{font-size:.58rem;letter-spacing:.14em;font-weight:800;color:#8f684d;margin-bottom:7px}
.cr-order-card-row{display:flex;justify-content:space-between;gap:10px;align-items:center}.cr-order-card-row strong{display:block;font-size:.78rem}.cr-order-card-row span{display:block;color:var(--slate,#777);margin-top:2px;line-height:1.35}.cr-order-status{padding:5px 8px;border-radius:999px;background:rgba(77,124,88,.1);color:#4d7c58!important;font-weight:700;white-space:nowrap;text-transform:capitalize}.cr-context-action{margin-top:9px;border:0;border-radius:10px;padding:7px 10px;background:#1d1f1d;color:#fff;font:inherit;font-size:.68rem;font-weight:750;cursor:pointer}
.cr-chat-icon{display:block;line-height:1}
#live-chat-widget.cr-support-widget.cr-support-open > #chat-toggle-btn{visibility:hidden!important;pointer-events:none}
@media(max-width:600px){#chat-window.cr-chat-window{right:8px!important;left:8px!important;width:auto!important;border-radius:22px}.cr-chat-compose{padding-bottom:max(11px,env(safe-area-inset-bottom))}.cr-customer-card{margin-left:11px;margin-right:11px}}

.cr-support-suggestions{margin:2px 13px 10px}.cr-suggestion-title{font-size:.66rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--slate,#777);margin-bottom:7px}.cr-suggestion-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.cr-suggestion-card{min-width:0;text-decoration:none;color:inherit;border:1px solid var(--line,rgba(0,0,0,.1));border-radius:12px;overflow:hidden;background:rgba(0,0,0,.025)}.cr-suggestion-card img{width:100%;height:62px;object-fit:cover;display:block;background:#eee}.cr-suggestion-card span{display:block;padding:6px}.cr-suggestion-card strong{display:block;font-size:.62rem;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cr-suggestion-card small{display:block;margin-top:3px;font-size:.61rem;color:#8f684d;font-weight:750}.cr-support-promo{margin:2px 13px 10px;padding:10px 11px;border-radius:13px;background:linear-gradient(145deg,#fff4cf,#fffaf0);border:1px solid rgba(188,139,47,.24);display:flex;align-items:center;justify-content:space-between;gap:10px}.cr-support-promo strong{display:block;font-size:.7rem}.cr-support-promo span{display:block;font-size:.61rem;color:#777;margin-top:3px}.cr-support-promo a{flex:none;text-decoration:none;border-radius:9px;padding:7px 9px;background:#f4c64d;color:#171717;font-size:.62rem;font-weight:800}@media(max-width:600px){.cr-suggestion-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.cr-suggestion-card img{height:58px}}


/* v135 — launcher greeting must disappear together with the support icon while chat is open. */
#live-chat-widget.cr-support-widget.is-open > #chat-toggle-btn.cr-chat-toggle,
#live-chat-widget.cr-support-widget.is-open > .cr-support-greeting{
    visibility:hidden!important;
    pointer-events:none!important;
}

/* v137: prevent short customer messages such as 'hello' from collapsing into character-per-line bubbles. */
.cr-chat-row>div{min-width:0;max-width:84%;width:max-content;flex:0 1 auto}
.cr-chat-row.customer>div{max-width:84%;width:max-content}
.cr-chat-row .cr-chat-bubble{max-width:100%;width:max-content;overflow-wrap:anywhere;word-break:normal}
@media(max-width:600px){.cr-chat-row>div,.cr-chat-row.customer>div{max-width:88%}}
.cr-chat-quick.is-dynamic{padding-top:2px}


/* v138 — conversational readability: preserve intentional line breaks without breaking short messages. */
.cr-chat-bubble{white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;line-height:1.48;}
.cr-chat-row.customer .cr-chat-bubble{white-space:pre-wrap;}
