/* =========================================================
   CHATBOT — AREBUSCÁ
   ========================================================= */

#arebusca-chatbot {

  position:
    fixed;

  right:
    24px;

  bottom:
    24px;

  z-index:
    9999;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

}


/* =========================================================
   BOTÓN
   ========================================================= */

.chatbot-toggle {

  width:
    52px;

  height:
    52px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    center;

  border:
    1px solid var(--brown);

  border-radius:
    50%;

  background:
    var(--brown);

  color:
    var(--white);

  cursor:
    pointer;

  box-shadow:
    0 8px 30px rgba(
      0,
      0,
      0,
      .12
    );

  transition:
    transform 180ms ease,
    background-color 180ms ease;

}


.chatbot-toggle:hover {

  transform:
    scale(1.05);

  background:
    var(--black);

}


.chatbot-toggle-text {

  font-size:
    17px;

  font-weight:
    300;

}


/* =========================================================
   VENTANA
   ========================================================= */

.chatbot-window {

  position:
    absolute;

  right:
    0;

  bottom:
    68px;

  width:
    390px;

  height:
    560px;

  display:
    flex;

  flex-direction:
    column;

  border:
    1px solid var(--line);

  background:
    var(--white);

  box-shadow:
    0 20px 60px rgba(
      0,
      0,
      0,
      .16
    );

  opacity:
    0;

  visibility:
    hidden;

  transform:
    translateY(
      12px
    );

  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;

}


.chatbot-window.open {

  opacity:
    1;

  visibility:
    visible;

  transform:
    translateY(
      0
    );

}


/* =========================================================
   HEADER
   ========================================================= */

.chatbot-header {

  min-height:
    76px;

  padding:
    18px 20px;

  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  border-bottom:
    1px solid var(--line);

}


.chatbot-eyebrow {

  margin:
    0 0 5px;

  color:
    var(--grey);

  font-size:
    8px;

  letter-spacing:
    1.7px;

}


.chatbot-header h2 {

  margin:
    0;

  color:
    var(--brown);

  font-size:
    21px;

  font-weight:
    300;

}


.chatbot-close {

  width:
    30px;

  height:
    30px;

  padding:
    0;

  border:
    0;

  background:
    transparent;

  color:
    var(--grey);

  cursor:
    pointer;

  font-size:
    25px;

  font-weight:
    300;

}


/* =========================================================
   MENSAJES
   ========================================================= */

.chatbot-messages {

  flex:
    1;

  overflow-y:
    auto;

  padding:
    18px;

  display:
    flex;

  flex-direction:
    column;

  gap:
    12px;

}


.chatbot-message {

  max-width:
    86%;

  padding:
    11px 13px;

  font-size:
    11px;

  line-height:
    1.6;

}


.chatbot-message p {

  margin:
    0;

}


.chatbot-message-bot {

  align-self:
    flex-start;

  border:
    1px solid var(--line);

  background:
    var(--cream);

  color:
    var(--black);

}


.chatbot-message-user {

  align-self:
    flex-end;

  background:
    var(--brown);

  color:
    var(--white);

}


/* =========================================================
   TYPING
   ========================================================= */

.chatbot-typing {

  display:
    flex;

  align-items:
    center;

  gap:
    4px;

}


.chatbot-typing span {

  width:
    4px;

  height:
    4px;

  border-radius:
    50%;

  background:
    var(--grey);

  animation:
    chatbotTyping 1s infinite ease-in-out;

}


.chatbot-typing span:nth-child(2) {

  animation-delay:
    .15s;

}


.chatbot-typing span:nth-child(3) {

  animation-delay:
    .3s;

}


@keyframes chatbotTyping {

  0%,
  60%,
  100% {

    opacity:
      .25;

    transform:
      translateY(0);

  }

  30% {

    opacity:
      1;

    transform:
      translateY(-3px);

  }

}


/* =========================================================
   PRODUCTOS
   ========================================================= */

.chatbot-product-message {

  max-width:
    94%;

  padding:
    8px;

}


