/* ══════════════════════════════════════════════════════════
   Vaskor — burbujas flotantes y chat (estilo "glass" de los paneles
   nuevos, con la paleta de VASKLAN: negro, oro y verde esmeralda)
   Resoluciones:
     celular   ≤ 600 px  → chat a pantalla completa con X
     tableta   601–1024  → panel alto (440 px)
     portátil  1025–1439 → ventana 400 × 640
     escritorio ≥ 1440   → ventana 440 × 720
     celular acostado (alto ≤ 500) → pantalla completa
══════════════════════════════════════════════════════════ */
.vk-asis {
  --g-bg: rgba(14, 13, 18, .86);
  --g-panel: rgba(255, 255, 255, .055);
  --g-panel2: rgba(255, 255, 255, .09);
  --g-line: rgba(255, 255, 255, .11);
  --g-text: #f6f3ec;
  --g-muted: #aaa49a;
  --g-oro: #d9b85b;
  --g-oro2: #a88a42;
  --g-esm: #3fcf95;
  --g-esm2: #1f9c6b;
  --g-sombra: 0 28px 70px rgba(0, 0, 0, .45);
  font-family: 'Montserrat', system-ui, sans-serif;
}
.vk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.vk-asis button, .vk-asis a { cursor: pointer; }
.vk-asis textarea { cursor: text; }
.vk-asis :focus-visible { outline: 2px solid var(--g-oro); outline-offset: 2px; }

