.sorianochat {
  --sorianochat-burgundy: #7b1e2b;
  --sorianochat-text: #1f1f1f;
  --sorianochat-muted: #6f6f6f;
  --sorianochat-line: #e6e0dd;
  --sorianochat-soft: #f8f4f2;
  color: var(--sorianochat-text);
  font-family: inherit;
  position: static;
  z-index: 10050;
  isolation: isolate;
}

.sorianochat [hidden] {
  display: none !important;
}

.sorianochat__launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 10px 16px 10px 12px;
  box-sizing: border-box;
  border: 0;
  border-radius: 24px;
  background: var(--sorianochat-burgundy);
  color: #fff;
  box-shadow: 0 12px 32px rgba(41, 18, 20, .24);
  cursor: pointer;
  font-weight: 700;
}

.sorianochat__launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
  overflow: hidden;
}

.sorianochat__launcher-icon img,
.sorianochat__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sorianochat__panel {
  position: fixed;
  right: 20px;
  bottom: 82px;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 112px));
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid var(--sorianochat-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(31, 31, 31, .22);
  box-sizing: border-box;
  z-index: 10051;
}

.sorianochat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--sorianochat-line);
  background: #fff;
  box-sizing: border-box;
}

.sorianochat__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.sorianochat__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sorianochat-burgundy);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.sorianochat__identity h2 {
  margin: 0;
  color: var(--sorianochat-text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sorianochat__identity p {
  margin: 2px 0 0;
  color: var(--sorianochat-muted);
  font-size: 12px;
  line-height: 1.25;
}

.sorianochat__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.sorianochat__icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 10px;
  background: transparent;
  color: #5f5f5f;
  cursor: pointer;
  line-height: 1;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.sorianochat__css-icon {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  pointer-events: none;
  box-sizing: border-box;
}

/* Iconos hechos solo con CSS para evitar que los estilos globales del tema
   modifiquen fill/stroke de los SVG del chat. */
.sorianochat__css-icon--close::before,
.sorianochat__css-icon--close::after {
  content: "" !important;
  position: absolute;
  top: 8px;
  left: 1px;
  width: 16px;
  height: 2px;
  border: 0 !important;
  border-radius: 2px;
  background: currentColor !important;
  box-shadow: none !important;
}

.sorianochat__css-icon--close::before {
  transform: rotate(45deg);
}

.sorianochat__css-icon--close::after {
  transform: rotate(-45deg);
}

.sorianochat__css-icon--reset::before {
  content: "" !important;
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor !important;
  border-right-color: transparent !important;
  border-radius: 50%;
  background: transparent !important;
  box-shadow: none !important;
  transform: rotate(-28deg);
  box-sizing: border-box;
}

.sorianochat__css-icon--reset::after {
  content: "" !important;
  position: absolute;
  top: 0px;
  right: 0px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent !important;
  border-bottom: 4px solid transparent !important;
  border-left: 6px solid currentColor !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: rotate(-18deg);
}

.sorianochat__icon-button:hover {
  border-color: #eadbdd;
  background: #faf3f4;
  color: var(--sorianochat-burgundy);
}

.sorianochat__icon-button:active {
  transform: scale(.94);
}

.sorianochat__icon-button:focus-visible {
  outline: 2px solid rgba(123, 30, 43, .22);
  outline-offset: 2px;
  border-color: var(--sorianochat-burgundy);
  color: var(--sorianochat-burgundy);
}

.sorianochat__icon-button--close:hover {
  background: var(--sorianochat-burgundy);
  border-color: var(--sorianochat-burgundy);
  color: #fff;
}

.sorianochat__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: var(--sorianochat-soft);
}

.sorianochat__message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sorianochat__message--assistant {
  align-self: flex-start;
  border: 1px solid var(--sorianochat-line);
  background: #fff;
}

.sorianochat__message--user {
  align-self: flex-end;
  background: var(--sorianochat-burgundy);
  color: #fff;
}


.sorianochat__inline-action {
  display: flex;
  justify-content: flex-start;
  margin: -2px 0 10px 0;
}

.sorianochat__inline-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #7b1e2b;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  line-height: 1.2;
}

