/* Estilos Oficiales del Widget de Chatbot - Diana Asesora Virtual para WordPress & WooCommerce */

:root {
  --tn-primary: #15803d;
  --tn-primary-dark: #166534;
  --tn-primary-light: #22c55e;
  --tn-accent: #f59e0b;
  --tn-error: #ef4444;
  --tn-text-main: #1e293b;
  --tn-text-muted: #64748b;
  --tn-white: #ffffff;
  --tn-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.2), 0 6px 14px -2px rgba(0, 0, 0, 0.1);
  --tn-radius: 16px;
}

#tn-chatbot-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 999999 !important;
}

/* ========================================================
   ANIMACIONES DE PULSO Y RESPLANDOR CLARO UX PARA BOTONES
   ======================================================== */
@keyframes tn-glow-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.75), 0 4px 12px rgba(22, 101, 52, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0), 0 6px 20px rgba(34, 197, 94, 0.65);
    transform: scale(1.025);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0), 0 4px 12px rgba(22, 101, 52, 0.35);
    transform: scale(1);
  }
}

@keyframes tn-shimmer {
  0% { left: -75%; }
  35% { left: 125%; }
  100% { left: 125%; }
}

/* ========================================================
   DOCK FLOTANTE Y BOTONES DE APERTURA (PRINCIPAL + AUXILIAR)
   ======================================================== */
.tn-floating-dock {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  position: relative !important;
  z-index: 999999 !important;
}

/* Botón Pequeño Auxiliar para Reabrir Panel de Producto y Sugeridos */
/* POR DEFECTO OCULTO — solo se muestra cuando hay un producto real activo */
.tn-side-reopen-btn {
  display: none !important;
  background: #ffffff !important;
  color: #15803d !important;
  border: 2px solid #22c55e !important;
  border-radius: 30px !important;
  padding: 8px 14px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  animation: tn-reopen-pulse 2.2s infinite ease-in-out !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  letter-spacing: -0.2px !important;
}

/* Solo visible cuando JS añade la clase .visible */
.tn-side-reopen-btn.visible {
  display: flex !important;
}

.tn-side-reopen-btn:hover {
  background: #f0fdf4 !important;
  border-color: #16a34a !important;
  color: #166534 !important;
  transform: translateY(-2px) scale(1.06) !important;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.5) !important;
}

.tn-reopen-icon {
  font-size: 15px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
}

.tn-reopen-text {
  font-size: 11.5px !important;
  font-weight: 800 !important;
}

@keyframes tn-reopen-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    border-color: #22c55e;
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.55);
    border-color: #15803d;
  }
}



.tn-header-cart-btn {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 6px !important;
  padding: 4px 7px !important;
  margin-right: 4px !important;
  position: relative !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
}

.tn-header-cart-btn:hover {
  background: rgba(255, 255, 255, 0.35) !important;
  transform: scale(1.08) !important;
}

.tn-cart-badge {
  position: absolute !important;
  top: -4px !important;
  right: -5px !important;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  height: 16px !important;
  min-width: 16px !important;
  padding: 0 4px !important;
  border-radius: 10px !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
  animation: tn-badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tn-cart-badge.has-items {
  display: flex !important;
}

@keyframes tn-badge-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.tn-chat-launcher {
  width: 64px !important;
  height: 64px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(22, 101, 52, 0.45) !important;
  border: 2.5px solid #22c55e !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: visible !important;
}

.tn-chat-launcher:hover {
  transform: scale(1.08) rotate(3deg) !important;
  box-shadow: 0 12px 28px rgba(22, 101, 52, 0.55) !important;
}

.tn-launcher-logo-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

.tn-badge-pulse {
  position: absolute !important;
  top: -2px !important;
  right: -2px !important;
  width: 15px !important;
  height: 15px !important;
  background-color: var(--tn-accent) !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  animation: tn-pulse 2s infinite !important;
  z-index: 5 !important;
}

@keyframes tn-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ========================================================
   ANIMACIÓN DE MARIPOSAS MÁGICAS ALREDEDOR DEL LAUNCHER
   ======================================================== */
.tn-butterflies-wrapper {
  position: absolute !important;
  inset: -15px !important;
  pointer-events: none !important;
  overflow: visible !important;
  z-index: 15 !important;
}

.tn-butterfly {
  position: absolute !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important;
  opacity: 0.94 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18)) !important;
}

