/* ==========================================================
   SOFGEN CDMO — TOOLBAR DE ACCESIBILIDAD (#pcA11yFloat)
   Basado en la versión de sofgenpharma.com, sin estilos de demo.
   Cargar DESPUÉS de la hoja principal del sitio.
   ========================================================== */


/* ==========================================================
   1. BOTÓN FLOTANTE
   ========================================================== */

#pcA11yFloat {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  font-family: 'Poppins', 'Calibri', 'Segoe UI', sans-serif;
}

/* FAB — botón circular */
#pcA11yFloat .pc-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #21264E;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(33, 38, 78, 0.35);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  z-index: 2;
}

#pcA11yFloat .pc-fab:hover {
  background: #009591;
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(0, 149, 145, 0.4);
}

#pcA11yFloat .pc-fab:focus-visible {
  outline: 3px solid #009591;
  outline-offset: 3px;
}

#pcA11yFloat .pc-fab svg {
  width: 28px;
  height: 28px;
}

/* Bootstrap Icons: centrado óptico dentro del toolbar */
#pcA11yFloat .bi {
  display: inline-flex;
  line-height: 1;
}

#pcA11yFloat .bi::before {
  vertical-align: 0;
}

#pcA11yFloat .pc-fab > .bi {
  font-size: 30px;
  color: #fff;
  transition: color 0.25s;
}

/* Pulso sutil */
#pcA11yFloat .pc-fab::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #009591;
  opacity: 0;
  animation: pcFabPulse 3s ease-in-out infinite;
}

@keyframes pcFabPulse {
  0%, 100% { opacity: 0;   transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.15); }
}

#pcA11yFloat .pc-fab[aria-expanded="true"]::after {
  animation: none;
  opacity: 0;
}


/* ==========================================================
   2. PANEL DESPLEGABLE
   ========================================================== */

#pcA11yFloat .pc-float-panel {
  position: absolute;
  bottom: 68px;
  left: 0;
  width: 280px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(33, 38, 78, 0.18), 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 2px solid #e4e8f0;
  overflow: hidden;
  transform: scale(0.85) translateY(12px);
  transform-origin: bottom left;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease,
              visibility 0.25s ease;
}

#pcA11yFloat .pc-float-panel.pc-panel-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Header */
#pcA11yFloat .pc-panel-header {
  background: #21264E;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#pcA11yFloat .pc-panel-header svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

#pcA11yFloat .pc-panel-header-icon {
  font-size: 20px;
  color: #8FE3DF;
  flex-shrink: 0;
}

#pcA11yFloat .pc-panel-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Cuerpo */
#pcA11yFloat .pc-panel-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#pcA11yFloat .pc-panel-label {
  font-size: 11px;
  font-weight: 700;
  color: #747A8A;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 4px;
}

/* Botones de control */
#pcA11yFloat .pc-ctrl-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #e4e8f0;
  background: #f8f9fc;
  color: #21264E;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

#pcA11yFloat .pc-ctrl-btn:hover {
  border-color: #009591;
  background: #E7F4F3;
}

#pcA11yFloat .pc-ctrl-btn:focus-visible {
  outline: 3px solid #009591;
  outline-offset: 2px;
}

#pcA11yFloat .pc-ctrl-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #21264E;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

#pcA11yFloat .pc-ctrl-icon svg {
  width: 18px;
  height: 18px;
}

#pcA11yFloat .pc-ctrl-icon i {
  font-size: 16px;
  color: #fff;
}

#pcA11yFloat .pc-ctrl-btn.pc-ctrl-active {
  border-color: #009591;
  background: #E7F4F3;
}

#pcA11yFloat .pc-ctrl-btn.pc-ctrl-active .pc-ctrl-icon {
  background: #009591;
}

#pcA11yFloat .pc-ctrl-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

#pcA11yFloat .pc-ctrl-name {
  font-size: 14px;
  font-weight: 600;
  color: #21264E;
  transition: color 0.3s;
}

#pcA11yFloat .pc-ctrl-hint {
  font-size: 11px;
  font-weight: 400;
  color: #747A8A;
  transition: color 0.3s;
}

/* Estado "leyendo" del TTS */
@keyframes pcTtsReading {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 112, 106, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 112, 106, 0); }
}

#pcA11yFloat .pc-ctrl-btn.pc-tts-reading .pc-ctrl-icon {
  background: #C0392B;
  animation: pcTtsReading 1.5s ease-in-out infinite;
}

/* Restablecer */
#pcA11yFloat .pc-reset-btn {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: transparent;
  color: #747A8A;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  margin-top: 2px;
  transition: all 0.2s;
}

#pcA11yFloat .pc-reset-btn:hover {
  background: #f0f0f0;
  color: #3F4250;
}

#pcA11yFloat .pc-reset-btn:focus-visible {
  outline: 3px solid #009591;
  outline-offset: 2px;
}


/* ==========================================================
   3. TAMAÑO DE FUENTE — clases en <html>
   ========================================================== */

html.pc-font-lg { font-size: 125% !important; }
html.pc-font-xl { font-size: 150% !important; }


/* ==========================================================
   4. ALTO CONTRASTE — .pc-high-contrast en <html>
   ========================================================== */

/* Fondos */
html.pc-high-contrast body,
html.pc-high-contrast main,
html.pc-high-contrast section,
html.pc-high-contrast article,
html.pc-high-contrast aside,
html.pc-high-contrast header,
html.pc-high-contrast footer,
html.pc-high-contrast nav,
html.pc-high-contrast div:not(#pcA11yFloat div) {
  background-color: #000 !important;
  border-color: #FFD700 !important;
}