.sorianochat__inline-action-link:hover,
.sorianochat__inline-action-link:focus-visible {
  filter: brightness(.92);
  color: #fff !important;
  text-decoration: none !important;
}

.sorianochat__products {
  display: grid;
  gap: 8px;
  width: 100%;
}

.sorianochat__products-title {
  color: var(--sorianochat-text);
  font-size: 12px;
  font-weight: 800;
}

.sorianochat__product {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sorianochat-line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.sorianochat__product--primary {
  border-color: rgba(123, 30, 43, .42);
  box-shadow: 0 8px 24px rgba(123, 30, 43, .08);
}

.sorianochat__product--primary::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--sorianochat-burgundy);
  z-index: 1;
}

.sorianochat__product:hover,
.sorianochat__product:focus-within {
  border-color: var(--sorianochat-burgundy);
  box-shadow: 0 8px 22px rgba(41, 18, 20, .10);
}

.sorianochat__product-main {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  min-height: 104px;
  color: var(--sorianochat-text) !important;
  text-decoration: none !important;
}

.sorianochat__product-main:hover,
.sorianochat__product-main:focus-visible {
  color: var(--sorianochat-text) !important;
  text-decoration: none !important;
}

.sorianochat__product-image {
  width: 82px;
  height: 100%;
  min-height: 104px;
  object-fit: contain;
  background: #fff;
}

.sorianochat__product-image--error {
  visibility: hidden;
}

.sorianochat__product-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 10px 9px 0;
}

.sorianochat__product-label {
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f7ecee;
  color: var(--sorianochat-burgundy);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.sorianochat__product--primary .sorianochat__product-label {
  background: var(--sorianochat-burgundy);
  color: #fff;
}

.sorianochat__product-name {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
}

.sorianochat__product-variant {
  margin-top: 3px;
  color: #4f4f4f;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
}

.sorianochat__product-reason {
  margin-top: 4px;
  color: var(--sorianochat-muted);
  font-size: 11px;
  line-height: 1.3;
}

.sorianochat__product-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 7px;
}

.sorianochat__product-price {
  color: var(--sorianochat-burgundy);
  font-size: 15px;
  font-weight: 800;
}

.sorianochat__product-previous {
  color: var(--sorianochat-muted);
  font-size: 11px;
}

.sorianochat__product-stock {
  width: 100%;
  color: #7a5520;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.sorianochat__product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 8px 9px 9px;
  border-top: 1px solid #f0e9e7;
  background: #fff;
}

.sorianochat__product-view,
.sorianochat__product-cart,
.sorianochat__product-cart-link {
  min-height: 36px;
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
}

.sorianochat__product-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8c5c9;
  background: #fff;
  color: var(--sorianochat-burgundy) !important;
}

.sorianochat__product-cart {
  border: 1px solid var(--sorianochat-burgundy);
  background: var(--sorianochat-burgundy);
  color: #fff;
}

.sorianochat__product--primary .sorianochat__product-cart {
  box-shadow: 0 5px 14px rgba(123, 30, 43, .16);
}

.sorianochat__product-view:hover,
.sorianochat__product-view:focus-visible {
  background: #faf3f4;
  color: var(--sorianochat-burgundy) !important;
}

.sorianochat__product-cart:hover:not(:disabled),
.sorianochat__product-cart:focus-visible:not(:disabled) {
  filter: brightness(.92);
}

.sorianochat__product-cart.is-loading,
.sorianochat__product-cart:disabled {
  cursor: default;
  opacity: .72;
}

.sorianochat__product-cart.is-success {
  border-color: #55765b;
  background: #55765b;
  opacity: 1;
}

.sorianochat__product-cart-link {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8c5c9;
  background: #f9f7f6;
  color: var(--sorianochat-text) !important;
}

.sorianochat__product-cart-error {
  grid-column: 1 / -1;
  color: #9b2d2d;
  font-size: 10px;
  line-height: 1.25;
}