.tn-bf-body {
  width: 2px !important;
  height: 7px !important;
  background: #14532d !important;
  border-radius: 2px !important;
  display: inline-block !important;
  z-index: 2 !important;
}

.tn-bf-wing {
  display: inline-block !important;
  width: 6.5px !important;
  height: 8.5px !important;
  border-radius: 60% 40% 70% 30% / 55% 45% 55% 45% !important;
  transform-origin: center right !important;
}

.tn-bf-wing.tn-bf-right {
  border-radius: 40% 60% 30% 70% / 45% 55% 45% 55% !important;
  transform-origin: center left !important;
}

/* Aleteo ultra-rápido y natural */
.tn-bf-left {
  animation: tn-wing-left 0.17s infinite alternate ease-in-out !important;
}

.tn-bf-right {
  animation: tn-wing-right 0.17s infinite alternate ease-in-out !important;
}

@keyframes tn-wing-left {
  0% { transform: scaleX(1) rotate(6deg); }
  100% { transform: scaleX(0.18) rotate(-18deg); }
}

@keyframes tn-wing-right {
  0% { transform: scaleX(1) rotate(-6deg); }
  100% { transform: scaleX(0.18) rotate(18deg); }
}

/* Mariposa 1: Verde Esmeralda & Destello Dorado */
.tn-bf-1 {
  top: -6px;
  left: 8px;
  animation: tn-butterfly-orbit-1 5.6s infinite ease-in-out !important;
}
.tn-bf-1 .tn-bf-wing {
  background: linear-gradient(135deg, #10b981, #34d399, #fde047) !important;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.8) !important;
}

/* Mariposa 2: Turquesa Flora */
.tn-bf-2 {
  bottom: -4px;
  right: 10px;
  animation: tn-butterfly-orbit-2 6.4s infinite ease-in-out 1.2s !important;
}
.tn-bf-2 .tn-bf-wing {
  background: linear-gradient(135deg, #06b6d4, #38bdf8, #a7f3d0) !important;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.8) !important;
  width: 5.5px !important;
  height: 7.5px !important;
}
.tn-bf-2 .tn-bf-left { animation-duration: 0.14s !important; }
.tn-bf-2 .tn-bf-right { animation-duration: 0.14s !important; }

/* Mariposa 3: Ámbar & Miel Natural */
.tn-bf-3 {
  top: 20px;
  right: -8px;
  animation: tn-butterfly-orbit-3 4.6s infinite ease-in-out 2.4s !important;
}
.tn-bf-3 .tn-bf-wing {
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #f43f5e) !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8) !important;
  width: 5px !important;
  height: 7px !important;
}
.tn-bf-3 .tn-bf-left { animation-duration: 0.19s !important; }
.tn-bf-3 .tn-bf-right { animation-duration: 0.19s !important; }

/* Trayectorias suaves de vuelo alrededor del botón */
@keyframes tn-butterfly-orbit-1 {
  0% { transform: translate(0px, 0px) rotate(12deg) scale(0.9); }
  25% { transform: translate(-14px, 26px) rotate(-22deg) scale(1.06); }
  50% { transform: translate(16px, 58px) rotate(35deg) scale(0.94); }
  75% { transform: translate(44px, 18px) rotate(-16deg) scale(1.1); }
  100% { transform: translate(0px, 0px) rotate(12deg) scale(0.9); }
}

@keyframes tn-butterfly-orbit-2 {
  0% { transform: translate(0px, 0px) rotate(-16deg) scale(0.85); }
  25% { transform: translate(18px, -24px) rotate(26deg) scale(1); }
  50% { transform: translate(-22px, -46px) rotate(-32deg) scale(0.92); }
  75% { transform: translate(-38px, -12px) rotate(16deg) scale(1.05); }
  100% { transform: translate(0px, 0px) rotate(-16deg) scale(0.85); }
}

@keyframes tn-butterfly-orbit-3 {
  0% { transform: translate(0px, 0px) rotate(0deg) scale(0.8); }
  30% { transform: translate(-28px, -16px) rotate(-36deg) scale(1); }
  60% { transform: translate(-16px, 28px) rotate(22deg) scale(0.9); }
  85% { transform: translate(12px, 8px) rotate(-10deg) scale(0.96); }
  100% { transform: translate(0px, 0px) rotate(0deg) scale(0.8); }
}

/* ========================================================
   MINI-VENTANA FLOTANTE DE CTA EN PÁGINA DE PRODUCTO
   ======================================================== */
.tn-product-quick-cta {
  display: none;
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 290px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  border: 1.5px solid #22c55e;
  overflow: hidden;
  animation: tn-slide-up 0.35s ease-out;
  z-index: 999998;
}

.tn-product-quick-cta.visible {
  display: block;
}

.tn-quick-cta-header {
  background: linear-gradient(135deg, #15803d, #166534);
  color: #ffffff;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tn-quick-cta-header span {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tn-quick-cta-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  padding: 1px 4px;
  line-height: 1;
  opacity: 0.85;
}
.tn-quick-cta-close:hover { opacity: 1; }

.tn-quick-cta-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tn-quick-cta-prod-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tn-quick-cta-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 2px;
  flex-shrink: 0;
}

.tn-quick-cta-info {
  flex: 1;
  min-width: 0;
}

.tn-quick-cta-title {
  font-size: 12px;
  font-weight: 750;
  color: #1e293b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-quick-cta-price {
  font-size: 13.5px;
  font-weight: 800;
  color: #15803d;
  margin-top: 1px;
}

.tn-quick-cta-quote {
  font-size: 11px;
  color: #334155;
  line-height: 1.3;
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  padding: 5px 7px;
  border-radius: 4px;
}

.tn-quick-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.tn-quick-buy-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff !important;
  border: none;
  font-size: 11.5px;
  font-weight: 750;
  padding: 8px;
  border-radius: 7px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.35);
  cursor: pointer;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
  position: relative !important;
  overflow: hidden !important;
}

