/* Mitrofresh chat assistant (lead 145). Launcher markup: _inc/chat/widget.php; the panel is built by assets/js/chat.js.
   Uses the tokens of site.css. Logical properties only, so this one file also serves the right-to-left pages. */

.mfc { font-family: var(--body); }
.mfc *, .mfc *::before, .mfc *::after { box-sizing: border-box; }
.mfc button { font: inherit; }
.mfc svg { display: block; }

/* ---------- launcher ---------- */
.mfc-launch { position: fixed; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px) + var(--mfc-lift, 0px)); z-index: 70; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding-block: 6px; padding-inline: 6px 22px; border: 0; border-radius: 40px; background: var(--maroon); color: #fff; font-weight: 700; font-size: .98rem; line-height: 1.2; cursor: pointer; box-shadow: 0 18px 36px -14px rgba(43, 0, 4, .7), 0 0 0 1px rgba(255, 255, 255, .12) inset; transition: transform .3s var(--ease), background .25s, opacity .25s, bottom .3s var(--ease); }
.mfc-launch:hover { background: var(--maroon-2); transform: translateY(-3px); }
.mfc-launch:focus-visible, .mfc-ic:focus-visible, .mfc-send:focus-visible, .mfc-chip:focus-visible, .mfc-nav:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.mfc-launch-mark { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--red); display: grid; place-items: center; }
.mfc-launch-mark svg { width: 100%; height: 100%; }
.mfc.is-open .mfc-launch { opacity: 0; pointer-events: none; transform: scale(.9); }

/* ---------- panel ---------- */
.mfc-panel { position: fixed; z-index: 120; inset-inline-end: 20px; bottom: 20px; width: min(412px, calc(100vw - 40px)); height: min(720px, calc(100vh - 40px)); height: min(720px, calc(100dvh - 40px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--paper); color: var(--ink); border-radius: 16px; overflow: hidden; box-shadow: 0 36px 80px -24px rgba(43, 0, 4, .6), 0 0 0 1px var(--line); font-size: 15.5px; line-height: 1.5; animation: mfc-in .38s var(--ease); }
.mfc-panel[hidden] { display: none; }
.mfc-panel.is-still { animation: none; }
@keyframes mfc-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

/* the header is the only dark part; its bottom edge repeats the slanted cut of the logo */
.mfc-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; padding-block: 14px 28px; padding-inline: 16px 10px; margin-bottom: -16px; background: var(--maroon); color: #fff; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), 0 100%); }
.mfc-head-mark { flex: none; width: 42px; height: 42px; border-radius: 10px; overflow: hidden; background: var(--red); }
.mfc-head-mark svg { width: 100%; height: 100%; }
.mfc-head-txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.mfc-title { font: 800 1.16rem/1.05 var(--display); font-stretch: 78%; text-transform: uppercase; letter-spacing: .01em; }
.mfc-sub { font-size: .76rem; line-height: 1.25; color: rgba(255, 255, 255, .78); }
.mfc-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; transition: background .2s; }
.mfc-ic:hover { background: rgba(255, 255, 255, .14); }
.mfc-ic svg { width: 20px; height: 20px; }

