/* Contact bubble: bottom right of every page. One press opens WhatsApp or email; a second press goes there.
   Frosted glass so the page shows through; the open card tucks itself away after 15 seconds; on computers it opens when the mouse arrives. */
.contact-bubble {
  --cb-gap: clamp(16px, 2vw, 28px);
  --cb-lift: 0px;
  --cb-glass-wine: rgb(121 36 42 / .62);
  --cb-glass-paper: rgb(250 247 245 / .8);
  position: fixed; right: max(var(--cb-gap), env(safe-area-inset-right, 0px)); bottom: calc(max(var(--cb-gap), env(safe-area-inset-bottom, 0px)) + var(--cb-lift));
  z-index: 35; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  font-family: var(--font-text); pointer-events: none;
  transition: bottom 320ms var(--ease), opacity 240ms ease, transform 320ms var(--ease), visibility 0s linear 0s;
}
.contact-bubble > * { pointer-events: auto; }

.contact-bubble-toggle {
  display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 22px 0 17px; margin: 0;
  border: 1px solid rgb(255 255 255 / .28); border-radius: 999px; background: var(--cb-glass-wine); color: #fff;
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  font-size: var(--control); letter-spacing: .01em; line-height: 1; white-space: nowrap;
  box-shadow: 0 12px 30px -14px rgb(61 18 22 / .5), inset 0 1px 0 rgb(255 255 255 / .18);
  transition: transform 180ms var(--ease), background 200ms ease, box-shadow 200ms ease;
}
.contact-bubble-toggle svg { flex: none; width: 22px; height: 22px; }
.contact-bubble-toggle .cb-chat-icon circle { fill: rgb(121 36 42 / .75); }
.contact-bubble-toggle .cb-close-icon { display: none; }
.contact-bubble-toggle:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) {
  .contact-bubble-toggle:hover { background: rgb(121 36 42 / .82); box-shadow: 0 16px 36px -14px rgb(61 18 22 / .55), inset 0 1px 0 rgb(255 255 255 / .2); }
}
.contact-bubble-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.contact-bubble[data-open=true] .contact-bubble-toggle { background: rgb(121 36 42 / .8); }
.contact-bubble[data-open=true] .contact-bubble-toggle .cb-chat-icon { display: none; }
.contact-bubble[data-open=true] .contact-bubble-toggle .cb-close-icon { display: block; }