.tn-quick-buy-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 25%;
  height: 200%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(25deg);
  animation: tn-shimmer 3s infinite ease-in-out;
}

.tn-quick-wa-btn {
  background: #25D366;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 11px;
  font-weight: 650;
  padding: 6px;
  border-radius: 7px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.tn-quick-chat-link {
  font-size: 10.5px;
  color: #15803d;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  margin-top: 1px;
}

/* ========================================================
   CONTENEDOR PRINCIPAL DEL CHAT Y PANEL LATERAL
   ======================================================== */
.tn-widget-container {
  display: none;
  position: absolute;
  bottom: 74px;
  right: 0;
  gap: 10px;
  align-items: flex-end;
}

.tn-widget-container.open {
  display: flex;
}

/* Ventana Principal del Chat */
.tn-chat-window {
  width: 375px;
  height: 560px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 90px);
  background: #ffffff;
  border-radius: var(--tn-radius);
  box-shadow: var(--tn-shadow);
  border: 1px solid rgba(22, 101, 52, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: tn-slide-up 0.3s ease-out;
}

@keyframes tn-slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cabecera del Chat Compacta */
.tn-chat-header {
  background: linear-gradient(135deg, #15803d, #14532d);
  color: var(--tn-white);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tn-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tn-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1.5px solid #ffffff;
  overflow: hidden;
}

.tn-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tn-header-title h4 {
  margin: 0 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 15px !important;
  letter-spacing: 0.2px !important;
  line-height: 1.15 !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.tn-ia-tag {
  background: rgba(255, 255, 255, 0.25);
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #ffffff !important;
}

.tn-header-title span {
  font-size: 10.5px;
  opacity: 0.95;
  color: #e2e8f0 !important;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tn-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #4ade80;
}

.tn-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.tn-icon-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  outline: none !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.tn-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  transform: scale(1.05) !important;
}

#tn-close-btn:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.05) !important;
}

.tn-icon-btn svg {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  stroke: #ffffff !important;
  stroke-width: 2.6 !important;
  flex-shrink: 0 !important;
}

/* Área de Mensajes */
.tn-chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.tn-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  line-height: 1.4;
  font-size: 13px;
  word-break: break-word;
}

.tn-msg.bot { align-self: flex-start; }
.tn-msg.user { align-self: flex-end; }

.tn-msg-bubble {
  padding: 8px 12px;
  border-radius: 14px;
}