html.pc-high-contrast .bg-white,
html.pc-high-contrast .bg-light,
html.pc-high-contrast [class*="bg-"] {
  background-color: #000 !important;
  background-image: none !important;
}

/* Textos */
html.pc-high-contrast body,
html.pc-high-contrast p,
html.pc-high-contrast li,
html.pc-high-contrast span,
html.pc-high-contrast label,
html.pc-high-contrast td,
html.pc-high-contrast th,
html.pc-high-contrast h1,
html.pc-high-contrast h2,
html.pc-high-contrast h3,
html.pc-high-contrast h4,
html.pc-high-contrast h5,
html.pc-high-contrast h6 {
  color: #fff !important;
}

/* Enlaces */
html.pc-high-contrast a {
  color: #FFD700 !important;
  text-decoration: underline !important;
}

/* Navbar y mega menú (Bootstrap) */
html.pc-high-contrast .navbar {
  border-bottom: 2px solid #FFD700 !important;
}

html.pc-high-contrast .navbar .nav-link,
html.pc-high-contrast .dropdown-item {
  color: #FFD700 !important;
}

html.pc-high-contrast .dropdown-menu {
  background-color: #000 !important;
  border: 2px solid #FFD700 !important;
}

html.pc-high-contrast .dropdown-item:hover,
html.pc-high-contrast .dropdown-item:focus {
  background-color: #222 !important;
}

/* Botones (Bootstrap) */
html.pc-high-contrast .btn {
  background-color: #FFD700 !important;
  border-color: #FFD700 !important;
  color: #000 !important;
  text-decoration: none !important;
}

/* Tarjetas (Bootstrap) */
html.pc-high-contrast .card {
  background-color: #1a1a1a !important;
  border: 2px solid #FFD700 !important;
}

/* Carrusel: controles visibles */
html.pc-high-contrast .carousel-control-prev-icon,
html.pc-high-contrast .carousel-control-next-icon {
  background-color: #FFD700 !important;
  border-radius: 50%;
}

html.pc-high-contrast .carousel-indicators [data-bs-target] {
  background-color: #FFD700 !important;
}

/* Footer */
html.pc-high-contrast footer {
  border-top: 2px solid #FFD700 !important;
}

/* Formularios */
html.pc-high-contrast input,
html.pc-high-contrast textarea,
html.pc-high-contrast select {
  background: #1a1a1a !important;
  color: #fff !important;
  border-color: #FFD700 !important;
}

/* Foco */
html.pc-high-contrast *:focus-visible {
  outline: 3px solid #FFD700 !important;
  outline-offset: 2px !important;
}


/* ==========================================================
   5. TOOLBAR EN ALTO CONTRASTE
   ========================================================== */

html.pc-high-contrast #pcA11yFloat .pc-fab {
  background: #FFD700;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

html.pc-high-contrast #pcA11yFloat .pc-fab > .bi { color: #000; }
html.pc-high-contrast #pcA11yFloat .pc-fab svg { stroke: #000; }
html.pc-high-contrast #pcA11yFloat .pc-fab::after { border-color: #FFD700; }

html.pc-high-contrast #pcA11yFloat .pc-float-panel {
  background: #111;
  border-color: #FFD700;
}

html.pc-high-contrast #pcA11yFloat .pc-panel-header {
  background: #000;
  border-bottom: 1px solid #FFD700;
}

html.pc-high-contrast #pcA11yFloat .pc-panel-header-icon { color: #FFD700; }

html.pc-high-contrast #pcA11yFloat .pc-ctrl-btn {
  background: #1a1a1a;
  border-color: #444;
  color: #fff;
}

html.pc-high-contrast #pcA11yFloat .pc-ctrl-btn:hover,
html.pc-high-contrast #pcA11yFloat .pc-ctrl-btn.pc-ctrl-active {
  border-color: #FFD700;
  background: #222;
}

html.pc-high-contrast #pcA11yFloat .pc-ctrl-icon { background: #333; }
html.pc-high-contrast #pcA11yFloat .pc-ctrl-btn.pc-ctrl-active .pc-ctrl-icon { background: #FFD700; }
html.pc-high-contrast #pcA11yFloat .pc-ctrl-btn.pc-ctrl-active .pc-ctrl-icon svg { stroke: #000; }
html.pc-high-contrast #pcA11yFloat .pc-ctrl-btn.pc-ctrl-active .pc-ctrl-icon i { color: #000; }

html.pc-high-contrast #pcA11yFloat .pc-ctrl-name { color: #fff !important; }
html.pc-high-contrast #pcA11yFloat .pc-ctrl-hint { color: #ccc !important; }
html.pc-high-contrast #pcA11yFloat .pc-panel-label { color: #aaa !important; }

html.pc-high-contrast #pcA11yFloat .pc-reset-btn {
  color: #ccc;
  border-color: #444;
}

html.pc-high-contrast #pcA11yFloat .pc-reset-btn:hover {
  background: #222;
  color: #fff;
}


/* ==========================================================
   6. MOVIMIENTO REDUCIDO Y MOBILE
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
  #pcA11yFloat *,
  #pcA11yFloat .pc-fab::after {
    animation: none !important;
    transition-duration: 0s !important;
  }
}

@media (max-width: 640px) {
  #pcA11yFloat {
    bottom: 16px;
    left: 16px;
  }

  #pcA11yFloat .pc-float-panel {
    width: 260px;
  }
}