/* Qonscience Store Assistant */

.qcb-root {
  --qcb-ink: #111111;
  --qcb-paper: #f2f0ea;
  --qcb-white: #ffffff;
  --qcb-muted: #72726d;
  --qcb-line: rgba(17, 17, 17, 0.14);
  --qcb-accent: #f2ce2c;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: "DM Sans", Arial, sans-serif;
  color: var(--qcb-ink);
}

.qcb-root *,
.qcb-root *::before,
.qcb-root *::after {
  box-sizing: border-box;
}

.qcb-root button,
.qcb-root input,
.qcb-root textarea {
  font: inherit;
}

.qcb-root a {
  color: inherit;
  text-decoration: none;
}

.qcb-launcher {
  position: relative;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: var(--qcb-ink);
  color: var(--qcb-white);
  box-shadow: 0 16px 45px rgba(0,0,0,.24);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .25s ease, background .25s ease;
}

.qcb-launcher:hover {
  transform: translateY(-3px);
  background: var(--qcb-accent);
  color: var(--qcb-ink);
}

.qcb-launcher.is-notifying {
  animation: qcbBounce .8s ease 2;
}

.qcb-launcher__icon {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.qcb-launcher__pulse {
  position: absolute;
  inset: -5px;
  border: 1px solid var(--qcb-accent);
  border-radius: 50%;
  opacity: 0;
  animation: qcbPulse 2.6s ease-out infinite;
}

.qcb-launcher__badge {
  position: absolute;
  top: -3px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--qcb-paper);
  border-radius: 999px;
  background: var(--qcb-accent);
  color: var(--qcb-ink);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
}

.qcb-launcher__badge[hidden] {
  display: none;
}

.qcb-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(390px, calc(100vw - 28px));
  height: min(690px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid rgba(17,17,17,.18);
  background: var(--qcb-paper);
  box-shadow: 0 28px 85px rgba(0,0,0,.3);
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}

.qcb-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.qcb-header {
  min-height: 78px;
  padding: 14px 16px;
  background: var(--qcb-ink);
  color: var(--qcb-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.qcb-header__identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qcb-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--qcb-accent);
  color: var(--qcb-ink);
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 21px;
  font-weight: 800;
}

.qcb-header__identity > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qcb-header__identity strong {
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 16px;
}

.qcb-header__identity div span {
  color: rgba(255,255,255,.65);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.qcb-header__identity i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #59d687;
}

.qcb-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: transparent;
  color: var(--qcb-white);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.qcb-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 20px 16px 12px;
  background:
    linear-gradient(rgba(17,17,17,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.025) 1px, transparent 1px),
    var(--qcb-paper);
  background-size: 34px 34px;
}

.qcb-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.qcb-message--user {
  align-items: flex-end;
}

.qcb-message__bubble {
  max-width: 84%;
  padding: 11px 13px;
  border: 1px solid var(--qcb-line);
  background: var(--qcb-white);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}

.qcb-message--user .qcb-message__bubble {
  border-color: var(--qcb-ink);
  background: var(--qcb-ink);
  color: var(--qcb-white);
}

.qcb-message__time {
  margin-top: 4px;
  color: var(--qcb-muted);
  font-size: 8px;
}

.qcb-typing {
  width: 55px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--qcb-line);
  background: var(--qcb-white);
  display: flex;
  justify-content: center;
  gap: 4px;
}

.qcb-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--qcb-muted);
  animation: qcbTyping 1s ease-in-out infinite;
}

.qcb-typing span:nth-child(2) {
  animation-delay: .15s;
}

.qcb-typing span:nth-child(3) {
  animation-delay: .3s;
}

.qcb-controls {
  max-height: 345px;
  overflow-y: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--qcb-line);
  background: var(--qcb-paper);
}

.qcb-options {
  display: grid;
  gap: 8px;
}