.tn-msg.bot .tn-msg-bubble {
  background-color: #ffffff;
  color: var(--tn-text-main);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

.tn-msg.user .tn-msg-bubble {
  background: linear-gradient(135deg, var(--tn-primary), var(--tn-primary-dark));
  color: var(--tn-white);
  border-bottom-right-radius: 4px;
}

.tn-msg a {
  color: var(--tn-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* BOTÓN DESTACADO DENTRO DEL CHAT CON PULSO Y RESPLANDOR */
.tn-chat-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff !important;
  border: none;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 15px;
  border-radius: 18px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
  margin-top: 5px;
  cursor: pointer;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
  position: relative !important;
  overflow: hidden !important;
  transition: transform 0.15s, background 0.15s;
}

.tn-chat-buy-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 25%;
  height: 200%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(25deg);
  animation: tn-shimmer 3s infinite ease-in-out;
}

.tn-chat-buy-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: linear-gradient(135deg, #15803d, #166534);
}

/* Contenedor de Tarjetas Verticales Dinámicas (Horizontal Scroll / Carousel) */
.tn-cards-container {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.tn-cards-container::-webkit-scrollbar {
  height: 8px;
}

.tn-cards-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}

.tn-cards-container::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 1.5px solid #f1f5f9;
}

.tn-cards-container::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Tarjetita Vertical Dinámica Interactiva */
.tn-vertical-card {
  flex: 0 0 136px;
  max-width: 136px;
  scroll-snap-align: start;
  background: #ffffff;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.tn-vertical-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #22c55e;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.18);
}

.tn-vertical-thumb {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  padding: 2px;
  margin-bottom: 4px;
}

.tn-vertical-title {
  font-size: 11px;
  font-weight: 750;
  color: #1e293b;
  line-height: 1.25;
  height: 28px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.tn-vertical-price {
  font-size: 12.5px;
  font-weight: 850;
  color: #15803d;
  margin-bottom: 6px;
}

/* Botón / Ficha Destacada Animada de Producto */
.tn-featured-product-btn {
  margin-top: 8px;
  background: #ffffff;
  border: 1.8px solid #86efac;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.15);
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer;
  animation: tn-pulse-glow 2.4s infinite ease-in-out;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.tn-featured-product-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #22c55e;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.25);
  background: #f0fdf4;
}

@keyframes tn-pulse-glow {
  0%, 100% {
    box-shadow: 0 3px 10px rgba(22, 163, 74, 0.15);
    border-color: #86efac;
  }
  50% {
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
    border-color: #22c55e;
  }
}

.tn-featured-thumb {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 2px;
  flex-shrink: 0;
}

.tn-featured-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tn-featured-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-featured-price {
  font-size: 13px;
  font-weight: 850;
  color: #15803d;
  margin-top: 2px;
}

/* Contenedor de 2 Botones de Acción en Tarjetas Verticales */
.tn-card-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
}

/* Botón 1: 🛒 Agregar al Carrito */
.tn-btn-add-cart {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  color: #ffffff !important;
  border: 1px solid #16a34a !important;
  border-radius: 8px !important;
  padding: 6px 4px !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35) !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.tn-btn-add-cart:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
  border-color: #14532d !important;
  transform: translateY(-1.5px) scale(1.04) !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.5) !important;
}

.tn-btn-add-cart:active {
  transform: scale(0.96) !important;
}

.tn-btn-add-cart.added {
  background: #14532d !important;
  color: #86efac !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6) !important;
  transform: scale(1.02) !important;
}

/* Botón 2: 👁️ Ver Producto (Altamente Llamativo e Invitante al Clic) */
.tn-btn-view-prod {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
  color: #15803d !important;
  border: 1.5px solid #22c55e !important;
  border-radius: 8px !important;
  padding: 6px 4px !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.18) !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.tn-btn-view-prod:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  border-color: #15803d !important;
  color: #ffffff !important;
  transform: translateY(-1.5px) scale(1.04) !important;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.45) !important;
}

.tn-btn-view-prod:active {
  transform: scale(0.96) !important;
}

/* Acciones en Tarjeta Destacada Individual */
.tn-featured-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tn-featured-actions .tn-btn-add-cart,
.tn-featured-actions .tn-btn-view-prod {
  padding: 6px 8px !important;
  font-size: 10.5px !important;
}

/* ========================================================
   BOTÓN DESTACADO: VER MÁS PRODUCTOS EN LA TIENDA (AURA Y ALTO IMPACTO)
   ======================================================== */
.tn-more-products-wrap {
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.tn-btn-see-more-store {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 50%, #14532d 100%) !important;
  border: 1.5px solid #4ade80 !important;
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 12px 15px !important;
  border-radius: 12px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: -0.2px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  gap: 10px !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4) !important;
  animation: tn-glow-aura 2.8s infinite ease-in-out !important;
}

