/* ==================== Gemelo digital (esquina inferior izquierda) ==================== */
.gemelo { position: fixed; z-index: 140; left: 18px; bottom: 0; width: 170px; pointer-events: none; transform: translateY(110%); transition: transform .8s cubic-bezier(.34,1.3,.64,1); font-family: var(--font); }
.gemelo.in { transform: none; }
.gemelo.bye { transform: translateY(110%); }
.gm-figure { pointer-events: auto; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.gm-media { position: relative; z-index: 1; height: 230px; display: flex; align-items: flex-end; justify-content: center; }
.gm-media video, .gm-media img { max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(24,26,27,.25)); }
.gm-foto { border-radius: 22px 22px 0 0; transform-origin: 50% 100%; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.gm-shadow { position: absolute; left: 18%; right: 18%; bottom: 4px; height: 14px; border-radius: 50%; background: radial-gradient(rgba(24,26,27,.3), transparent 70%); filter: blur(3px); }
/* animaciones provisorias de la foto (hasta tener los videos) */
.anim-saludo { animation: gmHola 1.6s ease-in-out 2; }
.anim-reposo { animation: gmRespira 4s ease-in-out infinite; }
.anim-reloj { animation: gmReloj 2.2s ease-in-out 2; }
.anim-ayuda { animation: gmAyuda 1.8s ease-in-out 2; }
.anim-sillon { animation: gmSillon 1.4s cubic-bezier(.34,1.3,.64,1) both, gmRespira 4s 1.4s ease-in-out infinite; }
@keyframes gmRespira { 50% { transform: translateY(-3px) scale(1.01); } }
@keyframes gmHola { 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
@keyframes gmReloj { 30% { transform: rotate(-6deg) translateX(-4px); } 60% { transform: rotate(-6deg) translateX(-4px) translateY(2px); } }
@keyframes gmAyuda { 40% { transform: translateY(-8px) rotate(3deg); } }
@keyframes gmSillon { from { transform: translateY(14px) scale(.96); } }
/* globo de diálogo */
.gm-bubble { pointer-events: auto; position: absolute; left: 100%; bottom: 150px; margin-left: -12px; width: 240px; padding: 14px 16px 14px; border-radius: 20px 20px 20px 6px; background: rgba(255,255,255,.92); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border: 1px solid rgba(24,26,27,.08); box-shadow: 0 20px 50px rgba(24,26,27,.18); opacity: 0; transform: translateY(8px) scale(.95); transform-origin: bottom left; transition: opacity .3s, transform .45s cubic-bezier(.34,1.4,.64,1); visibility: hidden; }
.gm-bubble.show { opacity: 1; transform: none; visibility: visible; }
.gm-text { margin: 0 18px 10px 0; font-size: .9rem; font-weight: 600; line-height: 1.4; color: var(--ink); }
.gm-cta { border: 0; border-radius: 99px; padding: 9px 14px; background: var(--ink); color: #fff; font: 700 .82rem var(--font); cursor: pointer; }
.gm-cta[hidden] { display: none; }
.gm-x { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(24,26,27,.06); color: var(--muted); font-size: .7rem; cursor: pointer; }
@media (max-width: 700px) {
  .gemelo { width: 112px; left: 8px; }
  .gm-media { height: 150px; }
  .gm-bubble { bottom: 120px; width: min(230px, calc(100vw - 140px)); }
}
@media (prefers-reduced-motion: reduce) { .gm-foto { animation: none !important; } }

/* desfile de vestuarios por rubro (provisorio con la foto; con videos se ve el cambio de ropa real) */
.anim-vestuario { animation: gmVestuario 2.6s cubic-bezier(.34,1.3,.64,1) both; }
@keyframes gmVestuario { 0% { transform: rotateY(90deg) scale(.96); filter: brightness(1.4); } 25% { transform: none; filter: none; } 100% { transform: none; } }
.gm-rol { position: absolute; z-index: 2; left: 50%; bottom: 18px; transform: translate(-50%, 8px); white-space: nowrap; padding: 6px 11px; border-radius: 99px; background: rgba(24,26,27,.88); color: #fff; font: 700 .72rem var(--font); letter-spacing: .01em; opacity: 0; pointer-events: none; backdrop-filter: blur(8px); }
.gm-rol.show { animation: gmRol 2.6s ease both; }
@keyframes gmRol { 0% { opacity: 0; transform: translate(-50%, 8px); } 15%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -4px); } }
@media (max-width: 700px) { .gm-rol { font-size: .64rem; bottom: 12px; } }

/* ---------- ajustes para el sitio de la agencia ---------- */
.gemelo { z-index: 58; left: auto; right: 260px; width: 150px; }
.gm-media { height: 200px; }
.gm-foto { border-radius: 0; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.gm-bubble { left: auto; right: 100%; margin-left: 0; margin-right: -10px; border-radius: 20px 20px 6px 20px; transform-origin: bottom right; }
.gemelo.tapado { transform: translateY(110%); }
@media (max-width: 900px) {
  .gemelo { right: auto; left: 6px; width: 96px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .gm-media { height: 128px; }
  .gm-bubble { left: 100%; right: auto; margin-left: -8px; margin-right: 0; bottom: 96px; width: min(220px, calc(100vw - 120px)); border-radius: 20px 20px 20px 6px; transform-origin: bottom left; }
  body:has(.catalog.detail-open) .gemelo { display: none; }
}
.gemelo .gm-bubble { background: #fff; border: 1px solid rgba(24,26,27,.08); box-shadow: 0 24px 60px rgba(24,26,27,.22); }
/* el avatar va a la izquierda del contenido para no chocar con el presupuesto flotante ni con el botón de la IA */
@media (min-width: 901px) {
  .gemelo { right: auto; left: 296px; }
  .gm-bubble { left: 100%; right: auto; margin-left: -10px; margin-right: 0; border-radius: 20px 20px 20px 6px; transform-origin: bottom left; }
}
/* en celular, dentro del cotizador sube por encima del presupuesto flotante */
@media (max-width: 900px) {
  body:has(#v-cotizador:not([hidden])) .gemelo { bottom: calc(168px + env(safe-area-inset-bottom)); }
}

.gm-nota { display: block; margin: -4px 18px 10px 0; font-size: .68rem; line-height: 1.35; color: var(--muted, #6b7178); }
.gm-nota[hidden] { display: none; }

.gemelo.oculto, .gemelo.tapado { transform: translateY(calc(110% + 200px)); opacity: 0; visibility: hidden; pointer-events: none; transition: transform .6s, opacity .3s, visibility 0s .6s; }
