/* ============================================
   Widget flotante de contacto — Yaxkin Tech
   Prefijo aislado: .yxt-widget-
   Se inyecta desde /js/contact-widget.js
   ============================================ */

.yxt-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 300ms ease, transform 300ms ease;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
}

.yxt-widget--visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Botón colapsado --- */
.yxt-widget__toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #1A6B4F 0%, #C9A84C 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(10, 22, 40, 0.35);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.yxt-widget__toggle:hover,
.yxt-widget__toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(10, 22, 40, 0.4);
}

.yxt-widget__toggle:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 3px;
}

/* --- Tarjeta expandida --- */
.yxt-widget__card {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 320px;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(10, 22, 40, 0.28);
  display: none;
}

.yxt-widget--open .yxt-widget__card { display: block; }
.yxt-widget--open .yxt-widget__toggle { visibility: hidden; }

.yxt-widget__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.yxt-widget__close:hover,
.yxt-widget__close:focus-visible {
  color: #0D2137;
  background: rgba(13, 33, 55, 0.06);
}

.yxt-widget__close:focus-visible {
  outline: 2px solid #1A6B4F;
  outline-offset: 2px;
}

.yxt-widget__title {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 700;
  color: #0D2137;
  margin: 0 28px 8px 0;
}

.yxt-widget__sub {
  font-size: 14px;
  line-height: 1.5;
  color: #6B7280;
  margin: 0 0 16px 0;
}

.yxt-widget__whatsapp {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  background: #1A6B4F;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.yxt-widget__whatsapp:hover,
.yxt-widget__whatsapp:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 107, 79, 0.35);
}

.yxt-widget__whatsapp:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 2px;
}

.yxt-widget__email {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  color: #1A6B4F;
  text-decoration: underline;
}

.yxt-widget__email:hover,
.yxt-widget__email:focus-visible {
  color: #0D2137;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .yxt-widget {
    bottom: 16px;
    right: 16px;
  }

  .yxt-widget__card {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }
}

/* --- Accesibilidad: respetar reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .yxt-widget,
  .yxt-widget__toggle,
  .yxt-widget__whatsapp {
    transition: none;
  }
}