.tn-btn-see-more-store::after {
  content: "" !important;
  position: absolute !important;
  top: -50% !important;
  left: -70% !important;
  width: 50% !important;
  height: 200% !important;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%) !important;
  transform: rotate(25deg) !important;
  animation: tn-shimmer-sweep 3.5s infinite ease-in-out !important;
  pointer-events: none !important;
}

@keyframes tn-glow-aura {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7), 0 4px 14px rgba(22, 163, 74, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(74, 222, 128, 0), 0 6px 22px rgba(34, 197, 94, 0.65);
    transform: scale(1.015);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0), 0 4px 14px rgba(22, 163, 74, 0.4);
    transform: scale(1);
  }
}

@keyframes tn-shimmer-sweep {
  0% { left: -70%; }
  35% { left: 140%; }
  100% { left: 140%; }
}

.tn-btn-see-more-store:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%) !important;
  border-color: #86efac !important;
  color: #ffffff !important;
  transform: translateY(-2px) scale(1.025) !important;
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.8), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

.tn-see-more-content {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  line-height: 1.25 !important;
  color: #ffffff !important;
}

.tn-see-more-icon {
  font-size: 17px !important;
  flex-shrink: 0 !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.tn-see-more-text {
  color: #ffffff !important;
  font-size: 14.5px !important;
  font-weight: 750 !important;
}

.tn-see-more-text strong {
  color: #fef08a !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

.tn-btn-see-more-store:hover .tn-see-more-text strong {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8) !important;
}

.tn-see-more-arrow {
  font-size: 16px !important;
  font-weight: 900 !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
  color: #ffffff !important;
  transition: transform 0.22s ease !important;
}

.tn-btn-see-more-store:hover .tn-see-more-arrow {
  transform: translate(3px, -3px) scale(1.15) !important;
}

/* Fallback o inline card clásica */
.tn-inline-card {
  margin-top: 8px;
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #bbf7d0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.tn-inline-thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3px;
  flex-shrink: 0;
}

.tn-inline-details {
  flex: 1;
  min-width: 0;
}

.tn-inline-title {
  font-size: 12px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-inline-desc {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-inline-price {
  font-size: 13px;
  font-weight: 850;
  color: #15803d;
  margin-top: 2px;
}

.tn-inline-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.tn-inline-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #334155 !important;
  text-decoration: none !important;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tn-inline-buy-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff !important;
  border: none;
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
  cursor: pointer;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
  transition: transform 0.15s, background 0.15s;
}

.tn-inline-buy-btn:hover {
  transform: scale(1.04);
  background: linear-gradient(135deg, #15803d, #166534);
}

/* Botón de Atención Humana */
.tn-human-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 3px 8px rgba(37, 211, 102, 0.35);
  margin-top: 3px;
}

/* Indicador de "Diana está escribiendo..." Ultra Realista */
.tn-typing-wrapper {
  display: flex !important;
  align-items: flex-end !important;
  gap: 6px !important;
  margin-top: 2px !important;
  margin-bottom: 4px !important;
  animation: tn-fade-in 0.25s ease-out;
}

.tn-avatar-mini {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #86efac;
  overflow: hidden;
  flex-shrink: 0;
  background: #ffffff;
}

.tn-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tn-typing-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ffffff;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.tn-typing-author {
  font-size: 10.5px;
  font-weight: 700;
  color: #15803d;
}

.tn-typing-dots {
  display: flex;
  align-items: center;
  gap: 3px;
}

.tn-dot {
  width: 5px;
  height: 5px;
  background: #22c55e;
  border-radius: 50%;
  animation: tn-bounce 1.4s infinite ease-in-out both;
}
.tn-dot:nth-child(1) { animation-delay: -0.32s; }
.tn-dot:nth-child(2) { animation-delay: -0.16s; }
.tn-dot:nth-child(3) { animation-delay: 0s; }

@keyframes tn-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.15); opacity: 1; }
}

@keyframes tn-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Efecto de Cursor al Digitar */
.tn-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 13px;
  background-color: #15803d;
  margin-left: 2px;
  vertical-align: middle;
  animation: tn-cursor-blink 0.8s infinite;
}

