/* CHAT Ai — Corales de Catalina Village */
#cdc-chat{
  --navy:#071D44; --navy-2:#223D67; --gold:#D4A559; --gold-d:#B98A3E;
  --cream:#FFFCF9; --sand:#F4EEE7; --line:#DFD3C7; --ink:#2E2721; --muted:#6E6155;
  position:fixed; inset:0; z-index:2147483000; display:none;
  align-items:center; justify-content:center; padding:24px;
  font-family:Mulish, system-ui, sans-serif; color:var(--ink);
}
/* Aislamiento: el kit de Elementor da estilos globales a h2, button e input; aqui se neutralizan */
#cdc-chat button, #cdc-chat input, #cdc-chat textarea{
  all:unset; box-sizing:border-box; font-family:Mulish, system-ui, sans-serif;
}
#cdc-chat h2, #cdc-chat p, #cdc-chat ul{ margin:0; padding:0; text-transform:none; letter-spacing:normal; }
#cdc-chat *, #cdc-chat *::before, #cdc-chat *::after{ box-sizing:border-box; }

#cdc-chat.is-open{ display:flex; }
#cdc-chat .cdc-chat__backdrop{
  position:absolute; inset:0; background:rgba(7,29,68,.42);
  -webkit-backdrop-filter:blur(10px) saturate(1.05); backdrop-filter:blur(10px) saturate(1.05);
  animation:cdc-fade .22s ease-out;
}
#cdc-chat .cdc-chat__box{
  position:relative; width:min(460px,100%); height:min(680px,calc(100dvh - 48px));
  display:flex; flex-direction:column; overflow:hidden;
  background:var(--cream); border-radius:18px;
  box-shadow:0 30px 80px rgba(7,29,68,.35), 0 0 0 1px rgba(212,165,89,.25);
  animation:cdc-pop .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes cdc-fade{ from{opacity:0} to{opacity:1} }
@keyframes cdc-pop{ from{opacity:0; transform:translateY(12px) scale(.97)} to{opacity:1; transform:none} }

/* Cabecera */
#cdc-chat .cdc-chat__head{
  display:flex; align-items:center; gap:12px; padding:16px 16px 16px 20px;
  background:var(--navy); color:var(--cream); border-bottom:3px solid var(--gold);
}
#cdc-chat .cdc-chat__avatar{
  flex:none; width:40px; height:40px; border-radius:50%; display:grid; place-items:center;
  background:var(--navy-2); color:var(--gold); font:400 20px/1 "Antic Didone", Georgia, serif;
  border:1px solid rgba(212,165,89,.55);
}
#cdc-chat .cdc-chat__title{ margin:0; font:400 21px/1.15 "Antic Didone", Georgia, serif; color:var(--cream); letter-spacing:.01em; }
#cdc-chat .cdc-chat__sub{ margin:2px 0 0; font-size:12.5px; color:#C9D2E3; display:flex; align-items:center; gap:6px; }
#cdc-chat .cdc-chat__sub::before{ content:""; width:7px; height:7px; border-radius:50%; background:#4ADE80; }
#cdc-chat .cdc-chat__close{
  margin-left:auto; flex:none; width:38px; height:38px; border-radius:50%; border:0; cursor:pointer;
  background:transparent; color:var(--cream); font-size:22px; line-height:1;
}
#cdc-chat .cdc-chat__close:hover{ background:rgba(255,255,255,.1); }

/* Conversacion */
#cdc-chat .cdc-chat__log{
  flex:1; overflow-y:auto; padding:18px 16px 8px; display:flex; flex-direction:column; gap:10px;
  scroll-behavior:smooth; overscroll-behavior:contain;
}
#cdc-chat .cdc-msg{ max-width:86%; padding:11px 14px; border-radius:16px; font-size:14.5px; line-height:1.5; animation:cdc-pop .2s ease-out; }
#cdc-chat .cdc-msg p{ margin:0 0 6px; } #cdc-chat .cdc-msg p:last-child{ margin:0; }
#cdc-chat .cdc-msg ul{ margin:6px 0 0; padding-left:18px; } #cdc-chat .cdc-msg li{ margin:2px 0; }
#cdc-chat .cdc-msg strong{ color:var(--navy); }
#cdc-chat .cdc-msg--bot{ align-self:flex-start; background:#fff; border:1px solid var(--line); border-bottom-left-radius:5px; }
#cdc-chat .cdc-msg--user{ align-self:flex-end; background:var(--navy); color:var(--cream); border-bottom-right-radius:5px; }
#cdc-chat .cdc-msg--user strong{ color:var(--gold); }
#cdc-chat .cdc-note{ display:block; margin-top:6px; font-size:12px; color:var(--muted); }
#cdc-chat .cdc-typing{ align-self:flex-start; display:flex; gap:4px; padding:12px 14px; background:#fff; border:1px solid var(--line); border-radius:16px; border-bottom-left-radius:5px; }
#cdc-chat .cdc-typing span{ width:6px; height:6px; border-radius:50%; background:var(--muted); animation:cdc-dot 1s infinite; }
#cdc-chat .cdc-typing span:nth-child(2){ animation-delay:.15s } #cdc-chat .cdc-typing span:nth-child(3){ animation-delay:.3s }
@keyframes cdc-dot{ 0%,60%,100%{ opacity:.25; transform:none } 30%{ opacity:1; transform:translateY(-3px) } }