.chatbot-products {

  display:
    flex;

  flex-direction:
    column;

  gap:
    10px;

}


.chatbot-product {

  display:
    grid;

  grid-template-columns:
    72px minmax(0, 1fr);

  gap:
    11px;

  padding:
    8px;

  border:
    1px solid var(--line);

  background:
    var(--white);

}


.chatbot-product-image {

  width:
    72px;

  height:
    96px;

  overflow:
    hidden;

  background:
    var(--cream);

}


.chatbot-product-image img {

  width:
    100%;

  height:
    100%;

  display:
    block;

  object-fit:
    cover;

}


.chatbot-product-content {

  min-width:
    0;

  display:
    flex;

  flex-direction:
    column;

  align-items:
    flex-start;

}


.chatbot-product-name {

  margin:
    0 0 4px;

  color:
    var(--brown);

  font-size:
    9px;

  font-weight:
    500;

  line-height:
    1.3;

  letter-spacing:
    .6px;

  text-transform:
    uppercase;

}


.chatbot-product-price {

  display:
    flex;

  align-items:
    center;

  flex-wrap:
    wrap;

  gap:
    6px;

  margin-bottom:
    7px;

  color:
    var(--black);

  font-size:
    10px;

}


.chatbot-product-old-price {

  color:
    var(--grey);

  text-decoration:
    line-through;

  font-size:
    8px;

}


.chatbot-product-variants {

  display:
    flex;

  flex-wrap:
    wrap;

  gap:
    4px;

  margin-bottom:
    8px;

}


.chatbot-product-variants span {

  padding:
    4px 5px;

  border:
    1px solid var(--line);

  color:
    var(--grey);

  font-size:
    7px;

  line-height:
    1;

}


.chatbot-product-stock {

  margin:
    0 0 8px;

  color:
    #8A4A3A;

  font-size:
    8px;

}


.chatbot-product-button {

  margin-top:
    auto;

  min-height:
    27px;

  padding:
    0 9px;

  display:
    inline-flex;

  align-items:
    center;

  justify-content:
    center;

  gap:
    7px;

  border:
    1px solid var(--brown);

  background:
    var(--brown);

  color:
    var(--white);

  text-decoration:
    none;

  font-size:
    7px;

  letter-spacing:
    .8px;

  transition:
    background-color 180ms ease,
    border-color 180ms ease;

}


.chatbot-product-button:hover {

  background:
    var(--black);

  border-color:
    var(--black);

}


.chatbot-product-button span {

  font-size:
    11px;

}


/* =========================================================
   FORMULARIO
   ========================================================= */

.chatbot-form {

  padding:
    12px;

  display:
    flex;

  gap:
    8px;

  border-top:
    1px solid var(--line);

}


.chatbot-input {

  flex:
    1;

  min-width:
    0;

  height:
    42px;

  padding:
    0 12px;

  border:
    1px solid var(--line);

  outline:
    none;

  background:
    transparent;

  color:
    var(--black);

  font-family:
    inherit;

  font-size:
    11px;

}


.chatbot-input:focus {

  border-color:
    var(--brown);

}


.chatbot-send {

  width:
    42px;

  height:
    42px;

  flex-shrink:
    0;

  border:
    1px solid var(--brown);

  background:
    var(--brown);

  color:
    var(--white);

  cursor:
    pointer;

  font-size:
    17px;

}


.chatbot-send:disabled {

  opacity:
    .5;

  cursor:
    not-allowed;

}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 600px) {

  #arebusca-chatbot {

    right:
      14px;

    bottom:
      14px;

  }


  .chatbot-window {

    right:
      0;

    bottom:
      65px;

    width:
      min(
        calc(100vw - 28px),
        390px
      );

    height:
      min(
        560px,
        calc(100vh - 110px)
      );

  }


  .chatbot-product {

    grid-template-columns:
      62px minmax(0, 1fr);

  }


  .chatbot-product-image {

    width:
      62px;

    height:
      83px;

  }

}

.chatbot-toggle-text {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-toggle-text svg {
  width: 26px;
  height: 26px;
  display: block;
}