/* ==========================================================================
   La Pieza.DO sobre Pintex demo-11.
   Se carga DESPUÉS de purple-theme.css. Solo cambia los colores del tema
   (el template ya los toma de variables) y agrega las piezas propias del
   soporte (chat, tickets, guía), hechas con las mismas medidas, radios y
   tipografía del template. Quitar este archivo devuelve el template original.
   ========================================================================== */

:root {
  --theme-color: #e63118;            /* rojo La Pieza */
  --theme-color-secondary: #003b76;  /* azul marino La Pieza */
  --lp-magenta: #c2126f;
  --lp-soft: #fdf3f1;
}

/* Revelado al hacer scroll (reemplaza wow.js). Sin JS, todo se ve. */
.js-reveal .wow:not(.is-visible) { visibility: hidden; animation-name: none !important; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .wow { visibility: visible !important; }
  .wow, .hero-float, .animate__animated { animation: none !important; transition: none !important; }
}

/* Hero: la imagen del sitio anterior, entra como en el template y luego flota. */
.hero-float { animation: lp-float 6s ease-in-out 1.2s infinite; }
@keyframes lp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Acordeón (reemplaza el slideToggle de jQuery). Mostrar/ocultar con un
   fundido corto: la transición de altura con grid-template-rows se quedaba
   trabada en Safari y en pestañas en segundo plano. */
.faqs-section .accordion-item .accordion-panel { display: none; }
.faqs-section .accordion-item.is-active .accordion-panel { display: block; animation: sp-acc-in .25s ease-out; }
@keyframes sp-acc-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .faqs-section .accordion-item.is-active .accordion-panel { animation: none; } }
.accordion-thumb { cursor: pointer; }
.accordion-thumb:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 4px; border-radius: 6px; }

/* ---------------------------------------------------------------- Chat */
.sp-chat {
  background: var(--white); border: 1px solid var(--tra-gray); border-radius: 16px;
  box-shadow: 0 20px 50px rgba(1, 1, 1, .08); overflow: hidden; display: flex; flex-direction: column;
  max-height: 560px; min-height: 420px;
}
.sp-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--tra-gray); }
.sp-chat-avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--theme-color); color: var(--white);
  display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.sp-chat-head h6 { margin: 0; font-size: 1rem; }
.sp-chat-head p { margin: 0; font-size: .85rem; color: var(--gray); }
.sp-chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.sp-msg { max-width: 88%; padding: 12px 16px; border-radius: 14px; font-size: .95rem; line-height: 1.55; }
.sp-msg p { margin: 0 0 6px; font-size: inherit; } .sp-msg p:last-child { margin: 0; }
.sp-msg ul { margin: 4px 0 6px 18px; padding: 0; } .sp-msg li { margin-bottom: 2px; }
.sp-msg-bot { align-self: flex-start; background: var(--white-smoke); color: var(--black); border-bottom-left-radius: 4px; }
.sp-msg-user { align-self: flex-end; background: var(--theme-color-secondary); color: var(--white); border-bottom-right-radius: 4px; }
.sp-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sp-sources a { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--white);
  border: 1px solid var(--tra-gray); color: var(--theme-color-secondary); }
.sp-typing span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--light-gray);
  animation: sp-dot 1.2s infinite ease-in-out; }
.sp-typing span:nth-child(2) { animation-delay: .15s; } .sp-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sp-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.sp-chat-form { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--tra-gray); }
.sp-chat-form input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 1px solid var(--tra-gray); border-radius: 10px;
  background: var(--form-control); font-size: 1rem; color: var(--black); }
.sp-chat-form input:focus { outline: none; border-color: var(--theme-color); background: var(--white); }
.sp-chat-form .btn { height: 52px; flex-shrink: 0; }
.sp-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.sp-suggest button { border: 1px solid var(--tra-gray); background: var(--white); color: var(--black); border-radius: 999px;
  padding: 6px 12px; font-size: .85rem; font-weight: 500; cursor: pointer; }
.sp-suggest button:hover { border-color: var(--theme-color); color: var(--theme-color); }

/* Panel de acceso dentro del chat y en Mis tickets */
.sp-auth { background: var(--white); border: 1px solid var(--tra-gray); border-radius: 14px; padding: 18px; align-self: stretch; }
.sp-auth h6 { margin-bottom: 4px; } .sp-auth p.sp-hint { font-size: .88rem; color: var(--gray); margin-bottom: 12px; }
.sp-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--white-smoke); padding: 4px; border-radius: 10px; }
.sp-tabs button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 8px; font-weight: 600; font-size: .88rem; color: var(--gray); cursor: pointer; }
.sp-tabs button.is-active { background: var(--white); color: var(--theme-color-secondary); box-shadow: 0 2px 6px rgba(1, 1, 1, .06); }
.sp-field { display: block; margin-bottom: 10px; }
.sp-field span { display: block; font-size: .82rem; font-weight: 600; color: var(--black); margin-bottom: 4px; }
.sp-field input, .sp-field textarea, .sp-field select { width: 100%; border: 1px solid var(--tra-gray); border-radius: 10px; padding: 12px 14px;
  background: var(--form-control); font-size: .95rem; color: var(--black); }