@keyframes tn-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.tn-chat-footer {
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}
.tn-input-form {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tn-chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.2s;
}
.tn-chat-input:focus {
  border-color: var(--tn-primary);
}
#tn-chatbot-root .tn-send-btn,
.tn-send-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  background-color: #15803d !important;
  border: none !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: 0 2px 6px rgba(22, 101, 52, 0.35) !important;
  flex-shrink: 0 !important;
  transition: transform 0.15s, background 0.15s !important;
  outline: none !important;
  line-height: 1 !important;
}

#tn-chatbot-root .tn-send-btn:hover,
.tn-send-btn:hover {
  transform: scale(1.08) !important;
  background: linear-gradient(135deg, #15803d, #166534) !important;
}

#tn-chatbot-root .tn-send-btn svg,
.tn-send-btn svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  fill: #ffffff !important;
  color: #ffffff !important;
  stroke: none !important;
  display: block !important;
  margin: 0 auto !important;
  pointer-events: none !important;
}
.tn-footer-branding {
  text-align: center;
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 3px;
}

/* ========================================================
   PANEL LATERAL: MODO PRODUCTO ACTUAL Y MODO MINI-CHECKOUT
   ======================================================== */
.tn-side-cta-panel {
  display: none;
  width: 310px;
  height: 560px;
  max-height: calc(100vh - 90px);
  background: #ffffff;
  border-radius: var(--tn-radius);
  box-shadow: var(--tn-shadow);
  border: 1.5px solid rgba(34, 197, 94, 0.3);
  flex-direction: column;
  overflow: hidden;
  animation: tn-slide-left 0.3s ease-out;
}

@keyframes tn-slide-left {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.tn-side-cta-panel.active {
  display: flex;
}

/* Header lateral súper compacto para ganar espacio */
.tn-cta-panel-header {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-bottom: 1px solid #bbf7d0;
  padding: 6px 10px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tn-cta-panel-header span {
  font-size: 11.5px !important;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tn-cta-close-btn {
  background: rgba(15, 23, 42, 0.08) !important;
  border: none !important;
  color: #475569 !important;
  cursor: pointer !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: all 0.2s ease !important;
  line-height: 1 !important;
}

.tn-cta-close-btn:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.05) !important;
}

/* Vista 1: Vista de Producto Actual */
.tn-side-view-product {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  overflow-y: auto;
  gap: 6px;
}

.tn-cta-img {
  width: 110px;
  height: 110px;
  min-height: 90px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 3px;
  display: block;
}

.tn-cta-prod-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.25;
}

.tn-cta-prod-price {
  font-size: 15px;
  font-weight: 800;
  color: #15803d;
  background: #dcfce7;
  padding: 3px 10px;
  border-radius: 6px;
}

.tn-cta-quote-box {
  background: #f8fafc;
  border-left: 3px solid #22c55e;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 11px;
  color: #334155;
  line-height: 1.35;
  text-align: left;
  margin: 2px 0;
  width: 100%;
}

.tn-cta-buy-btn {
  width: 100%;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff !important;
  border: none;
  padding: 9px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 750;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
  position: relative !important;
  overflow: hidden !important;
  transition: transform 0.15s;
}

.tn-cta-buy-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 25%;
  height: 200%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(25deg);
  animation: tn-shimmer 3s infinite ease-in-out;
}

.tn-cta-buy-btn:hover {
  transform: scale(1.02);
  background: linear-gradient(135deg, #15803d, #166534);
}

.tn-cta-add-cart-btn {
  width: 100%;
  background: #ffffff !important;
  color: #166534 !important;
  border: 1.5px solid #22c55e !important;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15);
  transition: all 0.18s ease;
  margin-top: 4px;
}

.tn-cta-add-cart-btn:hover {
  background: #f0fdf4 !important;
  border-color: #16a34a !important;
  transform: translateY(-1px);
}

.tn-cta-wa-btn {
  width: 100%;
  background: #25D366;
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 7px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
  transition: transform 0.15s;
}

/* ========================================================
   VISTA DEL CARRITO DE COMPRAS EN PANEL LATERAL
   ======================================================== */
.tn-side-view-cart {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 480px;
}

.tn-cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 15px;
  text-align: center;
}

.tn-cart-empty-icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.tn-cart-empty-title {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 6px;
}

.tn-cart-empty-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
}

.tn-cart-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tn-cart-items-list {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tn-cart-items-list::-webkit-scrollbar {
  width: 5px;
}

.tn-cart-items-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.tn-cart-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 8px;
  transition: background 0.15s;
}

.tn-cart-item-row:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.tn-cart-item-thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  padding: 2px;
}