.sorianochat__typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 14px;
  border-top: 1px solid var(--sorianochat-line);
  background: #fff;
}

.sorianochat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sorianochat-burgundy);
  opacity: .35;
  animation: sorianochatPulse 1s infinite ease-in-out;
}

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

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

.sorianochat__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--sorianochat-line);
  background: #fff;
}

.sorianochat__input {
  width: 100%;
  max-height: 120px;
  min-height: 42px;
  resize: none;
  border: 1px solid var(--sorianochat-line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--sorianochat-text);
  font: inherit;
  line-height: 1.35;
}

.sorianochat__input:focus {
  border-color: var(--sorianochat-burgundy);
  outline: 2px solid rgba(123, 30, 43, .14);
}

.sorianochat__send {
  min-width: 74px;
  border: 0;
  border-radius: 8px;
  background: var(--sorianochat-burgundy);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.sorianochat__send:disabled {
  cursor: wait;
  opacity: .6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes sorianochatPulse {
  0%, 80%, 100% {
    opacity: .35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (max-width: 767px) {
  .sorianochat__launcher {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .sorianochat__panel {
    inset: 0;
    width: 100vw;
    height: 100vh;
    border: 0;
    border-radius: 0;
    z-index: 10051;
  }

  .sorianochat__header {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .sorianochat__icon-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .sorianochat__action-icon {
    width: 20px;
    height: 20px;
  }

  .sorianochat__form {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  .sorianochat__product-actions {
    grid-template-columns: 1fr;
  }

  .sorianochat__product-cart-link,
  .sorianochat__product-cart-error {
    grid-column: 1;
  }
}

/* 0.8.0 · asesor guiado y comparativa */
.sorianochat__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: -2px;
  padding: 0 2px 2px;
}

.sorianochat__quick-reply {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #dcc9cd;
  border-radius: 999px;
  background: #fff;
  color: var(--sorianochat-burgundy);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.sorianochat__quick-reply:hover,
.sorianochat__quick-reply:focus-visible {
  border-color: var(--sorianochat-burgundy);
  background: #f9eff1;
  color: var(--sorianochat-burgundy);
  outline: none;
}

.sorianochat__quick-reply:active {
  transform: translateY(1px);
}

.sorianochat__quick-reply:disabled {
  cursor: default;
  opacity: .5;
}

.sorianochat__comparison {
  overflow: hidden;
  width: 100%;
  border: 1px solid #dbc9cc;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(60, 29, 34, .06);
}

.sorianochat__comparison-title {
  padding: 9px 11px;
  border-bottom: 1px solid #efe4e6;
  color: var(--sorianochat-text);
  font-size: 12px;
  font-weight: 800;
}

.sorianochat__comparison-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sorianochat__comparison-table {
  width: 100%;
  min-width: 330px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--sorianochat-text);
  font-size: 10.5px;
}

.sorianochat__comparison-table th,
.sorianochat__comparison-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f1e9ea;
  vertical-align: top;
  text-align: left;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sorianochat__comparison-table thead th {
  background: #fbf7f8;
  color: var(--sorianochat-burgundy);
  font-weight: 800;
}

.sorianochat__comparison-table thead th:first-child,
.sorianochat__comparison-table tbody th {
  width: 25%;
}

.sorianochat__comparison-table tbody th {
  color: #656060;
  font-weight: 700;
}

.sorianochat__comparison-table tbody tr:last-child th,
.sorianochat__comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.sorianochat__comparison-winner {
  padding: 9px 11px;
  border-top: 1px solid #eadcdf;
  background: #f8eff1;
  color: var(--sorianochat-burgundy);
  font-size: 11px;
  line-height: 1.3;
}

.sorianochat__comparison-winner strong {
  font-weight: 800;
}

@media (max-width: 767px) {
  .sorianochat__quick-reply {
    min-height: 38px;
    padding: 8px 12px;
  }

  .sorianochat__comparison-table {
    min-width: 360px;
  }
}