.sp-field input:focus, .sp-field textarea:focus, .sp-field select:focus { outline: none; border-color: var(--theme-color); background: var(--white); }
.sp-error { color: var(--theme-color); font-size: .86rem; margin: 4px 0 8px; }
.sp-ok { color: var(--green); font-size: .86rem; margin: 4px 0 8px; }
.sp-link-btn { border: 0; background: none; padding: 0; color: var(--theme-color-secondary); font-weight: 600; font-size: .86rem; text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- Tickets */
.sp-ticket-list { display: flex; flex-direction: column; gap: 10px; }
.sp-ticket { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1px solid var(--tra-gray);
  background: var(--white); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.sp-ticket:hover, .sp-ticket.is-active { border-color: var(--theme-color); box-shadow: 0 8px 20px rgba(1, 1, 1, .05); }
.sp-ticket-code { font-weight: 700; color: var(--theme-color-secondary); font-size: .85rem; white-space: nowrap; }
.sp-ticket-subject { flex: 1; min-width: 0; font-weight: 600; color: var(--black); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.sp-badge--pending { background: #fff4e0; color: #9a5b00; }
.sp-badge--resolved { background: #e7f7ee; color: #0b7a3b; }
.sp-badge--closed { background: var(--white-smoke); color: var(--gray); }
.sp-dot-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--theme-color); flex-shrink: 0; }
.sp-thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.sp-panel { background: var(--white); border: 1px solid var(--tra-gray); border-radius: 16px; padding: 24px; }
.sp-empty { text-align: center; color: var(--gray); padding: 30px 10px; }

/* ---------------------------------------------------------------- Guía (página interior) */
.sp-article { font-size: 1rem; line-height: 1.75; color: var(--black); }
.sp-article h2, .sp-article h3, .sp-article h4 { margin: 28px 0 12px; }
.sp-article p, .sp-article li { font-size: 1rem; }
.sp-article img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--tra-gray); margin: 12px 0; }
.sp-article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92rem; }
.sp-article th, .sp-article td { border: 1px solid var(--tra-gray); padding: 8px 10px; vertical-align: top; }
.sp-article .support-step { padding-bottom: 8px; border-bottom: 1px dashed var(--tra-gray); margin-bottom: 18px; }
.sp-side { position: sticky; top: 110px; }
.sp-side h6 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray); margin: 18px 0 8px; }
.sp-side a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--black); font-size: .93rem; }
.sp-side a:hover, .sp-side a.is-active { background: var(--lp-soft); color: var(--theme-color); }
.sp-inner-hero { padding: 160px 0 50px; background: var(--white-smoke); }
.sp-crumbs { font-size: .88rem; color: var(--gray); margin-bottom: 10px; } .sp-crumbs a { color: var(--theme-color-secondary); }

/* WhatsApp flotante */
.sp-wa { position: fixed; right: 20px; bottom: 20px; z-index: 999; width: 56px; height: 56px; border-radius: 50%;
  background: #25d366; display: grid; place-items: center; box-shadow: 0 10px 25px rgba(0, 0, 0, .2); }
.sp-wa img { width: 30px; height: 30px; }
#scrollUp { right: 90px; }

@media (max-width: 767.98px) {
  .sp-chat { max-height: 70vh; }
  .sp-inner-hero { padding: 110px 0 30px; }
  .sp-side { position: static; margin-bottom: 20px; }
}

/* Banner "¿Sigues con dudas?": el fondo del template es una foto de muestra;
   aquí va el degradado de la marca. */
.banner-1-wrapper.bg--01 { background-image: linear-gradient(120deg, var(--theme-color-secondary) 0%, #0b2f63 45%, var(--theme-color) 130%); }
.banner-1-wrapper.bg--01 .banner-overlay { background: transparent; }

/* En celular el template centra el texto del hero: el chat va alineado a la izquierda. */
.hero-11-txt .sp-chat { text-align: left; }

/* Selector de badges (ChipSelect) */
.sp-chips-field { border: 0; padding: 0; margin: 0 0 10px; }
.sp-chips-field legend { float: none; width: auto; margin: 0; padding: 0; font-size: inherit; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sp-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--tra-gray);
  border-radius: 999px; background: var(--white); color: var(--black); font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s; }
.sp-chip:hover { border-color: var(--theme-color); color: var(--theme-color); }
.sp-chip:focus-visible { outline: 2px solid var(--theme-color); outline-offset: 2px; }
.sp-chip.is-on { background: var(--theme-color); border-color: var(--theme-color); color: var(--white); cursor: default; padding-right: 6px; }
.sp-chip-x { width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .25); color: var(--white);
  font-size: 1.05rem; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.sp-chip-x:hover { background: rgba(255, 255, 255, .4); }
/* .sp-field span pone display:block a las etiquetas; el badge debe ir en línea con su ✕ */
.sp-chips-field .sp-chip { display: inline-flex; margin: 0; font-size: .9rem; color: var(--black); }
.sp-chips-field .sp-chip.is-on { color: var(--white); }