.contact-bubble-panel {
  position: relative; overflow: hidden;
  width: min(340px, calc(100vw - 2 * var(--cb-gap)));
  padding: 22px 22px 20px; border-radius: 18px; background: var(--cb-glass-paper); color: var(--ink);
  -webkit-backdrop-filter: blur(22px) saturate(1.35); backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgb(255 255 255 / .55);
  box-shadow: 0 30px 70px -26px rgb(61 18 22 / .42), 0 0 0 1px rgb(121 36 42 / .08), inset 0 1px 0 rgb(255 255 255 / .6);
  transform-origin: calc(100% - 40px) 100%;
}
.contact-bubble-panel[hidden] { display: none; }
/* A hairline along the bottom runs down over the 15 seconds the card stays open. */
.contact-bubble-panel::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgb(121 36 42 / .45);
  transform-origin: 0 50%; transform: scaleX(0);
}
.contact-bubble-panel.cb-in::after { animation: cb-countdown 15s linear both; }
.contact-bubble:not([data-view=choose]) .contact-bubble-panel::after { display: none; }
.contact-bubble-title { margin: 0 0 4px; font-family: var(--font-display); font-size: clamp(24px, 1.6vw, 28px); line-height: 1.1; color: var(--wine); }
.contact-bubble-note { margin: 0 0 16px; font-size: var(--small); line-height: 1.4; color: #574a4f; }
.contact-bubble-options { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.contact-bubble-options a, .contact-bubble-options button {
  width: 100%; font: inherit; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px 10px 12px;
  border: 1px solid rgb(255 255 255 / .7); border-radius: 12px; background: rgb(255 255 255 / .62); color: var(--ink); text-decoration: none;
  transition: border-color 180ms ease, transform 180ms var(--ease), background 180ms ease;
}
.contact-bubble-options a:active, .contact-bubble-options button:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .contact-bubble-options a:hover, .contact-bubble-options button:hover { border-color: rgb(121 36 42 / .45); background: rgb(255 255 255 / .78); }
}
.contact-bubble-options a:focus-visible, .contact-bubble-options button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.contact-bubble-options .cb-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.contact-bubble-options .cb-mark svg { width: 40px; height: 40px; }
.contact-bubble-options .cb-mail { background: var(--wine); color: #fff; }
.contact-bubble-options .cb-mail svg { width: 22px; height: 22px; }
.contact-bubble-options .cb-words { display: grid; gap: 2px; min-width: 0; }
.contact-bubble-options strong { font-weight: 500; font-size: var(--control); line-height: 1.2; }
.contact-bubble-options small { font-size: var(--small); line-height: 1.3; color: #574a4f; overflow-wrap: anywhere; }
.contact-bubble-options .cb-arrow { margin-left: auto; flex: none; width: 18px; height: 18px; color: var(--wine); }

/* Browsers without frosted glass get a firmer fill so the words stay readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .contact-bubble { --cb-glass-wine: rgb(121 36 42 / .88); --cb-glass-paper: rgb(250 247 245 / .95); }
}

/* Opening and closing: the card grows out of the bubble. */
.contact-bubble-panel.cb-in { animation: cb-pop-in 260ms var(--ease) both; }
.contact-bubble-panel.cb-out { animation: cb-pop-out 180ms ease-in both; }
@keyframes cb-pop-in { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes cb-pop-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.96); } }
@keyframes cb-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* The bubble arrives once the page has settled. */
.has-js .contact-bubble:not(.cb-ready) .contact-bubble-toggle { opacity: 0; transform: translateY(16px) scale(.9); }
.contact-bubble.cb-ready .contact-bubble-toggle { transition: transform 520ms var(--ease), opacity 400ms ease, background 200ms ease, box-shadow 200ms ease; }

/* Out of the way while the phone menu or a clinic popup is open. */
body:has(.header.menu-open) .contact-bubble,
body:has(dialog[open]) .contact-bubble { opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
/* The footer has its own enquiry, phone and WhatsApp: once it comes into view the bubble steps aside so it covers none of them. */
.contact-bubble.cb-away { opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 240ms ease, transform 320ms var(--ease), visibility 0s linear 320ms; }

/* ---------- Email: the enquiry form inside the card ---------- */
.contact-bubble[data-view=write] .contact-bubble-panel,
.contact-bubble[data-view=done] .contact-bubble-panel { width: min(380px, calc(100vw - 2 * var(--cb-gap))); background: rgb(250 247 245 / .96); }
/* Tall enough for the whole form on a laptop; the card scrolls inside itself on a short window. */
.contact-bubble-panel { max-height: calc(var(--cb-vh, 100dvh) - var(--cb-kb, 0px) - 54px - 12px - 2 * var(--cb-gap) - var(--cb-lift)); overflow-y: auto; overscroll-behavior: contain; }
.cb-view[hidden] { display: none; }
.cb-view.cb-swap { animation: cb-swap 240ms var(--ease) both; }
@keyframes cb-swap { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.cb-write-head { display: flex; align-items: center; gap: 8px; margin: -4px 0 4px -8px; }
.cb-write-head .contact-bubble-title { margin: 0; }
.cb-back {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--wine); cursor: pointer;
  transition: background 160ms ease, transform 160ms var(--ease);
}
.cb-back svg { width: 22px; height: 22px; }
.cb-back:active { transform: scale(.92); }
@media (hover: hover) and (pointer: fine) { .cb-back:hover { background: rgb(121 36 42 / .08); } }
.cb-back:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cb-field { display: grid; gap: 6px; margin: 0 0 12px; }
.cb-field label { font-size: 14px; line-height: 1.2; color: #4a3d42; letter-spacing: .01em; }
.cb-field input, .cb-field textarea {
  width: 100%; box-sizing: border-box; margin: 0; padding: 12px 14px;
  border: 1px solid rgb(121 36 42 / .22); border-radius: 14px; background: rgb(255 255 255 / .82); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.35;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.cb-field textarea { min-height: 104px; max-height: 220px; resize: vertical; }
.cb-field input::placeholder, .cb-field textarea::placeholder { color: #8b7d82; opacity: 1; }
.cb-field input:focus, .cb-field textarea:focus { outline: none; border-color: var(--wine); background: #fff; box-shadow: 0 0 0 3px rgb(167 52 57 / .16); }
.cb-field [aria-invalid=true] { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(167 52 57 / .14); }
.cb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cb-error { margin: 2px 0 0; font-size: 14px; line-height: 1.35; color: var(--accent); }
.cb-view-write > .cb-error { margin: 0 0 12px; }
.cb-send {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; margin: 4px 0 0; padding: 0 22px;
  border: 0; border-radius: 999px; background: var(--wine); color: #fff; cursor: pointer;
  font: inherit; font-size: var(--control); letter-spacing: .01em;
  box-shadow: 0 12px 26px -16px rgb(61 18 22 / .7);
  transition: background 180ms ease, transform 160ms var(--ease), opacity 160ms ease;
}
.cb-send:active { transform: scale(.98); }
.cb-send:disabled { opacity: .7; cursor: progress; }
@media (hover: hover) and (pointer: fine) { .cb-send:hover:not(:disabled) { background: var(--accent); } }
.cb-send:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cb-to { margin: 10px 0 0; font-size: 13px; line-height: 1.3; color: #6d5f64; text-align: center; overflow-wrap: anywhere; }
/* The thank-you. */
.cb-view-done { text-align: center; padding: 6px 4px 2px; outline: none; }
.cb-done-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; margin: 0 0 10px; border-radius: 50%; background: rgb(121 36 42 / .08); color: var(--wine); }
.cb-done-mark svg { width: 34px; height: 34px; }
.cb-view-done .contact-bubble-note { overflow-wrap: anywhere; }
.cb-view-done .cb-send { margin-top: 6px; }

/* Phones and short windows: a small glass dot, tucked close to the corner; the words go to screen readers only. */
@media (max-width: 599px), (max-height: 520px) {
  .contact-bubble { --cb-gap: 14px; gap: 10px; }
  .contact-bubble-toggle { width: 46px; height: 46px; padding: 0; justify-content: center; border-color: rgb(255 255 255 / .32); }
  .contact-bubble-toggle .cb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .contact-bubble-toggle svg { width: 20px; height: 20px; }
  /* A bigger invisible press area than the dot itself. */
  .contact-bubble-toggle::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
  .contact-bubble-toggle { position: relative; }
  .contact-bubble-panel {
    width: min(300px, calc(100vw - 2 * var(--cb-gap))); padding: 16px 14px 14px; border-radius: 16px;
    max-height: calc(var(--cb-vh, 100dvh) - var(--cb-kb, 0px) - 46px - 10px - 2 * var(--cb-gap) - var(--cb-lift)); overflow-y: auto;
  }
  .contact-bubble[data-view=write] .contact-bubble-panel,
  .contact-bubble[data-view=done] .contact-bubble-panel { width: calc(100vw - 2 * var(--cb-gap)); max-width: 400px; padding: 14px 14px 14px; }
  /* While typing, the card sits on top of the keyboard. */
  .contact-bubble[data-open=true]:not([data-view=choose]) { bottom: calc(max(var(--cb-gap), env(safe-area-inset-bottom, 0px)) + var(--cb-lift) + var(--cb-kb, 0px)); }
  .cb-field { margin-bottom: 10px; }
  .cb-field input, .cb-field textarea { padding: 11px 13px; }
  .cb-field textarea { min-height: 88px; }
  .cb-send { min-height: 48px; }
  .contact-bubble-title { font-size: 22px; }
  .contact-bubble-note { margin-bottom: 12px; font-size: 14px; }
  .contact-bubble-options { gap: 8px; }
  .contact-bubble-options a, .contact-bubble-options button { min-height: 54px; gap: 12px; padding: 8px 12px 8px 10px; border-radius: 11px; }
  .contact-bubble-options .cb-mark, .contact-bubble-options .cb-mark svg { width: 34px; height: 34px; }
  .contact-bubble-options .cb-mail svg { width: 19px; height: 19px; }
  .contact-bubble-options strong { font-size: 16px; }
  .contact-bubble-options small { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-bubble, .contact-bubble-toggle, .contact-bubble.cb-ready .contact-bubble-toggle { transition: none; }
  .contact-bubble-panel.cb-in, .contact-bubble-panel.cb-out, .cb-view.cb-swap { animation: none; }
  .cb-send, .cb-back, .cb-field input, .cb-field textarea { transition: none; }
  .contact-bubble-panel.cb-in::after { animation: none; transform: scaleX(0); }
}
@media print { .contact-bubble { display: none; } }