/* Opciones rapidas y acciones */
#cdc-chat .cdc-chips{ display:flex; flex-wrap:wrap; gap:8px; align-self:stretch; }
#cdc-chat .cdc-chip{
  border:1px solid var(--navy-2); background:#fff; color:var(--navy); cursor:pointer;
  padding:8px 13px; border-radius:999px; font:600 13px/1.2 Mulish, sans-serif; transition:background .15s, color .15s;
}
#cdc-chat .cdc-chip:hover{ background:var(--navy); color:var(--cream); }
#cdc-chat .cdc-actions{ display:flex; flex-direction:column; gap:8px; align-self:stretch; }
#cdc-chat .cdc-btn{
  display:flex; align-items:center; justify-content:center; gap:8px; min-height:46px; padding:12px 16px;
  border-radius:12px; border:0; cursor:pointer; text-decoration:none !important;
  font:700 14px/1.2 Mulish, sans-serif; letter-spacing:.02em; transition:filter .15s, transform .15s;
}
#cdc-chat .cdc-btn:hover{ filter:brightness(1.06); transform:translateY(-1px); }
#cdc-chat .cdc-btn svg{ width:18px; height:18px; flex:none; }
#cdc-chat .cdc-btn--wa{ background:#1FA855; color:#fff !important; }
#cdc-chat .cdc-btn--gold{ background:var(--gold); color:var(--navy) !important; }
#cdc-chat .cdc-btn--navy{ background:var(--navy); color:var(--cream) !important; }
#cdc-chat .cdc-btn--ghost{ background:#fff; color:var(--navy) !important; border:1px solid var(--line); }

/* Formulario dentro del chat */
#cdc-chat .cdc-form{ align-self:stretch; background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; display:grid; gap:10px; }
#cdc-chat .cdc-form label{ display:grid; gap:4px; font-size:12.5px; font-weight:700; color:var(--navy); }
#cdc-chat .cdc-form label span{ font-weight:400; color:var(--muted); }
#cdc-chat .cdc-form input, #cdc-chat .cdc-form textarea{
  width:100%; box-sizing:border-box; padding:11px 12px; border:1px solid var(--line); border-radius:10px;
  font:400 15px/1.3 Mulish, sans-serif; color:var(--ink); background:var(--cream);
}
#cdc-chat .cdc-form textarea{ min-height:64px; resize:vertical; }
#cdc-chat .cdc-form input:focus, #cdc-chat .cdc-form textarea:focus{ outline:2px solid var(--gold); outline-offset:0; border-color:var(--gold); }
#cdc-chat .cdc-form .cdc-hp{ position:absolute !important; left:-9999px !important; width:1px; height:1px; opacity:0; }
#cdc-chat .cdc-form__err{ margin:0; font-size:13px; color:#B42318; min-height:0; }
#cdc-chat .cdc-form__legal{ margin:0; font-size:11.5px; color:var(--muted); }

/* Entrada de texto */
#cdc-chat .cdc-chat__foot{ padding:10px 12px 12px; border-top:1px solid var(--line); background:var(--sand); }
#cdc-chat .cdc-chat__input{ display:flex; gap:8px; }
#cdc-chat .cdc-chat__input input{
  flex:1; min-width:0; padding:12px 14px; border:1px solid var(--line); border-radius:999px;
  font:400 15px/1.2 Mulish, sans-serif; background:#fff; color:var(--ink);
}
#cdc-chat .cdc-chat__input input:focus{ outline:2px solid var(--gold); border-color:var(--gold); }
#cdc-chat .cdc-chat__send{
  flex:none; width:46px; height:46px; border-radius:50%; border:0; cursor:pointer;
  background:var(--navy); color:var(--gold); display:grid; place-items:center;
}
#cdc-chat .cdc-chat__send svg{ width:20px; height:20px; }
#cdc-chat .cdc-chat__legal{ margin:8px 4px 0; font-size:11px; color:var(--muted); text-align:center; }