/* ---------- conversation ---------- */
.mfc-log { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 34px 14px 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: rgba(65, 0, 0, .25) transparent; }
.mfc-log > * { flex: none; animation: mfc-pop .32s var(--ease); }
.mfc-panel.is-still .mfc-log > * { animation: none; }
@keyframes mfc-pop { from { opacity: 0; transform: translateY(8px); } }
.mfc-msg { display: flex; }
.mfc-user { justify-content: flex-end; }
.mfc-bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; }
.mfc-bot .mfc-bubble { background: #fff; border: 1px solid var(--line); border-end-start-radius: 5px; }
.mfc-user .mfc-bubble { background: var(--maroon); color: #fff; border-end-end-radius: 5px; white-space: pre-wrap; }
.mfc-err .mfc-bubble { background: var(--blush-2); border-color: transparent; color: var(--maroon); }
.mfc-bubble p + p, .mfc-bubble p + ul, .mfc-bubble ul + p { margin-top: 8px; }
.mfc-bubble ul { list-style: disc; padding-inline-start: 20px; display: grid; gap: 3px; }
.mfc-bubble strong { font-weight: 750; }
.mfc-bubble a { color: var(--red-d); font-weight: 650; text-underline-offset: 2px; }

/* working: three dots and what the assistant is doing */
.mfc-status { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 18px; border-end-start-radius: 5px; font-size: .86rem; color: var(--muted); }
.mfc-dots { display: inline-flex; gap: 4px; }
.mfc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: mfc-dot 1.1s ease-in-out infinite; }
.mfc-dots i:nth-child(2) { animation-delay: .15s; }
.mfc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mfc-dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- cards ---------- */
.mfc-railwrap { position: relative; margin-inline: -14px; }
.mfc-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 14px; padding: 2px 14px 6px; scrollbar-width: none; }
.mfc-rail::-webkit-scrollbar { display: none; }
.mfc-rail > * { flex: none; scroll-snap-align: start; }
.mfc-nav { position: absolute; top: calc(50% - 20px); width: 36px; height: 36px; display: none; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--maroon); cursor: pointer; box-shadow: 0 8px 18px -8px rgba(65, 0, 0, .5); }
.mfc-nav svg { width: 18px; height: 18px; }
.mfc-nav-prev { inset-inline-start: 6px; }
.mfc-nav-next { inset-inline-end: 6px; }
.mfc-nav-prev svg { transform: scaleX(-1); }
[dir="rtl"] .mfc-nav-prev svg { transform: none; }
[dir="rtl"] .mfc-nav-next svg, [dir="rtl"] .mfc-go svg, [dir="rtl"] .mfc-row-arrow svg, [dir="rtl"] .mfc-send svg { transform: scaleX(-1); }
@media (hover: hover) { .mfc-railwrap.can-prev .mfc-nav-prev, .mfc-railwrap.can-next .mfc-nav-next { display: grid; } }

.mfc-card { display: grid; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: inherit; text-decoration: none; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
a.mfc-card:hover { transform: translateY(-2px); border-color: rgba(65, 0, 0, .3); box-shadow: 0 14px 26px -16px rgba(65, 0, 0, .5); }
a.mfc-card:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.mfc-card-body { display: grid; gap: 3px; align-content: start; padding: 10px 12px 12px; min-width: 0; }
.mfc-tag { font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--red-d); }
.mfc-card-t { font-weight: 750; font-size: .95rem; line-height: 1.2; overflow-wrap: anywhere; }
.mfc-card-s { font-size: .8rem; line-height: 1.3; color: var(--muted); }
.mfc-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .82rem; font-weight: 700; color: var(--red-d); }
.mfc-go svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }

.mfc-prod { width: 156px; grid-template-rows: auto 1fr; }
/* the product photos have a white background, so the picture box is white too */
.mfc-prod-img { position: relative; aspect-ratio: 1 / .78; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.mfc-prod-img img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; transition: transform .5s var(--ease); }
a.mfc-prod:hover .mfc-prod-img img { transform: scale(1.06) rotate(-2deg); }
.mfc-prod.mfc-wide { width: auto; grid-template-rows: none; grid-template-columns: 118px minmax(0, 1fr); }
.mfc-prod.mfc-wide .mfc-prod-img { aspect-ratio: auto; min-height: 112px; border-bottom: 0; border-inline-end: 1px solid var(--line); }
.mfc-prod.mfc-wide .mfc-card-body { padding-block: 12px; align-content: center; }

.mfc-rec { width: 236px; grid-template-rows: auto 1fr; }
.mfc-rec.mfc-wide { width: auto; }
.mfc-rec.mfc-wide .mfc-rec-img { aspect-ratio: 2 / 1; }
.mfc-rec-img { position: relative; aspect-ratio: 16 / 10; background: var(--blush); overflow: hidden; }
.mfc-rec-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.mfc-rec:hover .mfc-rec-img img { transform: scale(1.05); }
.mfc-rec-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); }
.mfc-rec-meta span { display: inline-flex; align-items: center; gap: 5px; }
.mfc-rec-meta svg { width: 14px; height: 14px; color: var(--red); }