.qcb-option {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--qcb-ink);
  background: var(--qcb-white);
  color: var(--qcb-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.qcb-option:hover {
  transform: translateX(3px);
  background: var(--qcb-accent);
}

.qcb-option--secondary {
  border-color: var(--qcb-line);
  background: transparent;
}

.qcb-back-wrap {
  margin-top: 9px;
}

.qcb-search,
.qcb-support-form {
  display: grid;
  gap: 12px;
}

.qcb-search label,
.qcb-support-form label {
  display: grid;
  gap: 7px;
  color: var(--qcb-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.qcb-search > div {
  display: grid;
  grid-template-columns: 1fr auto;
}

.qcb-search input,
.qcb-support-form input,
.qcb-support-form textarea {
  width: 100%;
  border: 1px solid var(--qcb-line);
  border-radius: 0;
  outline: none;
  background: var(--qcb-white);
  color: var(--qcb-ink);
  font-size: 13px;
}

.qcb-search input,
.qcb-support-form input {
  height: 46px;
  padding: 0 12px;
}

.qcb-support-form textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.qcb-search input:focus,
.qcb-support-form input:focus,
.qcb-support-form textarea:focus {
  border-color: var(--qcb-ink);
}

.qcb-search button,
.qcb-support-form > button {
  min-height: 46px;
  padding: 0 15px;
  border: 0;
  background: var(--qcb-ink);
  color: var(--qcb-white);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.qcb-support-form > button {
  background: var(--qcb-accent);
  color: var(--qcb-ink);
}

.qcb-loading {
  padding: 18px;
  border: 1px solid var(--qcb-line);
  background: var(--qcb-white);
  color: var(--qcb-muted);
  font-size: 12px;
}

.qcb-products {
  display: grid;
  gap: 10px;
}

.qcb-product {
  min-width: 0;
  border: 1px solid var(--qcb-line);
  background: var(--qcb-white);
  display: grid;
  grid-template-columns: 88px 1fr;
}

.qcb-product__image {
  min-height: 112px;
  background: #e7e5df;
  display: grid;
  place-items: center;
}

.qcb-product__image img {
  width: 100%;
  height: 100%;
  max-height: 125px;
  object-fit: contain;
}

.qcb-product__content {
  min-width: 0;
  padding: 10px;
}

.qcb-product__content h4 {
  margin: 0 0 7px;
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.25;
}

.qcb-product__price {
  margin-bottom: 12px;
  color: var(--qcb-muted);
  font-size: 11px;
}

.qcb-product__price del {
  opacity: .55;
}

.qcb-product__price ins {
  color: var(--qcb-ink);
  text-decoration: none;
}

.qcb-product__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qcb-product__actions a,
.qcb-product__actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--qcb-ink);
  background: transparent;
  color: var(--qcb-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.qcb-product__actions button {
  background: var(--qcb-accent);
}

.qcb-product__actions button:disabled {
  cursor: wait;
  opacity: .65;
}

.qcb-product-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.qcb-footer {
  min-height: 34px;
  padding: 0 15px;
  border-top: 1px solid var(--qcb-line);
  background: #e7e5df;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--qcb-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
}

.qcb-footer button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--qcb-ink);
  cursor: pointer;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@keyframes qcbPulse {
  0% {
    transform: scale(.82);
    opacity: 0;
  }
  22% {
    opacity: .7;
  }
  100% {
    transform: scale(1.34);
    opacity: 0;
  }
}

@keyframes qcbBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes qcbTyping {
  0%, 100% {
    opacity: .35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 600px) {
  .qcb-root {
    right: 14px;
    bottom: 14px;
  }

  .qcb-launcher {
    width: 58px;
    height: 58px;
  }

  .qcb-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    transform: translateY(20px);
  }

  .qcb-panel.is-open {
    transform: translateY(0);
  }

  .qcb-controls {
    max-height: 42vh;
  }

  .qcb-message__bubble {
    max-width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qcb-launcher,
  .qcb-panel,
  .qcb-option,
  .qcb-launcher__pulse,
  .qcb-typing span {
    animation: none !important;
    transition: none !important;
  }
}
