/**
 * Info Sidebar - Dedykowane style
 * 
 * Slide-over panel z prawej strony ekranu dla wyÅ›wietlania informacji.
 * UÅ¼ywany w:
 * - Theme (WooCommerce product pages)
 * - Plugin/Vue (konfigurator - dynamiczne info)
 * 
 * HTML struktura:
 * <div id="fap-info-root">
 *   <div id="fap-info-backdrop"></div>
 *   <aside id="fap-info-panel">
 *     <header>
 *       <h2 id="fap-info-title"></h2>
 *       <button id="fap-info-close">âœ•</button>
 *     </header>
 *     <div id="fap-info-scroll">
 *       <div id="fap-info-body"></div>
 *     </div>
 *   </aside>
 * </div>
 * 
 * JavaScript: theme/assets/js/info-sidebar.js
 */

/* ============================================
   UTILITY CLASSES (uÅ¼ywane przez JS)
   ============================================ */
   .pointer-events-none {
    pointer-events: none;
  }
  
  .pointer-events-auto {
    pointer-events: auto;
  }
  
  .opacity-0 {
    opacity: 0;
  }
  
  .opacity-100 {
    opacity: 1;
  }
  
  .translate-x-full {
    transform: translateX(100%);
  }
  
  /* ============================================
     ROOT CONTAINER
     ============================================ */
  #fap-info-root {
    pointer-events: none;
  }
  
  /* ============================================
     BACKDROP (tÅ‚o)
     ============================================ */
  #fap-info-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9998;
    background-color: rgba(0, 0, 0, 0.4);
    transition-property: opacity;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
    /* opacity i pointer-events kontrolowane przez JS (klasy .opacity-0/.opacity-100, .pointer-events-none) */
  }
  
  /* Backdrop widoczny - zaciemnienie aktywne, moÅ¼na kliknÄ…Ä‡ */
  #fap-info-backdrop:not(.pointer-events-none) {
    pointer-events: auto;
  }
  
  /* Backdrop opacity - wyÅ¼sza specificity niÅ¼ utility class */
  #fap-info-backdrop.opacity-0 {
    opacity: 0;
  }
  
  #fap-info-backdrop.opacity-100 {
    opacity: 1;
  }
  
  /* ============================================
     PANEL (slide-over z prawej)
     ============================================ */
  #fap-info-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    width: 100%;
    max-width: 28rem; /* 448px */
    background-color: #ffffff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition-property: transform;
    transition-duration: 300ms;
    transition-timing-function: ease-in-out;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  /* ============================================
     HEADER (tytuÅ‚ + przycisk zamknij)
     ============================================ */
  #fap-info-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
  }
  
  #fap-info-title {
    font-size: 1.45rem;
    line-height: 1.5;
    font-weight: 600;
    margin: 0;
  }
  
  #fap-info-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
  }
  
  #fap-info-close:hover {
    background-color: #f3f4f6;
  }
  
  #fap-info-close:focus {
    outline: 2px solid #1f2937;
    outline-offset: 2px;
  }
  
  /* ============================================
     BODY (treÅ›Ä‡)
     ============================================ */
  #fap-info-scroll {
    padding: 1rem;
    overflow-y: auto;
    flex-grow: 1;
  }
  
  #fap-info-body {
    /* Prose styles dla czytelnej typografii */
    max-width: none;
    line-height: 1.45;
    color: #374151;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
  }
  
  #fap-info-body p {
    /* margin-top: 1.25em; */
    /* margin-bottom: 1.25em; */
  }
  
  #fap-info-body p:first-child {
    margin-top: 0;
  }
  
  #fap-info-body p:last-child {
    margin-bottom: 0;
  }
  
  #fap-info-body h2,
  #fap-info-body h3,
  #fap-info-body h4 {
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 600;
    line-height: 1.25;
    color: #111827;
  }
  
  #fap-info-body h2 {
    font-size: 1.5em;
  }
  
  #fap-info-body h3 {
    font-size: 1.25em;
  }
  
  #fap-info-body h4 {
    font-size: 1.125em;
  }
  
  #fap-info-body ul,
  #fap-info-body ol {
    /* margin-top: 1.25em; */
    /* margin-bottom: 1.25em; */
    padding-left: 1.25em;
    list-style: disc;
  }
  
  #fap-info-body li {
    /* margin-top: 0.5em; */
    margin-bottom: 0.35em;
    font-size: 14px;
    /* line-height: 1.65em; */
  }
  
  #fap-info-body strong {
    font-weight: 600;
    color: #111827;
  }
  
  #fap-info-body a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500;
  }
  
  #fap-info-body a:hover {
    color: #1d4ed8;
  }
  
  #fap-info-body code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }
  
  /* ============================================
     INFO BUTTON (przycisk "i" do otwierania)
     ============================================ */
  .fap-info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    border: 1px solid #d1d5db;
    color: #374151;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
  }
  
  .fap-info-button:hover {
    background-color: #f9fafb;
  }
  
  .fap-info-button:focus {
    outline: 2px solid #1f2937;
    outline-offset: 2px;
  }
  
  .fap-info-button:focus-visible {
    outline: 2px solid #1f2937;
    outline-offset: 2px;
  }
  
  .fap-info-button span {
    font-size: 0.75rem;
    font-weight: 700;
  }
  
  #fap-info-body :is(h1, h2, h3, h4, h5, h6) {
      margin: 0;
  }
  
  #fap-info-body p {
      margin: 0;
      font-size: 14px;
  }
  
  #fap-info-body h6 {
      font-size: 1rem;
  }
  
  #fap-info-body img {
      max-width: 250px;
  }