.mfc-row { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-block: 8px; padding-inline: 8px 12px; }
.mfc-row-pic { width: 54px; height: 54px; border-radius: 9px; overflow: hidden; background: var(--blush-2); display: grid; place-items: center; color: var(--red); }
.mfc-row-pic img { width: 100%; height: 100%; object-fit: cover; }
.mfc-row-pic svg { width: 22px; height: 22px; }
.mfc-row .mfc-card-body { padding: 0; }
.mfc-row .mfc-go { margin-top: 4px; }
button.mfc-card { width: 100%; font: inherit; text-align: start; cursor: pointer; }
.mfc-row-arrow { color: var(--red-d); }
.mfc-row-arrow svg { width: 18px; height: 18px; }

.mfc-contact { padding: 14px; gap: 10px; background: var(--blush-2); border-color: transparent; }
.mfc-contact-links { display: grid; gap: 8px; }
.mfc-contact-links a { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 12px; padding: 9px 12px; background: #fff; border-radius: 10px; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s var(--ease); }
.mfc-contact-links a:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -14px rgba(65, 0, 0, .6); }
.mfc-contact-links svg { grid-row: span 2; width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--maroon); color: #fff; }
.mfc-contact-links b { font-size: .8rem; font-weight: 650; color: var(--muted); }
.mfc-contact-links span { font-weight: 750; overflow-wrap: anywhere; }

