/* Hotel Presidency chat assistant */
.hpchat {
    --hp-gold: #BB913F;
    --hp-gold-soft: #F1D8B8;
    --hp-ink: #1a1a1a;
    --hp-muted: #6b6b6b;
    --hp-bg: #ffffff;
    --hp-bubble: #f5f1ea;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000000;
    font-family: 'Poppins', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: var(--hp-ink);
}

/* Keep the theme's back-to-top button clear of the launcher */
#back-to-top {
    bottom: 100px !important;
    right: 32px !important;
    transform: translateY(240px);
    opacity: 0;
}
#back-to-top.scrolldown {
    transform: none;
    opacity: 1;
}

/* ----- Launcher ----- */
.hpchat-launcher {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    background: var(--hp-gold);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background .3s;
    position: relative;
    animation: hpchat-arrive .7s cubic-bezier(.34, 1.56, .64, 1) 1.5s both;
}
.hpchat-launcher:hover { transform: scale(1.07); background: #a87f33; }
.hpchat-launcher:focus-visible { outline: 3px solid var(--hp-gold-soft); outline-offset: 3px; }
.hpchat-launcher svg { width: 26px; height: 26px; grid-area: 1 / 1; transition: opacity .25s, transform .35s; }
.hpchat-icon-close { opacity: 0; transform: rotate(-90deg); }
.hpchat.is-open .hpchat-icon-open { opacity: 0; transform: rotate(90deg); }
.hpchat.is-open .hpchat-icon-close { opacity: 1; transform: none; }

/* soft ring that breathes until the chat has been opened once */
.hpchat-launcher:before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--hp-gold);
    animation: hpchat-ring 2.8s ease-out 3s infinite;
    pointer-events: none;
}
.hpchat.is-open .hpchat-launcher:before { animation: none; opacity: 0; }

@keyframes hpchat-arrive { from { opacity: 0; transform: scale(.4) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes hpchat-ring { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.6); opacity: 0; } }

/* ----- Greeting bubble ----- */
.hpchat-greet {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: max-content;
    max-width: 230px;
    background: var(--hp-bg);
    padding: 12px 34px 12px 16px;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .4s, transform .4s cubic-bezier(.22, .61, .36, 1), visibility 0s .4s;
}
.hpchat-greet.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.hpchat.is-open .hpchat-greet { display: none; }
.hpchat-greet-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: none;
    font-size: 18px;
    line-height: 1;
    color: var(--hp-muted);
    cursor: pointer;
    padding: 4px;
}

/* ----- Panel ----- */
.hpchat-panel {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: var(--hp-bg);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.97);
    transform-origin: bottom right;
    transition: opacity .3s, transform .35s cubic-bezier(.22, .61, .36, 1), visibility 0s .35s;
}
.hpchat.is-open .hpchat-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.hpchat-head {
    background: #000;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
}
.hpchat-head img { width: 74px; height: auto; }
.hpchat-head strong { display: block; font-size: 15px; font-weight: 500; letter-spacing: .3px; }
.hpchat-head span { font-size: 12px; color: #bdbdbd; display: flex; align-items: center; gap: 6px; }
.hpchat-head span i { width: 7px; height: 7px; border-radius: 50%; background: #4caf50; display: inline-block; }

.hpchat-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fbfaf7;
}
.hpchat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    animation: hpchat-msg .35s cubic-bezier(.22, .61, .36, 1) both;
    overflow-wrap: anywhere;
}
.hpchat-bot { background: var(--hp-bubble); border-bottom-left-radius: 4px; align-self: flex-start; }
.hpchat-me { background: var(--hp-gold); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.hpchat-msg ul { margin: 6px 0; padding-left: 18px; list-style: disc; }
.hpchat-msg li { margin: 2px 0; }
.hpchat-msg a { color: #8a6420; text-decoration: underline; text-underline-offset: 2px; }
.hpchat-msg a.hpchat-cta {
    display: block;
    margin: 10px 0 8px;
    padding: 9px 14px;
    background: var(--hp-gold);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
}
.hpchat-msg a.hpchat-cta:hover { background: #a87f33; }
@keyframes hpchat-msg { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hpchat-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.hpchat-dots i { width: 7px; height: 7px; border-radius: 50%; background: #b9ad97; animation: hpchat-dot 1.2s infinite ease-in-out; }
.hpchat-dots i:nth-child(2) { animation-delay: .15s; }
.hpchat-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes hpchat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.hpchat-chips {
    flex: none;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 12px 4px;
    border-top: 1px solid #eee;
    scrollbar-width: none;
}
.hpchat-chips::-webkit-scrollbar { display: none; }
.hpchat-chips button {
    flex: none;
    border: 1px solid var(--hp-gold);
    background: #fff;
    color: #8a6420;
    border-radius: 999px;
    padding: 5px 12px;
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.hpchat-chips button:hover { background: var(--hp-gold); color: #fff; }

.hpchat-form { flex: none; display: flex; gap: 8px; padding: 10px 12px 12px; }
.hpchat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    color: var(--hp-ink);
    background: #fff;
}
.hpchat-input:focus { outline: none; border-color: var(--hp-gold); }
.hpchat-form button {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    border: 0;
    background: #000;
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.hpchat-form button svg { width: 18px; height: 18px; }
.hpchat-form button:hover { background: var(--hp-gold); }

@media (max-width: 480px) {
    .hpchat { right: 16px; bottom: 16px; }
    .hpchat-launcher { width: 54px; height: 54px; }
    .hpchat-panel { bottom: 68px; height: calc(100vh - 110px); }
    #back-to-top { bottom: 84px !important; right: 20px !important; }
}

@media (prefers-reduced-motion: reduce) {
    .hpchat-launcher, .hpchat-launcher:before, .hpchat-msg, .hpchat-dots i { animation: none; }
    .hpchat-panel, .hpchat-greet { transition: opacity .2s, visibility 0s .2s; transform: none; }
}

/* Stay out of the way of the slide-in menu and booking popup */
body.mobile-menu-open .hpchat,
body.book-active .hpchat {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
@media (max-width: 1024px) {
    /* under 16px, iOS zooms the page when the field is focused */
    .hpchat-input { font-size: 16px; }
    .hpchat-greet-close { top: 0; right: 0; padding: 10px; }
}
