/* Alioli Chat - WhatsApp & Messenger */

.alc,
.alc-actions,
.alc-toast {
  --alc-wa: #25D366;
  --alc-wa-dark: #128C7E;
  --alc-ms: #0084FF;
  --alc-ms-grad: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A033FF 100%);
  --alc-text: #1f2328;
  --alc-muted: #667085;
  --alc-line: #eaecf0;
  --alc-surface: #ffffff;
  --alc-shadow: 0 12px 32px rgba(16, 24, 40, .18), 0 2px 6px rgba(16, 24, 40, .08);
  font-family: inherit;
  box-sizing: border-box;
}
.alc *, .alc *::before, .alc *::after,
.alc-actions *, .alc-actions *::before, .alc-actions *::after { box-sizing: border-box; }
.alc[hidden], .alc [hidden] { display: none !important; }
.alc-ico { width: 100%; height: 100%; display: block; }

/* ---------- container ---------- */
.alc {
  --alc-color: #25D366;
  --alc-x: 20px;
  --alc-y: 20px;
  --alc-size: 60px;
  position: fixed;
  bottom: var(--alc-y);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--alc-text);
  font-size: 14px;
  line-height: 1.4;
  pointer-events: none;
}
.alc > * { pointer-events: auto; }
.alc--right { right: var(--alc-x); align-items: flex-end; }
.alc--left { left: var(--alc-x); align-items: flex-start; }

@media (min-width: 768px) { .alc--no-desktop { display: none !important; } }
@media (max-width: 767.98px) {
  .alc--no-mobile { display: none !important; }
  .alc { --alc-x: 14px; --alc-y: 14px; --alc-size: 54px; }
}

/* ---------- launchers ---------- */
.alc-launchers { display: flex; flex-direction: column; gap: 10px; }
.alc--right .alc-launchers { align-items: flex-end; }
.alc--left .alc-launchers { align-items: flex-start; }

.alc-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.alc--left .alc-launcher { flex-direction: row-reverse; }
.alc-launcher:focus { outline: none; }
.alc-launcher:focus-visible .alc-launcher__btn { outline: 3px solid rgba(0, 0, 0, .35); outline-offset: 3px; }

.alc-launcher__btn {
  position: relative;
  width: var(--alc-size);
  height: var(--alc-size);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--alc-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  transition: transform .2s ease, box-shadow .2s ease;
}
.alc-launcher--whatsapp .alc-launcher__btn { background: var(--alc-wa); }
.alc-launcher--messenger .alc-launcher__btn { background: var(--alc-ms-grad); }
.alc-launcher--main .alc-launcher__btn { background: var(--alc-color); }
.alc-launcher:hover .alc-launcher__btn { transform: scale(1.06); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); }

.alc-launcher__icon,
.alc-launcher__x {
  position: absolute;
  width: 56%;
  height: 56%;
  transition: opacity .2s ease, transform .2s ease;
}
.alc-launcher__x { width: 40%; height: 40%; opacity: 0; transform: rotate(-90deg); }
.alc-launcher.is-active .alc-launcher__icon { opacity: 0; transform: rotate(90deg); }
.alc-launcher.is-active .alc-launcher__x { opacity: 1; transform: none; }

.alc-launcher__label {
  background: var(--alc-surface);
  color: var(--alc-text);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 767.98px) { .alc-launcher__label { display: none; } }
.alc.is-open .alc-launcher__label { display: none; }

/* subtle attention pulse once */
@media (prefers-reduced-motion: no-preference) {
  .alc-launcher--main .alc-launcher__btn::after,
  .alc--separate .alc-launcher:first-child .alc-launcher__btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 currentColor;
    color: inherit;
    animation: alc-pulse 2.4s ease-out 1.5s 2;
    pointer-events: none;
  }
}
@keyframes alc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
  100% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0); }
}

/* ---------- greeting bubble ---------- */
.alc-greeting {
  position: relative;
  max-width: 260px;
  background: var(--alc-surface);
  border-radius: 14px;
  box-shadow: var(--alc-shadow);
  padding: 12px 34px 12px 14px;
}
.alc--right .alc-greeting { border-bottom-right-radius: 4px; }
.alc--left .alc-greeting { border-bottom-left-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .alc-greeting { animation: alc-in .25s ease-out; }
}
.alc-greeting__text {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  color: var(--alc-text);
  cursor: pointer;
}
.alc-greeting__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--alc-muted);
  cursor: pointer;
}
.alc-greeting__close:hover { background: #f2f4f7; color: var(--alc-text); }

/* ---------- panel ---------- */
.alc-panel {
  width: 350px;
  max-width: calc(100vw - 2 * var(--alc-x));
  max-height: min(560px, calc(100vh - var(--alc-size) - var(--alc-y) - 40px));
  display: flex;
  flex-direction: column;
  background: var(--alc-surface);
  border-radius: 16px;
  box-shadow: var(--alc-shadow);
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .alc-panel { animation: alc-in .22s ease-out; }
}
@keyframes alc-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.alc-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 16px 18px 20px;
  background: var(--alc-color);
  color: #fff;
}
.alc--separate .alc-panel__head { background: #1f2328; }
.alc-panel__heading { flex: 1; min-width: 0; }
.alc-panel__title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; color: inherit; }
.alc-panel__sub { margin: 4px 0 0; font-size: 13px; opacity: .92; color: inherit; }
.alc-panel__close {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  cursor: pointer;
}
.alc-panel__close:hover { background: rgba(255, 255, 255, .3); }

