/**
 * Chat lateral estilo WhatsApp — home Chancay Turismo
 */

.home-coastal-fab-stack {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 12040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

.home-coastal-fab-stack > * {
  pointer-events: auto;
}

.home-coastal-fab-map {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
}

.home-coastal-fab-chat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 16px;
  border: none;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.38);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.home-coastal-fab-chat i {
  font-size: 22px;
  line-height: 1;
}

.home-coastal-fab-chat .fab-label {
  display: none;
  padding-right: 4px;
}

.home-coastal-fab-chat:hover {
  transform: scale(1.05);
  background: #1ebe57;
  color: #fff;
}

.home-coastal-fab-chat:hover .fab-label {
  display: inline;
}

.home-coastal-fab-chat.is-open {
  background: #128c7e;
}

@media (max-width: 767px) {
  .home-coastal-fab-stack {
    right: 16px;
    bottom: 18px;
    gap: 10px;
  }

  /* En móvil el mapa se oculta; el chat sí queda visible */
  .home-coastal-fab-map {
    display: none !important;
  }

  .home-coastal-fab-chat {
    padding: 14px;
  }

  .home-coastal-fab-chat .fab-label {
    display: none !important;
  }
}

body.coastal-spa-shell:not(.page-home) .home-coastal-fab-stack,
body.coastal-spa-shell:not(.page-home) .home-chat {
  display: none !important;
}

/* ===== Panel ===== */
/* Por encima del header sticky (z-index 100) y ticker (90) */
.home-chat {
  position: fixed;
  inset: 0;
  z-index: 12050;
  pointer-events: none;
}

.home-chat.is-open {
  pointer-events: auto;
}

.home-chat__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 28, 48, 0.42);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.home-chat.is-open .home-chat__backdrop {
  opacity: 1;
}

.home-chat__drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100vw, 420px);
  display: flex;
  flex-direction: column;
  background: #efeae2;
  box-shadow: -12px 0 40px rgba(11, 28, 48, 0.18);
  transform: translateX(104%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.home-chat.is-open .home-chat__drawer {
  transform: translateX(0);
}

.home-chat__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 8px;
  background: linear-gradient(180deg, #075e54 0%, #128c7e 100%);
  color: #fff;
  flex: 0 0 auto;
}

.home-chat__back,
.home-chat__header-wa {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  flex: 0 0 auto;
}

.home-chat__back:hover,
.home-chat__header-wa:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.home-chat__avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: 0 0 auto;
}

.home-chat__identity {
  min-width: 0;
  flex: 1 1 auto;
}

.home-chat__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-chat__status {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-chat__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #25d366;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.25);
}

.home-chat__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 12px;
  background-color: #efeae2;
  background-image:
    radial-gradient(rgba(11, 28, 48, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-overflow-scrolling: touch;
}

.home-chat__day {
  text-align: center;
  margin: 0 auto 14px;
  padding: 4px 12px;
  width: fit-content;
  background: rgba(255, 255, 255, 0.85);
  color: #667781;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(11, 28, 48, 0.06);
}

.home-chat__bubble {
  max-width: 88%;
  padding: 8px 10px 6px;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 1px rgba(11, 28, 48, 0.08);
  position: relative;
  clear: both;
}

.home-chat__bubble p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #111b21;
}

.home-chat__bubble p:last-of-type {
  margin-bottom: 2px;
}

.home-chat__bubble a {
  color: #027eb5;
  font-weight: 600;
  text-decoration: none;
}

.home-chat__bubble a:hover {
  text-decoration: underline;
}

.home-chat__bubble--in {
  float: left;
  background: #fff;
  border-top-left-radius: 2px;
}

.home-chat__bubble--out {
  float: right;
  background: #d9fdd3;
  border-top-right-radius: 2px;
}

.home-chat__time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: #667781;
  margin-top: 2px;
  font-style: normal;
}

.home-chat__chips {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 4px;
}

.home-chat__chip {
  border: 1px solid rgba(18, 140, 126, 0.35);
  background: #fff;
  color: #075e54;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.home-chat__chip:hover {
  background: #e7f8f5;
  border-color: #128c7e;
}

.home-chat__composer {
  flex: 0 0 auto;
  background: #f0f2f5;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(11, 28, 48, 0.06);
}

.home-chat__form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-chat__input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  border-radius: 24px;
  background: #fff;
  padding: 12px 16px;
  font-size: 15px;
  color: #111b21;
  outline: none;
  box-shadow: 0 1px 1px rgba(11, 28, 48, 0.04);
}