.tn-cart-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tn-cart-item-title {
  font-size: 11px;
  font-weight: 750;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.tn-cart-item-price {
  font-size: 11.5px;
  font-weight: 800;
  color: #15803d;
  margin-top: 2px;
}

.tn-cart-qty-ctrls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 4px;
}

.tn-cart-qty-btn {
  background: none !important;
  border: none !important;
  color: #334155 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  width: 18px !important;
  height: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border-radius: 3px !important;
  padding: 0 !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}

.tn-cart-qty-btn:hover:not(:disabled) {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.tn-cart-qty-btn:disabled,
.tn-cart-qty-btn.tn-cart-qty-min {
  opacity: 0.25 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.tn-cart-qty-val {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  min-width: 14px;
  text-align: center;
}

.tn-cart-remove-btn {
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 4px 6px !important;
  border-radius: 4px !important;
  transition: all 0.18s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.tn-cart-remove-btn:hover {
  color: #ef4444 !important;
  background: #fee2e2 !important;
  transform: scale(1.15) !important;
}

.tn-cart-summary-box {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tn-cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #1e293b;
}

.tn-cart-subtotal-val {
  font-size: 14px;
  color: #15803d;
}

.tn-cart-free-shipping-notice {
  font-size: 10px;
  color: #166534;
  background: #dcfce7;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
}

.tn-cart-checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
  transition: transform 0.15s !important;
}

.tn-cart-checkout-btn:hover {
  transform: scale(1.02) !important;
  background: linear-gradient(135deg, #15803d, #166534) !important;
}

.tn-cart-clear-btn {
  background: none !important;
  border: none !important;
  color: #64748b !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-align: center !important;
  text-decoration: underline !important;
  padding: 2px !important;
}

.tn-cart-clear-btn:hover {
  color: #ef4444 !important;
}

/* NOTIFICACIÓN TOAST FLOTANTE */
.tn-toast-notification {
  position: absolute !important;
  top: 50px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(-12px) !important;
  background: #0f172a !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  border-radius: 20px !important;
  font-size: 11.5px !important;
  font-weight: 750 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  z-index: 999999 !important;
  opacity: 0 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  white-space: nowrap !important;
}

.tn-toast-notification.show {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}

@keyframes tn-cart-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.tn-cart-badge.pop {
  animation: tn-cart-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* ========================================================
   VISTA 2: MINI CHECKOUT INTEGRADO (FORMULARIO Y PASOS)
   ======================================================== */
.tn-side-view-checkout {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 8px 10px !important;
  overflow-y: auto;
  gap: 5px;
}

/* Mini Barra de Progreso Compacta */
.tn-checkout-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  border-radius: 7px;
  margin-bottom: 2px;
}

.tn-progress-step {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.tn-progress-step.active {
  color: #15803d;
}

.tn-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
}

.tn-progress-step.active .tn-step-dot {
  background: #15803d;
  color: #ffffff;
}

.tn-progress-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  margin: 0 6px;
}

.tn-progress-line.filled {
  background: #22c55e;
}

.tn-checkout-item-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.tn-checkout-item-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 5px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.tn-checkout-item-info {
  flex: 1;
  min-width: 0;
}

.tn-checkout-item-name {
  font-size: 11px;
  font-weight: 800;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tn-checkout-item-price {
  font-size: 11.5px;
  font-weight: 800;
  color: #15803d;
}

.tn-checkout-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* FILAS Y CELDAS ULTRA-COMPACTAS PEGADAS A SUS TÍTULOS */
.tn-form-row {
  display: flex;
  flex-direction: column;
  gap: 1px !important;
  margin-bottom: 3px;
}

.tn-form-row label {
  font-size: 10px !important;
  font-weight: 750;
  color: #334155;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.15;
}

.tn-form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.tn-form-input, .tn-form-select {
  padding: 5px 7px !important;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 11.5px !important;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  height: 30px;
  transition: border-color 0.15s, background-color 0.15s;
}

.tn-form-input:focus, .tn-form-select:focus {
  border-color: #15803d;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* ESTADO ROJIZO DE ERROR DE VALIDACIÓN */
.tn-input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25) !important;
}

.tn-error-hint {
  font-size: 9.5px;
  color: #ef4444;
  font-weight: 600;
  margin-top: 1px;
  display: none;
}

.tn-input-error + .tn-error-hint,
.tn-form-row.has-error .tn-error-hint {
  display: block;
}

.tn-shipping-badge {
  font-size: 10px;
  padding: 4px 7px;
  background: #f0fdf4;
  border-radius: 5px;
  border-left: 3px solid #22c55e;
  color: #166534;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1px;
}

/* Opciones de Pago */
.tn-payment-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.tn-payment-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}

.tn-payment-card:hover {
  border-color: #86efac;
  background: #f0fdf4;
}

.tn-payment-card.selected {
  border-color: #15803d;
  background: #f0fdf4;
  box-shadow: 0 2px 5px rgba(22, 101, 52, 0.15);
}

.tn-payment-card input {
  cursor: pointer;
  accent-color: #15803d;
}

.tn-payment-text {
  flex: 1;
}

.tn-payment-title {
  font-size: 11px;
  font-weight: 750;
  color: #1e293b;
}

.tn-payment-desc {
  font-size: 9px;
  color: #64748b;
}

/* Totales */
.tn-totals-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10.5px;
  margin-top: 2px;
}