.alc-panel__body { padding: 12px; overflow-y: auto; background: #f7f8fa; }
.alc-offline {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e6;
  color: #7a5200;
  font-size: 13px;
}
.alc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alc-item { margin: 0; padding: 0; }

.alc-agent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--alc-surface);
  border: 1px solid var(--alc-line);
  border-left: 3px solid var(--alc-wa);
  color: var(--alc-text);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.alc-agent--messenger { border-left-color: var(--alc-ms); }
.alc-agent:hover, .alc-agent:focus-visible {
  color: var(--alc-text);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, .1);
  outline: none;
}
.alc-agent:focus-visible { border-color: var(--alc-ms); }
.alc-agent[aria-disabled="true"] { cursor: default; opacity: .6; transform: none; box-shadow: none; }

.alc-agent__avatar {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
}
.alc-agent__avatar img,
.alc-agent__initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alc-agent__initials { background: var(--alc-wa-dark); color: #fff; font-weight: 700; font-size: 15px; }
.alc-agent--messenger .alc-agent__initials { background: var(--alc-ms); }
.alc-agent__badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 50%;
  border: 2px solid var(--alc-surface);
  background: var(--alc-wa);
  color: #fff;
}
.alc-agent--messenger .alc-agent__badge { background: var(--alc-ms-grad); }

.alc-agent__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.alc-agent__name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alc-agent__role { font-size: 12.5px; color: var(--alc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alc-agent__status { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--alc-muted); }
.alc-agent__status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.alc-agent.is-online .alc-agent__status { color: #067647; }
.alc-agent.is-online .alc-agent__status::before { background: #17b26a; box-shadow: 0 0 0 3px rgba(23, 178, 106, .18); }

.alc-agent__go { flex: none; width: 22px; height: 22px; color: var(--alc-wa); }
.alc-agent--messenger .alc-agent__go { color: var(--alc-ms); }

.alc-panel__note {
  margin: 0;
  padding: 10px 16px 12px;
  font-size: 12px;
  color: var(--alc-muted);
  text-align: center;
  background: var(--alc-surface);
  border-top: 1px solid var(--alc-line);
}

@media (max-width: 767.98px) {
  .alc-panel { width: calc(100vw - 2 * var(--alc-x)); }
}

/* ---------- product / cart buttons ----------
   Colours come from the module settings as CSS variables on .alc-actions
   (default #36BA9E = CozyShop "Dodaj do koszyka"). */
.alc-actions {
  --alc-btn: #36BA9E;
  --alc-btn-hover: #2B957E;
  --alc-btn-soft: #EBF8F5;
  --alc-btn-text: #FFFFFF;
  --alc-btn-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.alc-actions--cart { margin: 15px 0; }
.alc-actions .alc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--alc-btn-radius);
  border: 2px solid var(--alc-btn);
  background: var(--alc-btn);
  color: var(--alc-btn-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}
.alc-actions .alc-btn:hover,
.alc-actions .alc-btn:focus-visible {
  background: var(--alc-btn-hover);
  border-color: var(--alc-btn-hover);
  color: var(--alc-btn-text);
  text-decoration: none;
  outline: none;
}
/* "Ask" as a lighter, secondary button */
.alc-actions--ask-outline .alc-btn--ask {
  background: transparent;
  color: var(--alc-btn-hover);
}
.alc-actions--ask-outline .alc-btn--ask:hover,
.alc-actions--ask-outline .alc-btn--ask:focus-visible {
  background: var(--alc-btn-soft);
  border-color: var(--alc-btn-hover);
  color: var(--alc-btn-hover);
}
.alc-actions .alc-btn:focus-visible { box-shadow: 0 0 0 3px var(--alc-btn-soft), 0 0 0 5px var(--alc-btn); }
.alc-actions .alc-btn .alc-ico { width: 20px; height: 20px; flex: none; display: none; }
.alc-actions--icon .alc-btn .alc-ico { display: block; }
.alc-actions--upper .alc-btn { text-transform: uppercase; letter-spacing: .03em; }
.alc-actions--stacked { flex-direction: column; }
.alc-actions--stacked .alc-btn,
.alc-actions--cart .alc-btn { width: 100%; }
.alc-actions .alc-btn.is-loading { opacity: .65; cursor: progress; }
@media (max-width: 575.98px) { .alc-actions .alc-btn { width: 100%; } }

/* ---------- toast ---------- */
.alc-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 9995;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: #1f2328;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.alc-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media print { .alc, .alc-actions, .alc-toast { display: none !important; } }