.home-chat__input::placeholder {
  color: #8696a0;
}

.home-chat__send {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.home-chat__send:hover {
  background: #1ebe57;
}

.home-chat__hint {
  margin: 6px 4px 0;
  font-size: 11px;
  color: #8696a0;
  text-align: center;
}

body.home-chat-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .home-chat__drawer {
    top: 12px;
    right: 12px;
    bottom: 12px;
    border-radius: 16px;
  }
}

.home-chat__send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.home-chat__bubble--typing p {
  color: #667781;
  font-style: italic;
}

.home-chat__dots {
  display: inline-block;
  min-width: 1.2em;
  animation: home-chat-dots 1.2s steps(4, end) infinite;
}

@keyframes home-chat-dots {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}

.home-chat__elapsed {
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: #8696a0;
}

.home-chat__bubble--note p {
  color: #667781;
  font-size: 12px;
}

.home-chat__bubble--note {
  background: #fff8dc;
}

/* —— Pedido web: layout limpio (clear floats del chat) —— */
.home-chat__pedido-ui {
  clear: both;
  display: block;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin: 8px 12px 10px;
  float: none !important;
  position: relative;
  z-index: 2;
}

.home-chat__stepper {
  background: #f3fbf7;
  border: 1px solid #cfe8dc;
  border-radius: 12px;
  padding: 10px 12px;
}

.home-chat__stepper-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.home-chat__stepper-title {
  font-size: 12px;
  font-weight: 700;
  color: #0b6e4f;
  line-height: 1.3;
}

.home-chat__stepper-cta {
  font-size: 13px;
  font-weight: 600;
  color: #14532d;
}

.home-chat__stepper-bar {
  height: 8px;
  border-radius: 999px;
  background: #dcefe6;
  overflow: hidden;
}

.home-chat__stepper-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6e4f, #25d366);
  transition: width 0.25s ease;
}

.home-chat__stepper-labels {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
  font-size: 10px;
  color: #6b7280;
}

.home-chat__stepper-labels .is-done { color: #0b6e4f; font-weight: 600; }
.home-chat__stepper-labels .is-current { color: #059669; font-weight: 700; }

.home-chat__actions-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin: 0 0 6px 2px;
}

.home-chat__actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.home-chat__action-btn {
  border: 1px solid #0b6e4f;
  background: #fff;
  color: #0b6e4f;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  box-shadow: none;
  position: static;
}

.home-chat__action-btn:hover {
  background: #0b6e4f;
  color: #fff;
}

.home-chat__actions.layout-stack .home-chat__actions-row { flex-direction: column; }
.home-chat__actions.layout-stack .home-chat__action-btn {
  width: 100%;
  border-radius: 12px;
  padding: 12px 14px;
}

.home-chat__actions.layout-grid .home-chat__actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.home-chat__actions.layout-grid .home-chat__action-btn {
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  min-height: 48px;
}

.home-chat__actions.layout-qty .home-chat__actions-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.home-chat__actions.layout-qty .home-chat__action-btn {
  border-radius: 12px;
  text-align: center;
  font-size: 16px;
  padding: 12px 0;
}

.home-chat__actions.layout-pay .home-chat__action-btn {
  border-radius: 12px;
  flex: 1 1 42%;
  text-align: center;
  padding: 12px 10px;
}

.home-chat__actions.role-cart .home-chat__actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.home-chat__actions.role-cart .home-chat__action-btn {
  width: 100%;
  border-radius: 12px;
  text-align: center;
  padding: 12px 10px;
  background: #0b6e4f;
  color: #fff;
  border-color: #0b6e4f;
}
.home-chat__actions.role-cart .home-chat__action-btn:hover { background: #095c42; }

.home-chat__actions.role-pay .home-chat__action-btn {
  border-color: #7c3aed;
  color: #6d28d9;
}
.home-chat__actions.role-pay .home-chat__action-btn:hover {
  background: #7c3aed;
  color: #fff;
}

.home-chat__actions.role-cancel .home-chat__action-btn {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fff;
}
.home-chat__actions.role-cancel .home-chat__action-btn:hover {
  background: #dc2626;
  color: #fff;
}

@media (max-width: 480px) {
  .home-chat__actions.layout-grid .home-chat__actions-row,
  .home-chat__actions.role-cart .home-chat__actions-row {
    grid-template-columns: 1fr;
  }
}
