/* Scoped styles for the homepage customer-service widget. */
#chat-widget-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#chat-widget-container *, #chat-widget-container *::before, #chat-widget-container *::after { box-sizing: border-box; }
#chat-widget-container button, #chat-widget-container input { font-family: inherit; }
#chat-widget-container button { cursor: pointer; }
#chat-widget-container button:disabled { cursor: wait; opacity: .6; }
#chat-widget-container [hidden] { display: none !important; }
#chat-widget-container :focus-visible { outline: 3px solid #38bdf8; outline-offset: 2px; }
#chat-widget-container .chat-booking-link { display: block; margin-bottom: 10px; padding: 10px 20px; border-radius: 50px; background: #0f172a; color: #fff; font-weight: bold; text-align: center; text-decoration: none; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
#chat-widget-container .chat-booking-link:hover { background: #334155; }
#chat-widget-container .chat-toggle { position: relative; display: flex; align-items: center; gap: 8px; background: #0ea5e9; color: white; border: 0; border-radius: 50px; padding: 12px 24px; font-size: 16px; font-weight: bold; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
#chat-widget-container .chat-toggle:hover { background: #0284c7; }
#chat-widget-container .badge { background: #ef4444; color: white; font-size: 11px; padding: 2px 6px; border-radius: 10px; position: absolute; top: -5px; right: -5px; }
#chat-widget-container .chat-toggle.has-unread { box-shadow: 0 0 0 4px #fee2e2, 0 4px 12px rgba(0,0,0,.2); }
#chat-widget-container .chat-unread-notice { position: absolute; right: 0; bottom: 120px; width: 250px; max-width: calc(100vw - 40px); display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid #bae6fd; border-radius: 12px; background: white; color: #0f172a; font-size: 14px; line-height: 1.5; font-weight: 600; text-align: left; box-shadow: 0 5px 22px rgba(15,23,42,.17); }
#chat-widget-container .chat-unread-notice::after { content: ''; position: absolute; right: 28px; bottom: -6px; width: 10px; height: 10px; background: white; border-right: 1px solid #bae6fd; border-bottom: 1px solid #bae6fd; transform: rotate(45deg); }
#chat-widget-container #chat-unread-text { flex: 1; }
#chat-widget-container .chat-box { position: absolute; bottom: 120px; right: 0; width: 360px; height: 570px; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); background: white; border-radius: 16px; box-shadow: 0 5px 25px rgba(0,0,0,.15); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e2e8f0; }
#chat-widget-container .hidden-chat { visibility: hidden; opacity: 0; pointer-events: none; }
#chat-widget-container .chat-header { flex-shrink: 0; background: #0f172a; color: white; padding: 14px; display: flex; justify-content: space-between; align-items: center; }
#chat-widget-container .header-info { display: flex; align-items: center; gap: 10px; }
#chat-widget-container .avatar { width: 38px; height: 38px; background: #0ea5e9; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: white; border: 2px solid white; flex-shrink: 0; }
#chat-widget-container .name { font-size: 15px; }
#chat-widget-container .status { font-size: 12px; color: #4ade80; margin-top: 3px; }
#chat-widget-container #chat-service-status.is-offline { color: #cbd5e1; }
#chat-widget-container .close-btn { background: none; border: 0; color: #94a3b8; font-size: 24px; padding: 2px 4px; line-height: 1; }
#chat-widget-container .close-btn:hover { color: white; }
#chat-widget-container .chat-body { flex: 1; min-height: 0; padding: 12px; overflow-y: auto; overscroll-behavior: contain; background: #f8fafc; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
#chat-widget-container .message { display: flex; flex-direction: column; max-width: 90%; flex-shrink: 0; }
#chat-widget-container .message.system { align-self: flex-start; }
#chat-widget-container .message.user { align-self: flex-end; align-items: flex-end; }
#chat-widget-container .bubble { max-width: 100%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
#chat-widget-container .message.system .bubble { background: white; color: #334155; border: 1px solid #e2e8f0; border-top-left-radius: 2px; }
#chat-widget-container .message.user .bubble { background: #0ea5e9; color: white; border-top-right-radius: 2px; }
#chat-widget-container #chat-service-note { display: block; margin-top: 8px; color: #64748b; font-size: 12px; }
#chat-widget-container .chat-message-text { white-space: pre-wrap; }
#chat-widget-container .chat-message-image { display: block; border: 0; padding: 0; border-radius: 7px; overflow: hidden; background: transparent; width: 100%; }
#chat-widget-container .chat-message-image img { display: block; max-width: 100%; max-height: 240px; width: auto; height: auto; margin: auto; }
#chat-widget-container .chat-message-image + .chat-message-text { margin-top: 7px; }
#chat-widget-container .quick-replies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 0; padding: 8px 9px; flex-shrink: 0; background: white; border-top: 1px solid #e2e8f0; }
#chat-widget-container .quick-replies button, #chat-widget-container .quick-replies a { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 32px; background: white; border: 1px solid #cbd5e1; color: #475569; padding: 5px 3px; border-radius: 15px; font-size: 12px; line-height: 1.4; white-space: nowrap; text-decoration: none; }
#chat-widget-container .quick-replies button:hover { background: #e2e8f0; }
#chat-widget-container .quick-replies .chat-booking-quick { background: #0ea5e9; color: white; border-color: #0ea5e9; }
#chat-widget-container .quick-replies .chat-call-quick { background: #fff7ed; color: #c2410c; border-color: #ffedd5; }
#chat-widget-container .chat-store-card { flex-shrink: 0; background: white; color: #334155; border: 1px solid #dbeafe; border-radius: 12px; font-size: 13px; }
#chat-widget-container .chat-store-card summary { padding: 11px 12px; cursor: pointer; line-height: 1.7; }
#chat-widget-container .chat-store-card summary strong { color: #0f172a; }
#chat-widget-container .chat-store-address { display: block; padding-left: 18px; font-size: 12px; }
#chat-widget-container .chat-store-hint { display: block; color: #0284c7; padding-left: 18px; font-size: 12px; }
#chat-widget-container .chat-store-content { padding: 0 10px 10px; }
#chat-widget-container .chat-store-map { display: block; padding: 8px; margin: 0 0 10px; text-align: center; background: #0f172a; color: white; border-radius: 8px; font-weight: bold; text-decoration: none; }
#chat-widget-container .chat-store-content figure { margin: 0 0 10px; }
#chat-widget-container .chat-store-content figure:last-child { margin-bottom: 0; }
#chat-widget-container .chat-store-content figure a { display: block; background: #f1f5f9; border-radius: 8px; overflow: hidden; }
#chat-widget-container .chat-store-content img { display: block; width: 100%; height: auto; max-height: 230px; object-fit: contain; }
#chat-widget-container .chat-store-content figcaption { margin-top: 5px; font-size: 12px; line-height: 1.6; }
#chat-widget-container .chat-store-message { width: 90%; }
#chat-widget-container .chat-store-title { margin: 0; padding: 11px 10px 7px; color: #0f172a; font-size: 13px; line-height: 1.5; }
#chat-widget-container .chat-store-message .chat-store-address { padding: 0; font-size: 12px; font-weight: normal; color: #475569; }
#chat-widget-container .chat-store-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#chat-widget-container .chat-store-photo-grid figure { min-width: 0; margin: 0; }
#chat-widget-container .chat-store-photo-grid figure a { aspect-ratio: 4 / 3; }
#chat-widget-container .chat-store-photo-grid img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
#chat-widget-container .chat-store-photo-grid figcaption { margin-top: 4px; font-size: 11px; line-height: 1.5; }
#chat-widget-container .chat-composer { flex-shrink: 0; border-top: 1px solid #e2e8f0; background: white; }
#chat-widget-container .chat-footer { padding: 9px; display: flex; gap: 6px; align-items: center; }
#chat-widget-container #chat-input { flex: 1; width: 0; min-width: 0; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 20px; outline: none; font-size: 14px; }
#chat-widget-container #chat-input:focus { border-color: #0ea5e9; }
#chat-widget-container #chat-send-btn { flex-shrink: 0; background: #0f172a; color: white; border: 0; padding: 9px 12px; border-radius: 20px; font-size: 14px; white-space: nowrap; }
#chat-widget-container #chat-upload-btn { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #0284c7; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 50%; padding: 7px; }
#chat-widget-container #chat-upload-btn:hover { background: #e0f2fe; }
#chat-widget-container #chat-upload-btn svg { display: block; width: 20px; height: 20px; }
#chat-widget-container .chat-image-preview { padding: 9px 10px 0; display: flex; align-items: center; gap: 8px; color: #475569; font-size: 12px; }
#chat-widget-container #chat-preview-image { width: 50px; height: 50px; object-fit: cover; border-radius: 7px; border: 1px solid #e2e8f0; }
#chat-widget-container .chat-preview-description { flex: 1; min-width: 0; }
#chat-widget-container #chat-preview-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
#chat-widget-container #chat-remove-image { background: none; border: 0; color: #64748b; padding: 8px; font-size: 20px; }
#chat-widget-container #chat-send-status { margin: 0; padding: 0 10px 7px; font-size: 12px; line-height: 1.5; color: #64748b; overflow-wrap: anywhere; }
#chat-widget-container #chat-send-status:empty { display: none; }
#chat-widget-container #chat-send-status.is-error { color: #b91c1c; }
@media (max-width: 480px) {
    #chat-widget-container { --chat-mobile-bottom: max(12px, env(safe-area-inset-bottom, 0px)); bottom: var(--chat-mobile-bottom); right: 12px; display: flex; align-items: center; gap: 8px; }
    #chat-widget-container .chat-booking-link, #chat-widget-container .chat-toggle { display: flex; align-items: center; justify-content: center; height: 40px; margin: 0; padding: 8px 12px; font-size: 12px; line-height: 1.3; white-space: nowrap; }
    #chat-widget-container .chat-toggle { width: 40px; padding: 0; gap: 0; border-radius: 50%; }
    #chat-widget-container .chat-toggle .icon { font-size: 18px; }
    #chat-widget-container .chat-toggle .text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    #chat-widget-container .chat-unread-notice { bottom: 54px; max-width: calc(100vw - 24px); padding: 10px 12px; font-size: 13px; }
    #chat-widget-container .chat-box { position: fixed; left: 12px; right: 12px; width: auto; bottom: calc(var(--chat-mobile-bottom) + 58px); height: min(570px, calc(100vh - var(--chat-mobile-bottom) - 78px)); height: min(570px, calc(100dvh - var(--chat-mobile-bottom) - 78px)); max-height: calc(100vh - var(--chat-mobile-bottom) - 78px); max-height: calc(100dvh - var(--chat-mobile-bottom) - 78px); }
    #chat-widget-container .chat-body { padding: 10px; }
    #chat-widget-container #chat-input { font-size: 16px; padding-left: 9px; padding-right: 9px; }
    #chat-widget-container #chat-send-btn { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    #chat-widget-container .chat-body { scroll-behavior: auto; }
}
