/* ==========================================================================
   ¡A VENDER! — Asistente de ventas (UI)
   ========================================================================== */
.av-assistant {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 95;
  font-family: 'Inter', system-ui, sans-serif;
}

.av-launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.65rem;
  height: 3.65rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #f72585 0%, #7b2cbf 52%, #4cc9f0 100%);
  box-shadow: 0 18px 40px -14px rgba(247, 37, 133, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.av-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 48px -14px rgba(76, 201, 240, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.av-launcher:focus-visible {
  outline: 2px solid #4cc9f0;
  outline-offset: 3px;
}

.av-launcher svg {
  width: 1.55rem;
  height: 1.55rem;
}

.av-launcher-dot {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: 2px solid #0a0a14;
  background: #34d399;
}

.av-panel {
  position: absolute;
  right: 0;
  bottom: 4.7rem;
  display: flex;
  flex-direction: column;
  width: min(24rem, calc(100vw - 2rem));
  height: min(38rem, calc(100vh - 7.5rem));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1.6rem;
  background: rgba(12, 12, 24, 0.98);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 1);
  overflow: hidden;
  transform-origin: bottom right;
  animation: av-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
}

.av-panel[hidden] {
  display: none;
}

@keyframes av-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.av-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(247, 37, 133, 0.12), transparent);
}

.av-head-avatar {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #f72585, #7b2cbf 55%, #4cc9f0);
  flex-shrink: 0;
}

.av-head-avatar svg {
  width: 1.2rem;
  height: 1.2rem;
}

.av-head-text {
  min-width: 0;
  flex: 1;
}

.av-head-title {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.av-head-sub {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.15rem 0 0;
  overflow: hidden;
  color: #4cc9f0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.av-head-sub::before {
  content: '';
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: #34d399;
}

.av-head-demo {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.6rem;
  border: 1px solid rgba(76, 201, 240, 0.35);
  border-radius: 999px;
  background: rgba(76, 201, 240, 0.1);
  color: #4cc9f0;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.av-head-demo:hover {
  background: rgba(76, 201, 240, 0.2);
  color: #fff;
}

.av-close {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.av-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.av-close svg {
  width: 1rem;
  height: 1rem;
}

.av-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.av-msg {
  max-width: 88%;
  padding: 0.72rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-line;
}

.av-msg--bot {
  align-self: flex-start;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 0.35rem;
}

.av-msg--user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, rgba(247, 37, 133, 0.9), rgba(123, 44, 191, 0.92));
  border-bottom-right-radius: 0.35rem;
}

.av-msg a {
  color: #4cc9f0;
  text-decoration: underline;
}

.av-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.av-action {
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.av-action:hover {
  color: #fff;
  border-color: rgba(76, 201, 240, 0.5);
  background: rgba(76, 201, 240, 0.1);
}

.av-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.25rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
}

.av-form label {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.av-form select,
.av-form input[type='text'] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.65rem;
  background: rgba(10, 10, 20, 0.8);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
}

.av-form select:focus,
.av-form input:focus {
  outline: none;
  border-color: #4cc9f0;
}

.av-modules {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 8.5rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.av-check {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.74rem;
  line-height: 1.35;
}

.av-check input {
  margin-top: 0.12rem;
  accent-color: #f72585;
}

.av-form button[type='submit'] {
  margin-top: 0.15rem;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0a0a14;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.av-form button[type='submit']:hover {
  background: #f1f1f5;
}

.av-quote {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid rgba(76, 201, 240, 0.22);
  border-radius: 0.8rem;
  background: rgba(76, 201, 240, 0.06);
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
}

.av-quote-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.av-quote-row strong {
  color: #fff;
}

.av-quote-total {
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 800;
}

.av-foot {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.02);
}

.av-foot input {
  flex: 1;
  min-width: 0;
  padding: 0.62rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
}

.av-foot input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.av-foot input:focus {
  outline: none;
  border-color: #4cc9f0;
  box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.12);
}

.av-send {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f72585, #7b2cbf 55%, #4cc9f0);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.av-send svg {
  width: 1.1rem;
  height: 1.1rem;
}

.av-send:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 480px) {
  .av-assistant {
    right: 0.8rem;
    bottom: 0.8rem;
  }

  .av-panel {
    position: fixed;
    right: 0.5rem;
    left: 0.5rem;
    bottom: 4.6rem;
    width: auto;
    height: min(36rem, calc(100vh - 6.2rem));
  }

  .av-launcher {
    width: 3.25rem;
    height: 3.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .av-panel {
    animation: none;
  }
}
