/* ==========================================================================
   Online Sommelier – bordeaux met goud. --os-accent is instelbaar in WordPress (Online Sommelier > Uiterlijk).
   ========================================================================== */
#os-root {
  --os-accent: #6b1d2a;            /* bordeaux: knoppen, berichten van de bezoeker, prijzen */
  --os-wine: var(--os-accent);
  --os-dark: #4a121c;
  --os-gold: #c9a45c;
  --os-soft: #f3e8e6;
  --os-bg: #fbf7f2;
  --os-line: #e8dfd5;
  position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483000; font-family: inherit; font-size: 15px; line-height: 1.4; box-sizing: border-box;
}
@supports (color: color-mix(in srgb, red 10%, white)) {
  #os-root { --os-soft: color-mix(in srgb, var(--os-accent) 9%, #fff); --os-dark: color-mix(in srgb, var(--os-accent) 68%, #000); }
}
#os-root.os-left { right: auto; left: calc(16px + env(safe-area-inset-left, 0px)); }
#os-root *, #os-root *::before, #os-root *::after { box-sizing: border-box; }

/* Reset tegen thema's: nul specificiteit, dus onze eigen regels winnen altijd */
#os-root :where(button) { font-family: inherit; margin: 0; text-transform: none; letter-spacing: normal; text-shadow: none; box-shadow: none; line-height: 1.2; -webkit-appearance: none; appearance: none; }
#os-root :where(input, textarea) { font-family: inherit; margin: 0; box-shadow: none; }
#os-root :where(p) { margin: 0; }
#os-root button:focus-visible, #os-root a:focus-visible { outline: 2px solid var(--os-gold); outline-offset: 2px; }
#os-root input:focus-visible, #os-root textarea:focus-visible { outline: 2px solid var(--os-gold); outline-offset: 0; }

/* Zwevende knop */
#os-toggle { display: flex; align-items: center; gap: 10px; padding: 7px 20px 7px 7px; border: 0; border-radius: 999px; cursor: pointer; color: #fff; text-align: left;
  background: linear-gradient(135deg, #7d2233, var(--os-dark)); box-shadow: 0 8px 24px rgba(74,18,28,.45), inset 0 0 0 1.5px var(--os-gold); transition: transform .15s; }
#os-toggle:hover { transform: translateY(-2px); }
.os-ic { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--os-bg); color: var(--os-wine); }
#os-toggle .os-ic { animation: os-pulse 2.6s infinite; }
.os-t { display: flex; flex-direction: column; }
.os-t b { font-size: 16px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.os-t small { font-size: 12px; color: #ecd9b0; white-space: nowrap; }
@keyframes os-pulse { 0% { box-shadow: 0 0 0 0 rgba(201,164,92,.7); } 70%, 100% { box-shadow: 0 0 0 12px rgba(201,164,92,0); } }

/* Bubbeltje */
#os-tease { position: absolute; right: 0; bottom: 100px; width: 240px; padding: 12px 30px 12px 14px; background: #fff; color: #222; font-size: 14px;
  border-radius: 14px 14px 4px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); cursor: pointer; }
#os-root.os-left #os-tease { right: auto; left: 0; border-radius: 14px 14px 14px 4px; }
#os-tease[hidden], #os-win[hidden] { display: none; }
#os-tease-x { position: absolute; top: 2px; right: 6px; border: 0; background: none; font-size: 20px; color: #888; cursor: pointer; }

/* Chatvenster */
#os-win { position: absolute; right: 0; bottom: 96px; width: 380px; max-width: calc(100vw - 32px); height: 680px; max-height: calc(100vh - 140px);
  display: flex; flex-direction: column; background: var(--os-bg); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 48px rgba(0,0,0,.35); }