/* ---------- quick replies ---------- */
.mfc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.mfc-chip { padding: 8px 14px; border: 1.5px solid rgba(65, 0, 0, .4); border-radius: 22px; background: transparent; color: var(--maroon); font-size: .88rem; font-weight: 650; line-height: 1.25; text-align: start; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.mfc-chip:hover { background: var(--maroon); border-color: var(--maroon); color: #fff; }

/* ---------- forms in the conversation ---------- */
.mfc-offer { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 48px; padding: 0 18px 0 16px; border: 0; border-radius: 26px; background: var(--red); color: #fff; font-weight: 700; font-size: .96rem; line-height: 1.2; text-align: start; cursor: pointer; box-shadow: 0 12px 22px -14px rgba(65, 0, 0, .7); transition: background .2s, transform .2s var(--ease); }
.mfc-offer:hover { background: var(--red-d); transform: translateY(-1px); }
.mfc-offer:focus-visible, .mfc-form-x:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.mfc-offer svg { flex: none; width: 20px; height: 20px; }
.mfc-offer svg:last-child { width: 18px; height: 18px; opacity: .85; transition: transform .2s var(--ease); }
.mfc-offer:hover svg:last-child { transform: translateX(3px); }
[dir="rtl"] .mfc-offer svg:last-child, [dir="rtl"] .mfc-offer:hover svg:last-child { transform: scaleX(-1); }
.mfc-form-x { position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.mfc-form-x:hover { background: var(--blush-2); color: var(--maroon); }
.mfc-form-x svg { width: 18px; height: 18px; }
.mfc-form-t { padding-inline-end: 34px; }
.mfc-form { position: relative; display: grid; gap: 11px; padding: 16px 14px 14px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 14px; }
.mfc-form-t { font: 800 1.12rem/1.1 var(--display); font-stretch: 78%; text-transform: uppercase; color: var(--maroon); }
.mfc-form-s { font-size: .86rem; color: var(--muted); margin-top: -6px; }
.mfc-f { display: grid; gap: 5px; font-size: .82rem; font-weight: 650; }
.mfc-f input, .mfc-f select, .mfc-f textarea { width: 100%; min-height: 46px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font: 400 16px/1.4 var(--body); transition: border-color .2s, background .2s; }
.mfc-f textarea { min-height: 70px; padding: 10px 12px; resize: vertical; }
.mfc-f input:focus, .mfc-f select:focus, .mfc-f textarea:focus { outline: none; border-color: var(--red); background: #fff; }
.mfc-f .is-bad { border-color: var(--red); background: var(--blush-2); }
.mfc-f i { font-style: normal; color: var(--red); }
.mfc-opts { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mfc-opts legend { padding: 0; margin-bottom: 6px; font-size: .82rem; font-weight: 650; }
.mfc-opt { position: relative; cursor: pointer; }
.mfc-opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mfc-opt span { display: inline-flex; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: .85rem; font-weight: 600; transition: background .2s, color .2s, border-color .2s; }
.mfc-opt input:checked + span { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.mfc-opt input:focus-visible + span { outline: 3px solid var(--ochre); outline-offset: 2px; }
.mfc-consent { display: flex; align-items: flex-start; gap: 9px; font-size: .8rem; line-height: 1.4; color: var(--muted); cursor: pointer; }
.mfc-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--red); }
.mfc-hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; opacity: 0; }
.mfc-submit { min-height: 48px; padding: 0 18px; border: 0; border-radius: var(--r-sm); background: var(--red); color: #fff; font-weight: 700; font-size: .96rem; cursor: pointer; transition: background .2s, transform .2s var(--ease); }
.mfc-submit:hover { background: var(--red-d); transform: translateY(-1px); }
.mfc-submit[disabled] { opacity: .6; cursor: default; transform: none; }
.mfc-form-msg { font-size: .86rem; font-weight: 650; color: var(--red-d); }
.mfc-form-msg:empty { display: none; }
.mfc-done { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 14px; background: #E9F4EB; color: #11502A; font-weight: 600; font-size: .92rem; }
.mfc-done svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: #11602F; color: #fff; }

/* ---------- input ---------- */
.mfc-bar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px; background: #fff; border-top: 1px solid var(--line); }
.mfc-bar textarea { flex: 1; min-width: 0; height: 46px; max-height: 124px; padding: 11px 16px; border: 1.5px solid transparent; border-radius: 23px; background: var(--cream); color: var(--ink); font: 400 16px/1.4 var(--body); resize: none; transition: border-color .2s, background .2s; }
.mfc-bar textarea:focus { outline: none; border-color: var(--red); background: #fff; }
.mfc-bar textarea::placeholder { color: var(--muted); opacity: 1; }
.mfc-send { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--red); color: #fff; cursor: pointer; transition: background .2s, transform .2s var(--ease), opacity .2s; }
.mfc-send:hover { background: var(--red-d); transform: scale(1.05); }
.mfc-send[disabled] { opacity: .35; cursor: default; transform: none; }
.mfc-send svg { width: 20px; height: 20px; }
.mfc-note { margin: 0; padding: 0 14px calc(9px + env(safe-area-inset-bottom, 0px)); background: #fff; font-size: .7rem; line-height: 1.35; text-align: center; color: var(--muted); }
.mfc-note a { color: inherit; }

/* ---------- small screens: the panel takes the whole screen ---------- */
@media (max-width: 980px) {
  /* the mixed-pallet bar sits at the bottom there: the launcher moves above it */
  body:has(.pallet-dock.show) .mfc-launch { bottom: calc(84px + env(safe-area-inset-bottom, 0px) + var(--mfc-lift, 0px)); }
}
@media (max-width: 600px) {
  .mfc-launch { inset-inline-end: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--mfc-lift, 0px)); min-height: 52px; padding-inline: 5px 18px; font-size: .92rem; }
  .mfc-launch-mark { width: 42px; height: 42px; }
  .mfc-panel { inset-inline: 0; top: var(--mfc-top, 0px); bottom: auto; width: 100%; height: calc(var(--mfc-vh, 100vh) - var(--mfc-plift, 0px)); border-radius: 0; box-shadow: none; }
  @supports (height: 100dvh) { .mfc-panel { height: calc(var(--mfc-vh, 100dvh) - var(--mfc-plift, 0px)); } }
  html.mfc-lock, html.mfc-lock body { overflow: hidden; }
  .mfc-bubble { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  .mfc-panel, .mfc-log > *, .mfc-dots i { animation: none; }
  .mfc-launch, .mfc-card, .mfc-prod-img img, .mfc-rec-img img { transition: none; }
}
@media print { .mfc { display: none; } }