#cdc-chat button:focus-visible, #cdc-chat a:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
body.cdc-chat-lock{ overflow:hidden; }
/* el boton flotante de WhatsApp tapaba el chat; el propio chat ya ofrece WhatsApp */
body.cdc-chat-lock .wa__btn_popup, body.cdc-chat-lock .wa__popup_chat_box, body.cdc-chat-lock .wa__btn_popup_txt{ display:none !important; }

@media (max-width:600px){
  #cdc-chat{ padding:12px; }
  #cdc-chat .cdc-chat__box{ height:calc(100dvh - 24px); border-radius:16px; }
  #cdc-chat .cdc-msg{ max-width:92%; }
}
@media (prefers-reduced-motion:reduce){
  #cdc-chat *, #cdc-chat .cdc-chat__backdrop, #cdc-chat .cdc-chat__box{ animation:none !important; transition:none !important; }
  #cdc-chat .cdc-chat__log{ scroll-behavior:auto; }
}

#cdc-chat .cdc-chip, #cdc-chat .cdc-chat__close, #cdc-chat .cdc-chat__send, #cdc-chat .cdc-btn{ cursor:pointer; }
#cdc-chat .cdc-chat__close{ display:grid; place-items:center; }
#cdc-chat .cdc-chip{ display:inline-block; }
#cdc-chat .cdc-form input, #cdc-chat .cdc-form textarea, #cdc-chat .cdc-chat__input input{ display:block; }
#cdc-chat .cdc-form textarea{ white-space:pre-wrap; }
#cdc-chat input::placeholder{ color:#9A8D80; opacity:1; }
#cdc-chat .cdc-msg ul{ margin:6px 0 0; padding-left:18px; }
#cdc-chat .cdc-msg p{ margin:0 0 6px; }
#cdc-chat .cdc-msg p:last-child{ margin:0; }

/* ------------------------------------------------------------------ Icono del menu (entrada "CHAT Ai") */
.jkit-menu a[href$="#chat-ai"]::before{
  content:""; display:inline-block; flex:none; width:20px; height:20px; background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 3C6.5 3 2 6.6 2 11c0 2.4 1.3 4.5 3.4 6L4.6 21l4.3-2.2c1 .3 2 .4 3.1.4 5.5 0 10-3.6 10-8.1S17.5 3 12 3zM7.5 12.4a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8zm4.5 0a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8zm4.5 0a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 3C6.5 3 2 6.6 2 11c0 2.4 1.3 4.5 3.4 6L4.6 21l4.3-2.2c1 .3 2 .4 3.1.4 5.5 0 10-3.6 10-8.1S17.5 3 12 3zM7.5 12.4a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8zm4.5 0a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8zm4.5 0a1.4 1.4 0 1 1 0-2.8 1.4 1.4 0 0 1 0 2.8z'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* Escritorio: solo el icono, en circulo dorado */
@media (min-width:1025px){
  .jkit-menu a[href$="#chat-ai"]{
    display:inline-flex !important; align-items:center; justify-content:center;
    width:44px !important; height:44px !important; min-width:44px; flex:none; box-sizing:border-box;
    padding:0 !important; margin:0 !important; border-radius:50% !important;
    background:#D4A559; color:#071D44 !important; font-size:0 !important; line-height:0 !important;
    box-shadow:0 0 0 0 rgba(212,165,89,.55); animation:cdc-latido 2.6s ease-out 1.2s 3;
    transition:background .2s, transform .2s;
  }
  .jkit-menu a[href$="#chat-ai"]::before{ width:22px; height:22px; }
  .jkit-menu a[href$="#chat-ai"]:hover{ background:#FFFCF9; transform:scale(1.06); }
  .jkit-menu a[href$="#chat-ai"]:focus-visible{ outline:2px solid #FFFCF9; outline-offset:3px; }
}
/* Movil / tablet (menu hamburguesa): icono + texto */
@media (max-width:1024px){
  .jkit-menu a[href$="#chat-ai"]{ display:flex !important; align-items:center; gap:10px; }
  .jkit-menu a[href$="#chat-ai"]::before{ background:#D4A559; width:22px; height:22px; vertical-align:-5px; margin-right:10px; }
}
@keyframes cdc-latido{ 0%{ box-shadow:0 0 0 0 rgba(212,165,89,.55) } 70%{ box-shadow:0 0 0 12px rgba(212,165,89,0) } 100%{ box-shadow:0 0 0 0 rgba(212,165,89,0) } }
@media (prefers-reduced-motion:reduce){ .jkit-menu a[href$="#chat-ai"]{ animation:none !important; } }