/* ── Burbujas ── */
.vk-flotantes { position: fixed; right: 24px; bottom: 24px; z-index: 9990; display: flex; flex-direction: column; align-items: center; gap: 12px; }
body.menu-abierto .vk-flotantes, body.asis-abierto .vk-flotantes { display: none; }
.vk-flot { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; border: 0; text-decoration: none;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; position: relative; }
.vk-flot:hover, .vk-flot:focus-visible { transform: translateY(-3px) scale(1.06); }
.vk-flot-wa { width: 54px; height: 54px; background: linear-gradient(145deg, #2fe07a, #1fb35d); color: #fff; box-shadow: 0 14px 30px -10px rgba(18,160,80,.75); }
.vk-flot-asis { padding: 0; background: radial-gradient(circle at 30% 25%, #2a2620, #0c0b0f 70%);
  box-shadow: 0 14px 34px -10px rgba(0,0,0,.7), 0 0 0 2px rgba(217,184,91,.55); }
.vk-flot-asis::before {            /* anillo con degradado oro → esmeralda que respira */
  content: ''; position: absolute; inset: -4px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 0deg, var(--g-oro), var(--g-esm), var(--g-oro2), var(--g-oro));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: vkGira 6s linear infinite; opacity: .9;
}
.vk-flot-asis img { width: 38px; height: 38px; object-fit: contain; position: relative; }
.vk-flot-asis::after { content: ''; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--g-esm); box-shadow: 0 0 0 2px #0c0b0f, 0 0 10px var(--g-esm); }
@keyframes vkGira { to { transform: rotate(360deg); } }
.vk-flot-tip { position: absolute; right: 74px; white-space: nowrap; background: var(--g-bg); color: var(--g-text);
  border: 1px solid var(--g-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: .74rem; padding: 8px 13px; border-radius: 999px; pointer-events: none; opacity: 0; transform: translateX(6px); transition: all .2s; }
.vk-flot-asis:hover .vk-flot-tip, .vk-flot-asis:focus-visible .vk-flot-tip { opacity: 1; transform: none; }

/* ── Ventana (vidrio oscuro) ── */
.vk-chat { position: fixed; right: 24px; bottom: 24px; z-index: 9995; width: 400px; height: min(640px, calc(100vh - 110px));
  display: flex; flex-direction: column; color: var(--g-text); background: var(--g-bg);
  border: 1px solid var(--g-line); border-radius: 24px; box-shadow: var(--g-sombra); overflow: hidden;
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  animation: vkEntrar .28s cubic-bezier(.2,.8,.2,1); }
.vk-chat::before {                 /* resplandor sutil de marca */
  content: ''; position: absolute; inset: -40% -30% auto auto; width: 70%; height: 60%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(63,207,149,.16), transparent), radial-gradient(closest-side at 30% 60%, rgba(217,184,91,.14), transparent);
  filter: blur(10px);
}
.vk-chat[hidden] { display: none; }
@keyframes vkEntrar { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

.vk-cab { position: relative; display: flex; align-items: center; gap: 11px; padding: 14px 14px 14px 16px;
  border-bottom: 1px solid var(--g-line); background: linear-gradient(180deg, rgba(255,255,255,.06), transparent); }
.vk-cab-logo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  background: radial-gradient(circle at 30% 25%, #2a2620, #0c0b0f 70%); box-shadow: 0 0 0 2px rgba(217,184,91,.6); }
.vk-cab-logo img { width: 30px; height: 30px; object-fit: contain; }
.vk-chat.hablando .vk-cab-logo { animation: vkHabla 1s ease-in-out infinite; }
@keyframes vkHabla { 50% { box-shadow: 0 0 0 2px var(--g-esm), 0 0 0 8px rgba(63,207,149,.18); } }
.vk-cab div { flex: 1; min-width: 0; }
.vk-cab strong { display: block; font: 600 1.05rem 'Montserrat', sans-serif; letter-spacing: .02em; }
.vk-cab small { display: block; font-size: .7rem; color: var(--g-muted); margin-top: 2px; }
.vk-estado { display: inline-flex; align-items: center; gap: 5px; color: var(--g-esm); font-weight: 600; }
.vk-estado i { width: 7px; height: 7px; border-radius: 50%; background: var(--g-esm); box-shadow: 0 0 8px var(--g-esm); }
.vk-icono { width: 40px; height: 40px; flex: none; border-radius: 14px; border: 1px solid var(--g-line); background: var(--g-panel);
  color: var(--g-text); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.vk-icono:hover { background: var(--g-panel2); border-color: rgba(217,184,91,.45); }
.vk-icono[hidden] { display: none; }
#vkVoz .off { display: none; }
#vkVoz[aria-pressed="false"] .on { display: none; }
#vkVoz[aria-pressed="false"] .off { display: block; }
#vkVoz[aria-pressed="true"] { color: var(--g-oro); }

/* Mensajes */
.vk-msgs { position: relative; flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.vk-msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: .88rem; line-height: 1.5; white-space: pre-line; word-wrap: break-word;
  animation: vkMsg .22s ease; }
@keyframes vkMsg { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vk-msg.bot { align-self: flex-start; background: var(--g-panel); border: 1px solid var(--g-line); border-bottom-left-radius: 6px; }
.vk-msg.yo { align-self: flex-end; color: #17130a; font-weight: 500; border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, #f0d68b, var(--g-oro) 55%, #c49a3c); box-shadow: 0 10px 24px -14px rgba(217,184,91,.8); }
.vk-msg.error { border-color: rgba(255,120,120,.4); }
.vk-enlaces { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.vk-enlaces a { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600;
  font-size: .74rem; color: #0f1d16; background: linear-gradient(135deg, #7ff0c0, var(--g-esm)); box-shadow: 0 8px 18px -10px rgba(63,207,149,.8); }
.vk-enlaces a:hover { filter: brightness(1.06); }
.vk-piezas { display: grid; gap: 8px; margin-top: 10px; }
.vk-pieza { display: flex; gap: 11px; align-items: center; padding: 8px; border-radius: 16px; text-decoration: none; color: inherit;
  background: rgba(0,0,0,.25); border: 1px solid var(--g-line); transition: border-color .2s, transform .2s; }
.vk-pieza:hover { border-color: rgba(217,184,91,.55); transform: translateY(-1px); }
.vk-pieza img { width: 54px; height: 66px; object-fit: cover; border-radius: 11px; background: #222; flex: none; }
.vk-pieza strong { display: block; font-size: .82rem; font-weight: 600; line-height: 1.3; }
.vk-pieza span { font-size: .8rem; color: var(--g-oro); font-weight: 700; }
.vk-pieza em { font-style: normal; font-size: .66rem; color: #ff9a9a; margin-left: 6px; }
.vk-acciones { display: flex; gap: 6px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
.vk-acciones button { border: 1px solid var(--g-line); background: transparent; border-radius: 999px; padding: 4px 10px;
  font: 500 .72rem 'Montserrat', sans-serif; color: var(--g-muted); }
.vk-acciones button:hover { border-color: rgba(217,184,91,.5); color: var(--g-text); }
.vk-acciones button[aria-pressed="true"] { background: rgba(217,184,91,.18); color: var(--g-oro); border-color: rgba(217,184,91,.5); }
.vk-escribiendo { align-self: flex-start; display: flex; gap: 5px; padding: 13px 15px; border-radius: 18px; background: var(--g-panel); border: 1px solid var(--g-line); }
.vk-escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: var(--g-oro); animation: vkPunto 1s infinite; }
.vk-escribiendo i:nth-child(2) { animation-delay: .15s; } .vk-escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes vkPunto { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.vk-sugerencias { position: relative; display: flex; gap: 7px; flex-wrap: wrap; padding: 0 16px 12px; }
.vk-sugerencias[hidden] { display: none; }
.vk-sugerencias button { border: 1px solid var(--g-line); background: var(--g-panel); color: var(--g-text); border-radius: 999px;
  padding: 7px 12px; font: 500 .75rem 'Montserrat', sans-serif; transition: border-color .2s, background .2s; }
.vk-sugerencias button:hover { border-color: rgba(63,207,149,.6); background: rgba(63,207,149,.1); }
.vk-aviso { position: relative; margin: 0; padding: 7px 16px; font-size: .64rem; line-height: 1.4; color: var(--g-muted); border-top: 1px solid var(--g-line); }

/* Formulario */
.vk-form { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--g-line); background: rgba(0,0,0,.18); }
.vk-form textarea { flex: 1; resize: none; max-height: 120px; padding: 11px 14px; border-radius: 16px; border: 1px solid var(--g-line);
  background: var(--g-panel); color: var(--g-text); font: 16px/1.4 'Montserrat', sans-serif; outline: none; }   /* 16 px: el iPhone no hace zoom */
.vk-form textarea::placeholder { color: #8d877d; }
.vk-form textarea:focus { border-color: rgba(217,184,91,.6); background: var(--g-panel2); }
.vk-mic.grabando { color: #fff; background: linear-gradient(135deg, #ff6b6b, #d64545); border-color: transparent; animation: vkGraba 1.2s infinite; }
@keyframes vkGraba { 50% { box-shadow: 0 0 0 7px rgba(214,69,69,.22); } }
.vk-enviar { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; color: #17130a;
  background: linear-gradient(135deg, #f0d68b, var(--g-oro) 55%, #c49a3c); box-shadow: 0 10px 22px -12px rgba(217,184,91,.9); transition: transform .2s; }
.vk-enviar:hover { transform: scale(1.05); }
.vk-enviar[disabled] { opacity: .5; cursor: progress; }

/* ── Resoluciones ── */
@media (min-width: 1440px) {                                   /* escritorio grande */
  .vk-chat { width: 440px; height: min(720px, calc(100vh - 110px)); }
  .vk-msg { font-size: .9rem; }
}
@media (min-width: 601px) and (max-width: 1024px) {            /* tableta */
  .vk-flotantes { right: 20px; bottom: 20px; }
  .vk-chat { right: 20px; bottom: 20px; width: 440px; height: min(760px, calc(100vh - 40px)); }
}
@media (max-width: 600px) {                                    /* celular: pantalla completa */
  .vk-flotantes { right: 14px; bottom: 16px; gap: 10px; }
  .vk-flot { width: 54px; height: 54px; }
  .vk-flot-asis img { width: 34px; height: 34px; }
  .vk-flot-tip { display: none; }
  .vk-chat { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; z-index: 13000; }
  .vk-msg { max-width: 90%; }
  body.asis-abierto { overflow: hidden; }
}
@media (max-height: 500px) and (orientation: landscape) {      /* celular acostado */
  .vk-chat { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; z-index: 13000; }
  .vk-sugerencias, .vk-aviso { display: none; }
}
@media (prefers-reduced-motion: reduce) { .vk-asis *, .vk-asis *::before { animation: none !important; transition: none !important; } }