#os-root.os-left #os-win { right: auto; left: 0; }
#os-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fff; background: linear-gradient(135deg, #7d2233, var(--os-dark)); border-bottom: 2px solid var(--os-gold); }
#os-head .os-ic { width: 38px; height: 38px; position: relative; overflow: visible; }
#os-head .os-ic svg { width: 22px; height: 22px; }
#os-head .os-logo { width: 26px; height: 26px; border-radius: 0; object-fit: contain; display: block; }
#os-head .os-online { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; border-radius: 50%; background: #2ecc40; border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(46,204,64,.6); animation: os-live 2s infinite; }
@keyframes os-live { 0% { box-shadow: 0 0 0 0 rgba(46,204,64,.6); } 70%, 100% { box-shadow: 0 0 0 6px rgba(46,204,64,0); } }
.os-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.os-ht b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-ht small { font-size: 12px; color: #ecd9b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#os-back:not([hidden]) ~ .os-ic { display: none; }   /* met terugknop is er geen ruimte voor het logo */
#os-menu { border: 1px solid var(--os-gold); background: none; color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
#os-back { border: 0; background: none; color: #fff; font-size: 24px; line-height: 1; padding: 0 4px; cursor: pointer; }
#os-back[hidden] { display: none; }
.os-cat { display: block; align-self: stretch; padding: 11px 14px; border-radius: 12px; text-align: center; font-weight: 600; background: var(--os-gold); color: #3b1a0c !important; text-decoration: none !important; }
.os-cat:hover { filter: brightness(1.06); }
#os-close { border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; padding: 0 4px; cursor: pointer; }
#os-msgs { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.os-m { max-width: 88%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.os-bot { background: #fff; color: #222; align-self: flex-start; border: 1px solid var(--os-line); border-bottom-left-radius: 4px; }
.os-user { background: var(--os-wine); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.os-wait { display: flex; gap: 5px; padding: 14px; }
.os-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--os-wine); opacity: .35; animation: os-dot 1.2s infinite; }
.os-wait i:nth-child(2) { animation-delay: .2s; } .os-wait i:nth-child(3) { animation-delay: .4s; }
@keyframes os-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Klikopties */
.os-chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: stretch; }
.os-chip { min-height: 42px; padding: 8px 15px; border: 1.5px solid var(--os-wine); border-radius: 999px; background: #fff; color: var(--os-wine); font-size: 14px; cursor: pointer; }
.os-chip:hover, .os-chip:active { background: var(--os-wine); color: #fff; }
.os-more { border-style: dashed; font-weight: 600; }
.os-hint { flex-basis: 100%; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: #7a6a5a; }
.os-menu { flex-direction: column; }
.os-menu .os-chip { width: 100%; text-align: left; border-radius: 12px; font-size: 15px; padding: 11px 14px; }
.os-follow .os-chip { min-height: 34px; padding: 5px 12px; font-size: 13px; border-color: #c9bba9; color: #7a6a5a; }
.os-follow .os-chip:hover { color: #fff; border-color: var(--os-wine); }

/* Productkaartjes */
.os-card { display: flex; gap: 10px; align-self: stretch; padding: 8px; background: #fff; border: 1px solid var(--os-line); border-radius: 12px; }
.os-card img { width: 64px; height: 84px; object-fit: contain; flex: none; }
.os-cb { min-width: 0; flex: 1; }
.os-card strong { display: block; color: #222; overflow-wrap: anywhere; }
.os-card span.os-price { color: var(--os-wine); font-weight: 700; }
.os-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.os-btn { display: inline-block; padding: 7px 12px; border: 1px solid var(--os-wine); border-radius: 8px; background: #fff; color: var(--os-wine) !important; font-size: 13px; text-decoration: none !important; cursor: pointer; }
.os-btn.os-buy { background: var(--os-wine); color: #fff !important; }
.os-btn.os-buy[disabled] { opacity: .7; cursor: default; }
.os-btn.os-added { background: #2e7d4a; border-color: #2e7d4a; color: #fff !important; }

#os-note { padding: 5px 12px; text-align: center; font-size: 11px; color: #8a7d70; background: #fff; border-top: 1px solid var(--os-line); }

/* Invoer */
#os-form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--os-line); }
#os-in { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid #d8cdbf; border-radius: 10px; font-size: 16px; background: #fff; color: #222; }
#os-form button { padding: 0 18px; min-height: 44px; border: 0; border-radius: 10px; background: var(--os-wine); color: #fff; font-size: 15px; cursor: pointer; }

/* Mobiel: volledig scherm, knop compact */
@media (max-width: 600px) {
  #os-win { position: fixed; inset: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; }
  #os-root.os-open #os-toggle { display: none; }
  html.os-lock, html.os-lock body { overflow: hidden !important; }
  #os-toggle { padding: 6px 16px 6px 6px; }
  .os-t b { font-size: 15px; }
  #os-tease { bottom: 90px; width: min(240px, calc(100vw - 32px)); }
}

/* Klikbare webadressen in antwoorden */
.os-m a.os-link { color: var(--os-wine) !important; text-decoration: underline !important; overflow-wrap: anywhere; }

/* "Niet tevreden": contactformulier */
.os-contact { display: flex; flex-direction: column; gap: 8px; align-self: stretch; padding: 12px; background: #fff; border: 1px solid var(--os-line); border-radius: 12px; }
.os-contact label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 600; color: #5a4a3a; }
.os-contact input, .os-contact textarea { width: 100%; padding: 10px 11px; border: 1px solid #d8cdbf; border-radius: 10px; font-family: inherit; font-size: 16px; font-weight: 400; background: #fff; color: #222; }
.os-contact textarea { min-height: 56px; resize: vertical; }
.os-contact .os-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.os-priv { font-size: 12px; color: #8a7d70; }
.os-err { padding: 8px 10px; border-radius: 8px; background: #fdecea; color: #8a1f17; font-size: 13px; }
.os-err[hidden] { display: none; }
.os-cf-act { display: flex; gap: 8px; }
.os-cf-act button { min-height: 42px; padding: 0 16px; border-radius: 10px; font-size: 15px; cursor: pointer; }
.os-cf-send { flex: 1; border: 0; background: var(--os-wine); color: #fff; }
.os-cf-send[disabled] { opacity: .6; cursor: default; }
.os-cf-cancel { border: 1px solid #c9bba9; background: #fff; color: #7a6a5a; }

/* ==========================================================================
   Wijnfles-mascotte: slanke fles met donker amberglas, witte capsule en wit etiket (naar de Cornelius-fles)
   ========================================================================== */
.ob { display: block; overflow: visible; }

/* In de zwevende knop: de fles staat voor de ronde "zon" en steekt er bovenuit */
#os-toggle .os-ic { position: relative; overflow: visible; width: 54px; height: 54px; }
#os-toggle .ob { position: absolute; left: 50%; top: 50%; width: 23px; height: 57px; margin: -28.5px 0 0 -11.5px; }
.ob-mini .ob-shadow, .ob-mini .ob-td { display: none; }
#os-head .os-ic .ob-fallback { width: 14px; height: 35px; }

/* Podium bovenin het chatvenster: licht linnen, eiken plank, zonnetje */
#os-stage { position: relative; flex: none; height: 112px; overflow: hidden; background: #f3ede3; border-bottom: 1px solid var(--os-line); }
.os-sun { position: absolute; left: 0; bottom: 8px; width: 84px; height: 84px; border-radius: 50%; background: #ecdcd0; }
.os-shelf { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: #dcc7a4; }
.os-bwrap { position: absolute; left: 20px; bottom: 8px; width: 40px; height: 100px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.os-bwrap .ob { width: 100%; height: 100%; }
.os-sayw { position: absolute; left: 86px; right: 14px; top: 0; bottom: 8px; display: flex; align-items: center; pointer-events: none; }
.os-say { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; min-height: 56px; padding: 9px 14px; background: #fff; color: #4a3b30; border: 1px solid var(--os-line); border-radius: 14px; box-shadow: 0 2px 10px rgba(74,18,28,.06); font-size: 13.5px; line-height: 1.35; pointer-events: auto; }
.os-say::before { content: ''; position: absolute; left: -6px; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: #fff; border-left: 1px solid var(--os-line); border-bottom: 1px solid var(--os-line); transform: rotate(45deg); }
#os-say-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.os-pop { animation: os-pop .3s ease-out; }
@keyframes os-pop { from { opacity: .2; transform: translateY(3px) scale(.97); } to { opacity: 1; transform: none; } }
.os-dots { display: none; flex: none; gap: 4px; align-items: center; }
#os-root[data-mood="think"] .os-dots { display: inline-flex; }
.os-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--os-wine); opacity: .35; animation: os-dot 1.2s infinite; }
.os-dots i:nth-child(2) { animation-delay: .2s; } .os-dots i:nth-child(3) { animation-delay: .4s; }

/* Lage vensters (bijvoorbeeld met toetsenbord): podium krimpt, de fles kijkt over de rand */
#os-root.os-compact #os-stage { height: 70px; }
#os-root.os-compact .os-sun, #os-root.os-compact .os-shelf { display: none; }
#os-root.os-compact .os-bwrap { bottom: auto; top: -22px; width: 32px; height: 80px; left: 24px; }
#os-root.os-compact .os-sayw { bottom: 0; }
#os-root.os-compact .os-say { min-height: 46px; padding: 6px 12px; font-size: 13px; }

/* Beweging van de fles */
.ob-body { transform-box: view-box; transform-origin: 40px 198px; animation: ob-idle 6s ease-in-out infinite; }
@keyframes ob-idle { 0%, 100% { transform: rotate(-1deg) scaleY(1); } 50% { transform: rotate(1deg) scaleY(1.012); } }
#os-root[data-mood="listen"] .ob-body { animation: ob-lean 3.4s ease-in-out infinite; }
@keyframes ob-lean { 0%, 100% { transform: rotate(2deg); } 50% { transform: rotate(3.2deg); } }
#os-root[data-mood="think"] .ob-body { animation: ob-ponder 3.2s ease-in-out infinite; }
@keyframes ob-ponder { 0%, 100% { transform: rotate(-3.2deg); } 50% { transform: rotate(3.2deg); } }
#os-root[data-mood="happy"] .ob-body { animation: ob-hop .8s cubic-bezier(.3, .6, .4, 1), ob-idle 6s ease-in-out .8s infinite; }
@keyframes ob-hop { 0% { transform: none; } 30% { transform: translateY(-16px) scale(.97, 1.05); } 58% { transform: scale(1.05, .94); } 78% { transform: translateY(-3px); } 100% { transform: none; } }
#os-root[data-mood="hello"] .ob-body { animation: ob-hello 1.3s ease-in-out, ob-idle 6s ease-in-out 1.3s infinite; }
@keyframes ob-hello { 0%, 100% { transform: none; } 18% { transform: rotate(-6deg); } 36% { transform: rotate(7deg); } 54% { transform: rotate(-4deg); } 72% { transform: rotate(3deg); } }
#os-root[data-mood="oops"] .ob-body { animation: ob-shake .5s ease-in-out, ob-idle 6s ease-in-out .5s infinite; }
@keyframes ob-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px) rotate(-2deg); } 40% { transform: translateX(3px) rotate(2deg); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }

/* Gezicht: knipperen, pupillen, wenkbrauwen, mond */
.ob-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: ob-blink 5.4s infinite; transition: opacity .12s; }
@keyframes ob-blink { 0%, 92%, 100% { transform: scaleY(1); } 95.5% { transform: scaleY(.06); } }
.ob-pupils { transform: translate(calc(var(--ob-px, 0) * 1px), calc(var(--ob-py, 0) * 1px)); transition: transform .22s ease-out; }
#os-root[data-mood="think"] .ob-pupils { animation: ob-scan 3s ease-in-out infinite; }
@keyframes ob-scan { 0%, 100% { transform: translate(-2.8px, -2.8px); } 50% { transform: translate(2.8px, -3px); } }
.ob-lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); transition: transform .25s; }
#os-root[data-mood="think"] .ob-lid { transform: scaleY(.34); }
.ob-cheek { opacity: .5; transition: opacity .3s; }
#os-root[data-mood="happy"] .ob-cheek, #os-root[data-mood="hello"] .ob-cheek { opacity: .85; }
.ob-happy { opacity: 0; transition: opacity .12s; }
#os-root[data-mood="happy"] .ob-happy { opacity: 1; }
#os-root[data-mood="happy"] .ob-eyes { opacity: 0; }
.ob-brow { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .3s ease; }
#os-root[data-mood="listen"] .ob-brow, #os-root[data-mood="hello"] .ob-brow { transform: translateY(-2.2px); }
#os-root[data-mood="happy"] .ob-brow { transform: translateY(-3px); }
#os-root[data-mood="think"] .ob-brow-l { transform: translateY(-3.6px) rotate(-6deg); }
#os-root[data-mood="think"] .ob-brow-r { transform: translateY(1px) rotate(-8deg); }
#os-root[data-mood="oops"] .ob-brow-l { transform: translateY(-1px) rotate(-13deg); }
#os-root[data-mood="oops"] .ob-brow-r { transform: translateY(-1px) rotate(13deg); }
.ob-m { opacity: 0; transition: opacity .15s; }
.ob-m-smile { opacity: 1; }
#os-root[data-mood="think"] .ob-m-smile, #os-root[data-mood="happy"] .ob-m-smile, #os-root[data-mood="oops"] .ob-m-smile { opacity: 0; }
#os-root[data-mood="think"] .ob-m-hm, #os-root[data-mood="happy"] .ob-m-happy, #os-root[data-mood="oops"] .ob-m-oops { opacity: 1; }

/* Nadenken: drie gedachtebolletjes in koper */
.ob-td { fill: var(--os-wine); opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
#os-root[data-mood="think"] .ob-td { animation: ob-td 1.8s ease-in-out infinite; }
#os-root[data-mood="think"] .ob-td2 { animation-delay: .3s; }
#os-root[data-mood="think"] .ob-td3 { animation-delay: .6s; }
@keyframes ob-td { 0%, 100% { opacity: 0; transform: scale(.4); } 35%, 70% { opacity: .9; transform: scale(1); } }

@media (max-width: 600px) {
  #os-toggle .os-ic { width: 48px; height: 48px; }
  #os-toggle .ob { width: 21px; height: 52px; margin: -26px 0 0 -10.5px; }
}
@media (max-width: 340px) {
  .os-sayw { left: 76px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #os-toggle .os-ic, .os-wait i, #os-head .os-online { animation: none !important; }
  #os-toggle { transition: none; }
  .ob-body, .ob-eyes, .ob-pupils, .ob-td, .os-pop, .os-dots i { animation: none !important; }
  #os-root[data-mood="think"] .ob-td { opacity: .85; transform: none; }
  .os-dots i { opacity: .6; }
}
