/* inShop chat widget — Electro theme aligned, no external lib */

.inshop-chat-root {
  --inshop-chat-accent: #0787ea;
  --inshop-chat-accent-dark: #0568b8;
  --inshop-chat-bg: #ffffff;
  --inshop-chat-text: #333e48;
  --inshop-chat-muted: #6c757d;
  --inshop-chat-border: #e3e3e3;
  --inshop-chat-fab-size: 56px;
  --inshop-chat-fab-gap: 12px;
  /* style3.css #scrollUp: bottom/right 1.25rem, height 2.625rem */
  --inshop-chat-scrollup-stack: calc(1.25rem + 2.625rem + 16px);
  --inshop-chat-safe-bottom: env(safe-area-inset-bottom, 0px);
  --inshop-chat-vv-top: auto;
  --inshop-chat-vv-height: min(520px, calc(100dvh - 180px));
  font-family: "Open Sans", Arial, sans-serif;
}

.inshop-chat-root .inshop-chat-icon,
.inshop-chat-root .inshop-chat-icon path {
  display: block;
  fill: currentColor;
}

.inshop-chat-toggle {
  position: fixed;
  right: 16px;
  bottom: calc(var(--inshop-chat-scrollup-stack) + var(--inshop-chat-safe-bottom));
  z-index: 9986;
  width: var(--inshop-chat-fab-size);
  height: var(--inshop-chat-fab-size);
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--inshop-chat-accent) 0%, var(--inshop-chat-accent-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(7, 135, 234, 0.38);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.inshop-chat-toggle:hover,
.inshop-chat-toggle:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(7, 135, 234, 0.45);
  outline: none;
}

.inshop-chat-toggle-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.inshop-chat-toggle-icon--chat {
  opacity: 1;
  transform: scale(1);
}

.inshop-chat-toggle-icon--close {
  opacity: 0;
  transform: scale(0.7);
}

.inshop-chat-root.is-open .inshop-chat-toggle {
  background: #333e48;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.inshop-chat-root.is-open .inshop-chat-toggle-icon--chat {
  opacity: 0;
  transform: scale(0.7);
}

.inshop-chat-root.is-open .inshop-chat-toggle-icon--close {
  opacity: 1;
  transform: scale(1);
}

.inshop-chat-panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--inshop-chat-scrollup-stack) + var(--inshop-chat-fab-size) + var(--inshop-chat-fab-gap) + var(--inshop-chat-safe-bottom));
  z-index: 9985;
  width: min(360px, calc(100vw - 32px));
  max-height: min(520px, calc(100dvh - 180px));
  background: var(--inshop-chat-bg);
  border: 1px solid var(--inshop-chat-border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.inshop-chat-panel.is-open {
  display: flex;
}

.inshop-chat-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 0 0 auto;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(135deg, var(--inshop-chat-accent) 0%, var(--inshop-chat-accent-dark) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.inshop-chat-header-text {
  flex: 1;
  min-width: 0;
}

.inshop-chat-header-title {
  display: block;
  line-height: 1.25;
}

.inshop-chat-header small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  opacity: 0.92;
  margin-top: 2px;
  line-height: 1.35;
}

.inshop-chat-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
}

.inshop-chat-close:hover,
.inshop-chat-close:focus {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}

.inshop-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  background: #f8f9fa;
  min-height: 200px;
  -webkit-overflow-scrolling: touch;
}

.inshop-chat-msg {
  margin-bottom: 10px;
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.inshop-chat-msg--user {
  margin-left: auto;
  background: var(--inshop-chat-accent);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.inshop-chat-msg--bot {
  width: 92%;
  max-width: 92%;
  box-sizing: border-box;
  background: #fff;
  color: var(--inshop-chat-text);
  border: 1px solid var(--inshop-chat-border);
  border-bottom-left-radius: 2px;
}

.inshop-chat-msg--typing {
  color: var(--inshop-chat-muted);
  font-style: italic;
}

.inshop-chat-sources {
  margin-top: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inshop-chat-sources a {
  color: var(--inshop-chat-accent);
  text-decoration: underline;
}

.inshop-chat-product-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--inshop-chat-border);
  padding-top: 8px;
}

.inshop-chat-product-list li {
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.35;
}

.inshop-chat-product-list li:last-child {
  margin-bottom: 0;
}

.inshop-chat-product-list a {
  color: var(--inshop-chat-accent);
  text-decoration: none;
  font-weight: 600;
  display: inline;
}

.inshop-chat-product-list a:hover,
.inshop-chat-product-list a:focus {
  text-decoration: underline;
}

.inshop-chat-product-price {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--inshop-chat-text);
}

.inshop-chat-product-stock {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: var(--inshop-chat-muted);
}

.inshop-chat-msg--bot a {
  color: var(--inshop-chat-accent);
  text-decoration: underline;
}

.inshop-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  padding-bottom: calc(10px + var(--inshop-chat-safe-bottom));
  border-top: 1px solid var(--inshop-chat-border);
  background: #fff;
  flex: 0 0 auto;
  margin-top: auto;
}

.inshop-chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--inshop-chat-border);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.3;
  height: 40px;
}

.inshop-chat-input:focus {
  outline: none;
  border-color: var(--inshop-chat-accent);
  box-shadow: 0 0 0 2px rgba(7, 135, 234, 0.15);
}

.inshop-chat-send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--inshop-chat-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.inshop-chat-send:hover:not(:disabled),
.inshop-chat-send:focus:not(:disabled) {
  background: var(--inshop-chat-accent-dark);
  outline: none;
  transform: scale(1.04);
}

.inshop-chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 575px) {
  body.inshop-chat-open {
    overflow: hidden;
  }

  .inshop-chat-root {
    --inshop-chat-fab-size: 52px;
  }

  .inshop-chat-toggle {
    right: 12px;
  }

  /* Nyitott panel: teljes szélességű alsó lap — iOS billentyűzet-barát */
  .inshop-chat-root.is-open .inshop-chat-toggle {
    display: none;
  }

  .inshop-chat-root.is-open .inshop-chat-panel {
    left: 0;
    right: 0;
    width: auto;
    max-height: none;
    z-index: 9995;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .inshop-chat-root.is-open.is-keyboard-open .inshop-chat-panel {
    border-radius: 0;
  }

  .inshop-chat-root.is-open.is-keyboard-open .inshop-chat-header {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .inshop-chat-root.is-open.is-keyboard-open .inshop-chat-header small {
    display: none;
  }

  .inshop-chat-root.is-open.is-keyboard-open .inshop-chat-form {
    padding-bottom: 10px;
  }

  .inshop-chat-root.is-open .inshop-chat-messages {
    min-height: 0 !important;
    flex: 1 1 0;
  }

  .inshop-chat-input {
    font-size: 16px;
  }
}

/* Nyitott chat alatt a scrollUp ne takarjon / ne csússzon a FAB alá */
body.inshop-chat-open #scrollUp {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media print {
  .inshop-chat-root {
    display: none !important;
  }
}
