/* ==========================================================
   WC Product Text Blocks – Frontend  v1.5
   ========================================================== */

/* ── Block wrapper ────────────────────────────────────── */
.wc-ptb-block {
    /* inline-flex = shrinks to content width, does NOT stretch full column */
    display: inline-flex !important;
    align-items: baseline;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    max-width: 100%;            /* never overflow its container */
    box-sizing: border-box;
    animation: wcPtbIn .25s ease both;
}
@keyframes wcPtbIn {
    from { opacity:0; transform:translateY(3px); }
    to   { opacity:1; transform:translateY(0);   }
}

/* Lead emoji */
.wc-ptb-lead-emoji {
    flex-shrink: 0;
    font-size: 17px;
    line-height: 1;
    align-self: center;
}

/* Content span – inline, wraps naturally */
.wc-ptb-content {
    min-width: 0;
    display: inline;
}
/* Newlines from <br> inside the content span */
.wc-ptb-content br {
    display: block;
    content: '';
    margin-bottom: 2px;
}

/* ── Info button ──────────────────────────────────────── */
.wc-ptb-info-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 0 0 3px !important;
    line-height: 1 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    text-decoration: none !important;
    text-shadow: none !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity .15s, transform .15s;
    float: none !important;
    position: static !important;
}
.wc-ptb-info-btn:hover,
.wc-ptb-info-btn:focus {
    opacity: 1 !important;
    transform: scale(1.18) !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}
.wc-ptb-info-btn:active { transform: scale(.95) !important; }

.wc-ptb-info-icon {
    display: inline-block;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
}

/* ── Modal overlay ────────────────────────────────────── */
.wc-ptb-modal-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    background: rgba(0,0,0,0) !important;
    transition: background .25s ease !important;
}
.wc-ptb-modal-overlay[hidden] { display: none !important; }
.wc-ptb-modal-overlay.is-open {
    background: rgba(15,23,42,.58) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

body.wc-ptb-no-scroll { overflow: hidden !important; }

/* ── Modal card ───────────────────────────────────────── */
.wc-ptb-modal {
    position: relative;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2), 0 4px 14px rgba(0,0,0,.08);
    width: 100%;
    max-width: 500px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    transform: translateY(22px) scale(.96);
    opacity: 0;
    transition: transform .28s cubic-bezier(.34,1.15,.64,1), opacity .22s ease;
    overflow: hidden;
}
.wc-ptb-modal-overlay.is-open .wc-ptb-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Modal header ─────────────────────────────────────── */
.wc-ptb-modal__header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #e8edf2;
    flex-shrink: 0;
    background: linear-gradient(135deg,#f8fafc,#f0f4f8);
}
.wc-ptb-modal__icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    font-size: 22px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    line-height: 1;
}
.wc-ptb-modal__title {
    flex: 1;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    color: #1a2332 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.35 !important;
    border: none !important;
    background: transparent !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}
.wc-ptb-modal__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #7a8799;
    cursor: pointer;
    padding: 0;
    transition: background .14s, color .14s;
}
.wc-ptb-modal__close:hover { background: #fee2e2; color: #e53e3e; }
.wc-ptb-modal__close:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

/* ── Modal body ───────────────────────────────────────── */
.wc-ptb-modal__body {
    padding: 18px 20px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.wc-ptb-modal__content {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}
/*
 * JS injects each line as <p style="margin:0 0 8px 0;display:block;">
 * These rules are a safety net in case theme CSS overrides inline styles.
 */
.wc-ptb-modal__content p {
    display: block !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
}
.wc-ptb-modal__content p:last-child { margin-bottom: 0 !important; }
.wc-ptb-modal__content br {
    display: block !important;
    content: "" !important;
    margin-bottom: 6px !important;
}
.wc-ptb-modal__content ul,
.wc-ptb-modal__content ol  { padding-left: 20px; margin: 6px 0 10px; }
.wc-ptb-modal__content li  { margin-bottom: 4px; }
.wc-ptb-modal__content strong,
.wc-ptb-modal__content b   { color: #1a2332; }
.wc-ptb-modal__content a   { color: #6366f1; text-decoration: underline; }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .wc-ptb-block         { padding: 7px 10px; font-size: 13px; }
    .wc-ptb-lead-emoji    { font-size: 15px; }
    .wc-ptb-info-icon     { font-size: 13px; }
    .wc-ptb-modal         { border-radius: 11px; max-height: 88vh; }
    .wc-ptb-modal__header { padding: 13px 15px 11px; }
    .wc-ptb-modal__icon   { width: 34px; height: 34px; font-size: 18px; }
    .wc-ptb-modal__body   { padding: 14px 15px 16px; }
}
