/* ==========================================================================
   American Carpas — Modal de captacion de leads por WhatsApp
   Marca: azul #045e8e / #7cc0e1  ·  CTA WhatsApp: verde #10c379
   ========================================================================== */

:root {
  --acw-brand: #045e8e;
  --acw-brand-2: #7cc0e1;
  --acw-wa: #10c379;
  --acw-wa-dark: #0ea968;
  --acw-ink: #2f2a27;
  --acw-muted: #8b827d;
  --acw-line: #e2ddda;
}

/* Overlay */
.acw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 35, .55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
  opacity: 0;
  transition: opacity .18s ease;
}
.acw-overlay.acw-open { display: flex; opacity: 1; }

/* Caja del modal */
.acw-modal {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
  overflow: hidden;
  transform: translateY(14px) scale(.98);
  transition: transform .2s ease;
  font-family: inherit;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.acw-overlay.acw-open .acw-modal { transform: none; }

/* Cabecera */
.acw-head {
  background: linear-gradient(135deg, var(--acw-brand) 0%, #023f61 100%);
  color: #fff;
  padding: 20px 22px 18px;
  position: relative;
}
.acw-head h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 9px;
}
.acw-head h3 .acw-wa-ico {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  background: var(--acw-wa);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.acw-head h3 .acw-wa-ico svg { width: 15px; height: 15px; fill: #fff; }
.acw-head p {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .9);
}
.acw-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease;
}
.acw-close:hover { background: rgba(255, 255, 255, .32); }

/* Cuerpo con scroll */
.acw-body {
  padding: 18px 22px 8px;
  overflow-y: auto;
}
.acw-field { margin-bottom: 14px; }
.acw-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--acw-ink);
  margin-bottom: 6px;
}
.acw-field label .acw-req { color: #d9534f; }
.acw-field input,
.acw-field select,
.acw-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1.5px solid var(--acw-line);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--acw-ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.acw-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b827d' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
.acw-field textarea { min-height: 74px; resize: vertical; }
.acw-field input:focus,
.acw-field select:focus,
.acw-field textarea:focus {
  outline: none;
  border-color: var(--acw-brand-2);
  box-shadow: 0 0 0 3px rgba(124, 192, 225, .28);
}

/* Honeypot oculto (anti-spam) */
.acw-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* Pie / boton */
.acw-foot {
  padding: 6px 22px 20px;
}
.acw-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--acw-wa);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background .15s ease, transform .05s ease;
  font-family: inherit;
}
.acw-submit svg { width: 19px; height: 19px; fill: #fff; }
.acw-submit:hover { background: var(--acw-wa-dark); }
.acw-submit:active { transform: translateY(1px); }
.acw-submit[disabled] { opacity: .6; cursor: default; }
.acw-note {
  margin: 11px 2px 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--acw-muted);
  text-align: center;
}

@media (max-width: 480px) {
  .acw-modal { border-radius: 14px; }
  .acw-head { padding: 18px 18px 16px; }
  .acw-head h3 { font-size: 17.5px; }
  .acw-body { padding: 16px 18px 6px; }
  .acw-foot { padding: 6px 18px 18px; }
}

/* ==========================================================================
   Boton flotante nuevo (FAB) que abre el modal de leads
   Reemplaza al widget czmChatSupport (que abria WhatsApp por window.open).
   ========================================================================== */

/* Ocultar el widget viejo desde el arranque (este CSS carga en el <head>) */
#example,
.czm-button,
.czm-popup,
.czm-speech-bubble,
[class^="czm-chat-support"],
[class*="czm-chat-support"] { display: none !important; }

.acw-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: var(--acw-wa);
  cursor: pointer;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
  transition: transform .15s ease, background .15s ease;
  animation: acw-fab-pulse 2.6s infinite;
  -webkit-tap-highlight-color: transparent;
}
.acw-fab:hover { transform: scale(1.06); background: var(--acw-wa-dark); }
.acw-fab:active { transform: scale(.97); }
.acw-fab svg { width: 34px; height: 34px; fill: #fff; }

/* Puntito de notificacion */
.acw-fab .acw-fab-dot {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid #fff;
}

/* Etiqueta emergente (solo escritorio) */
.acw-fab .acw-fab-tip {
  position: absolute;
  right: 74px;
  white-space: nowrap;
  background: #2f2a27;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}
.acw-fab .acw-fab-tip::after {
  content: "";
  position: absolute;
  right: -5px; top: 50%;
  transform: translateY(-50%);
  border-left: 6px solid #2f2a27;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}
.acw-fab:hover .acw-fab-tip { opacity: 1; transform: translateX(0); }

@keyframes acw-fab-pulse {
  0%   { box-shadow: 0 8px 22px rgba(0,0,0,.28), 0 0 0 0 rgba(16,195,121,.55); }
  70%  { box-shadow: 0 8px 22px rgba(0,0,0,.28), 0 0 0 16px rgba(16,195,121,0); }
  100% { box-shadow: 0 8px 22px rgba(0,0,0,.28), 0 0 0 0 rgba(16,195,121,0); }
}

@media (max-width: 480px) {
  .acw-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .acw-fab svg { width: 30px; height: 30px; }
  .acw-fab .acw-fab-tip { display: none; }
}

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

/* --------------------------------------------------------------------------
   Boton "volver arriba" del tema (.scroll-to-top): se subia detras del boton
   flotante de WhatsApp. Lo elevamos para que quede POR ENCIMA del WhatsApp,
   sin mover el boton de WhatsApp.
   FAB WhatsApp: bottom 22px + 62px alto = ocupa hasta ~84px.
   -------------------------------------------------------------------------- */
.scroll-to-top {
  bottom: 98px !important;
  right: 31px !important;
  z-index: 999997 !important; /* debajo del FAB (999998) pero visible y clicable */
}

@media (max-width: 480px) {
  /* FAB movil: bottom 16px + 56px = ~72px */
  .scroll-to-top {
    bottom: 84px !important;
    right: 22px !important;
  }
}