.tn-totals-row {
  display: flex;
  justify-content: space-between;
  color: #475569;
}

.tn-totals-row.final {
  border-top: 1px dashed #cbd5e1;
  padding-top: 3px;
  font-size: 12px;
  font-weight: 800;
  color: #15803d;
}

.tn-checkout-submit-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff !important;
  border: none;
  padding: 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.35);
  margin-top: 3px;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
}

.tn-checkout-submit-btn:hover {
  background: linear-gradient(135deg, #15803d, #166534);
}

.tn-checkout-back-btn {
  background: none;
  border: none;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-align: center;
}

/* Vista 3: Éxito de Orden */
.tn-side-view-success {
  display: none;
  flex-direction: column;
  flex: 1;
  padding: 14px 12px;
  align-items: center;
  text-align: center;
  gap: 10px;
  overflow-y: auto;
}

.tn-success-icon {
  width: 50px;
  height: 50px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #15803d;
}

.tn-success-title {
  font-size: 14px;
  font-weight: 800;
  color: #15803d;
}

.tn-success-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  width: 100%;
  text-align: left;
  font-size: 11px;
  line-height: 1.4;
  color: #334155;
}

.tn-mp-btn {
  background: #009ee3;
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  animation: tn-glow-pulse 2.2s infinite ease-in-out !important;
}

/* ========================================================
   MODAL / POPUP OVERLAY DE MERCADO PAGO INTEGRADO
   ======================================================== */
.tn-mp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: tn-modal-fade-in 0.25s ease-out;
}

@keyframes tn-modal-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.tn-mp-modal-box {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  height: 92vh;
  max-height: 820px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  position: relative;
}

.tn-mp-modal-header {
  background: linear-gradient(135deg, #009ee3, #007eb5);
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 158, 227, 0.25);
  flex-shrink: 0;
}

.tn-mp-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -0.2px;
}

.tn-mp-modal-close {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tn-mp-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.tn-mp-modal-body {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  background: #f8fafc;
}

.tn-mp-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.tn-mp-spinner-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.tn-mp-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: #009ee3;
  border-radius: 50%;
  animation: tn-spin 0.8s linear infinite;
}

@keyframes tn-spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   ADAPTACIÓN RESPONSIVA PARA CELULARES (MOBILE)
   ======================================================== */
@media (max-width: 768px) {
  #tn-chatbot-root {
    bottom: 16px !important;
    right: 16px !important;
  }
  .tn-chat-launcher {
    width: 58px !important;
    height: 58px !important;
  }
  .tn-side-reopen-btn {
    padding: 6px 11px !important;
    font-size: 11px !important;
  }
  .tn-product-quick-cta {
    width: calc(100vw - 32px);
    right: 0;
    bottom: 70px;
  }
  .tn-widget-container {
    position: fixed;
    bottom: 74px;
    right: 10px;
    left: 10px;
    top: auto;
    width: auto;
    max-width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .tn-chat-window {
    width: 100%;
    height: 440px;
    max-height: calc(100vh - 110px);
  }
  .tn-side-cta-panel {
    width: 100%;
    height: auto;
    max-height: 360px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  }
  .tn-mp-modal-overlay {
    padding: 0;
  }
  .tn-mp-modal-box {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .tn-mp-modal-header {
    padding: 10px 14px;
  }
  .tn-mp-modal-title span {
    font-size: 12px;
  }
}
