/* ═══════════════════════════════════════════════════════════
   Patient Results — Success Story Widget  v3.1
   By SalMedia — https://salmedia.us
═══════════════════════════════════════════════════════════ */

.pr-widget {
    --pr-primary: #2D1B69;
    --pr-accent:  #7B4FD4;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    position: relative;
    background: #ffffff;
}
.pr-widget *, .pr-widget *::before, .pr-widget *::after { box-sizing: border-box; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT — Desktop: 2-column side by side
═══════════════════════════════════════════════════════════ */
.pr-layout {
    display: grid;
    grid-template-columns: 50% 1fr;
    align-items: stretch;
}

/* ══ LEFT PANEL ═══════════════════════════════════════════ */
.pr-left {
    background: #ffffff;
    padding: 60px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    position: relative;
    z-index: 2;
}
.pr-headline {
    font-size: clamp(28px, 3vw, 46px);
    font-weight: 900;
    line-height: 1.15;
    color: var(--pr-primary);
    margin: 0;
    letter-spacing: -0.5px;
}
.pr-sub-headline {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.75;
    color: #374151;
    margin: 0;
}

/* ── Testimonials crossfade ─────────────────────────────── */
.pr-testimonials-wrap { position: relative; min-height: 140px; }
.pr-testimonial-slide {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
    pointer-events: none;
    position: absolute;
    top: 0; left: 0;
}
.pr-testimonial-slide.pr-active {
    opacity: 1; visibility: visible;
    transition: opacity 0.7s ease, visibility 0s linear 0s;
    pointer-events: auto;
    position: relative;
}
.pr-testimonial-slide.pr-exit {
    opacity: 0; visibility: hidden;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
    pointer-events: none;
    position: absolute; top: 0; left: 0;
}
.pr-quote-block { display: flex; flex-direction: column; gap: 4px; }
.pr-quote-mark {
    font-size: 56px; line-height: 1;
    color: var(--pr-primary);
    font-family: Georgia, serif;
    display: block; margin-bottom: -8px;
}
.pr-quote { font-size: 17px; font-weight: 700; line-height: 1.65; color: #111827; margin: 0; }
.pr-attribution { font-size: 14px; font-weight: 500; color: #6B7280; margin: 0; }

/* ── Button ─────────────────────────────────────────────── */
.pr-btn-wrap { display: flex; justify-content: flex-start; }
.pr-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--pr-primary); color: #fff; text-decoration: none;
    padding: 14px 28px; border-radius: 50px;
    font-size: 15px; font-weight: 700;
    transition: all 280ms ease; border: none; cursor: pointer; white-space: nowrap;
}
.pr-btn:hover { background: #4c2fa0; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(45,27,105,0.28); color: #fff; text-decoration: none; }
.pr-btn-icon { font-size: 16px; transition: transform 250ms ease; }
.pr-btn:hover .pr-btn-icon { transform: translateX(3px); }

/* ── Nav dots ───────────────────────────────────────────── */
.pr-dots { display: flex; align-items: center; gap: 8px; }
.pr-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(45,27,105,0.2); border: none; padding: 0;
    cursor: pointer; transition: background 0.3s, width 0.35s, border-radius 0.35s;
    outline: none; flex-shrink: 0;
}
.pr-dot:hover { background: rgba(45,27,105,0.5); }
.pr-dot.pr-active { background: var(--pr-primary); width: 24px; border-radius: 4px; }

/* ══ RIGHT PANEL ══════════════════════════════════════════ */
.pr-right {
    background: #F8F7FA;
    padding: 24px 24px 24px 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

/* ── Slides wrap — fixed height set by style control ─────
   overflow: visible so card wrappers can bleed outside     */
.pr-slides-wrap {
    position: relative;
    width: 100%;
    height: 560px;
    border-radius: 24px;
    overflow: visible;
    flex: 1;
}

/* ── Patient slides — stacked absolutely ─────────────────
   overflow: visible — card wrappers are children, must not clip */
.pr-patient-slide {
    position: absolute; inset: 0;
    opacity: 0; visibility: hidden;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
    pointer-events: none;
    border-radius: 24px;
    overflow: visible;
}
.pr-patient-slide.pr-active {
    opacity: 1; visibility: visible;
    transition: opacity 0.7s ease, visibility 0s linear 0s;
    pointer-events: auto;
}
.pr-patient-slide.pr-exit {
    opacity: 0; visibility: hidden;
    transition: opacity 0.7s ease, visibility 0s linear 0.7s;
    pointer-events: none;
}

/* ── Image clip — clips background to slide boundary ─────
   Also serves as the background-image container.
   CSS background-image is injected via a <style> block
   targeting each slide's unique ID — reliable in all
   Elementor environments, no inline attribute issues.
   Card wrappers (.pr-attr-card-wrap, .pr-product-card-wrap)
   are siblings — never clipped by this overflow:hidden.    */
.pr-img-clip {
    position: absolute; inset: 0;
    border-radius: 24px;
    overflow: hidden;
    z-index: 0;
    /* background-image, size, position, repeat, attachment
       all injected via targeted <style> block per slide    */
    background-color: #e8dff5;  /* shown while image loads  */
    background-size: cover;     /* safe default              */
    background-position: center center;
    background-repeat: no-repeat;
}

/* Placeholder when no image is uploaded */
.pr-img-placeholder {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #e8dff5, #f5ede0);
    border-radius: 24px;
}

/* ══ GLASS CARDS ═════════════════════════════════════════
   Single flex-column wrapper, vertically centered on image.
   Both cards sit together with a fixed gap — no spreading.
   Sibling of .pr-img-clip so it is NEVER clipped.
   Style controls (Card Width, Horizontal Offset, Gap,
   Blur) all target this class and work correctly.          */
.pr-glass-cards {
    position: absolute;
    top: 50%;
    left: 12px;                  /* overridden by Horizontal Offset control */
    transform: translateY(-50%); /* centers the group vertically on image   */
    width: 220px;                /* overridden by Card Width control         */
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 10px;                   /* overridden by Gap Between Cards control  */
}


/* ── Glass card base styles ─────────────────────────────── */
.pr-glass-card {
    background: rgba(255,255,255,0.70);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(45,27,105,0.10), 0 1px 0 rgba(255,255,255,0.8) inset;
}
.pr-attr-row {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 8px; padding: 9px 12px;
    position: relative; transition: background 0.2s;
}
.pr-attr-row:hover { background: rgba(255,255,255,0.35); }
.pr-attr-row:not(:last-child)::after {
    content: ''; position: absolute;
    bottom: 0; left: 12px; right: 12px; height: 1px;
    background: linear-gradient(to right, transparent, rgba(180,150,100,0.3) 30%, rgba(180,150,100,0.3) 70%, transparent);
}
.pr-attr-label { font-size: 11.5px; font-weight: 500; color: #374151; white-space: nowrap; flex-shrink: 0; }
.pr-attr-value  { font-size: 12px; font-weight: 700; color: #4c2fa0; text-align: right; line-height: 1.4; }

.pr-product-header {
    background: rgba(255,255,255,0.5);
    justify-content: flex-start !important;
    gap: 10px; padding: 10px 12px !important;
}
.pr-product-header::after { left: 12px !important; right: 12px !important; }
.pr-product-img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; border-radius: 6px; background: rgba(255,255,255,0.7); padding: 2px; }
.pr-product-meta { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex: 1; gap: 6px; }
.pr-product-name { font-size: 11px; font-weight: 600; color: #374151; line-height: 1.35; flex: 1; }
.pr-product-dosage { font-size: 11px; font-weight: 700; color: #4c2fa0; white-space: nowrap; flex-shrink: 0; }

/* Arrow nav */
.pr-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 30; background: rgba(255,255,255,0.85); border: none;
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 20px; font-weight: 700; color: var(--pr-primary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.25s; backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.12); line-height: 1;
}
.pr-arrow:hover { background: var(--pr-primary); color: #fff; transform: translateY(-50%) scale(1.08); }
.pr-arrow-prev { left: 12px; }
.pr-arrow-next { right: 12px; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

/* ── Laptop 1024–1280px ─────────────────────────────────── */
@media (max-width: 1280px) {
    .pr-left { padding: 48px 40px; gap: 20px; }
    .pr-headline { font-size: clamp(26px, 3.2vw, 40px); }
    .pr-glass-cards { width: 200px; }
}

/* ── Tablet landscape 768–1024px ────────────────────────── */
@media (max-width: 1024px) {
    .pr-layout { grid-template-columns: 52% 1fr; }
    .pr-left { padding: 40px 32px; gap: 18px; }
    .pr-headline { font-size: clamp(24px, 3.5vw, 34px); }
    .pr-quote { font-size: 15px; }
    .pr-glass-cards { width: 185px; left: 8px; }
    .pr-attr-label, .pr-attr-value { font-size: 10.5px; }
    .pr-product-name, .pr-product-dosage { font-size: 10px; }
    .pr-product-img { width: 30px; height: 30px; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE PORTRAIT  max-width: 767px
   ─────────────────────────────────────────────────────────
   Layout (top → bottom):
     1. Title + Description       ← .pr-left (order 1)
     2. Image with cards overlay  ← .pr-right (order 2)
          attr card: top-left corner of image
          product card: bottom-right corner of image
     3. Quote + Attribution + CTA ← moved into .pr-left
        (headline & sub-headline already there)

   The image fills full width. Cards overlap the image edges
   exactly as shown in the reference screenshots.
══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* Stack: single column, full width */
    .pr-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: hidden;   /* prevent ANY horizontal scroll */
    }

    /* ── Left panel: text above image ──────────────────── */
    .pr-left {
        order: 1;
        padding: 32px 20px 20px;
        gap: 16px;
        width: 100%;
    }
    .pr-headline { font-size: clamp(22px, 6vw, 32px); }
    .pr-sub-headline { font-size: 14px; line-height: 1.65; }
    .pr-quote { font-size: 15px; line-height: 1.6; }
    .pr-quote-mark { font-size: 42px; }
    .pr-attribution { font-size: 13px; }
    .pr-testimonials-wrap { min-height: 110px; }
    .pr-btn { padding: 12px 24px; font-size: 14px; }

    /* ── Right panel: image below text ─────────────────── */
    .pr-right {
        order: 2;
        padding: 0 16px 24px;
        width: 100%;
    }

    /* Image fills full available width.
       Height = 90vw gives a near-square frame good for
       portrait photos. Adjust via style control if needed. */
    .pr-slides-wrap {
        width: 100%;
        height: 90vw;
        min-height: 280px;
        max-height: 500px;
        border-radius: 20px;
        flex: none;
        /* overflow stays visible for cards */
    }

    /* ── Attr card: top-left corner ──────────────────────
       Matches reference image 1: card overlaps top-left
       of the image, slightly outside the image edge.       */
    /* Mobile portrait: glass cards centered, full width of image minus margins */
    .pr-glass-cards {
        top: 50%;
        left: 12px;
        right: 12px;
        width: auto;
        transform: translateY(-50%);
        gap: 8px;
    }

    /* Scale down row text to fit narrower cards */
    .pr-attr-row { padding: 7px 10px; }
    .pr-attr-label { font-size: 10px; }
    .pr-attr-value  { font-size: 10.5px; }
    .pr-product-name { font-size: 9.5px; }
    .pr-product-dosage { font-size: 9.5px; }
    .pr-product-img { width: 28px; height: 28px; }

    /* Dots below image */
    .pr-dots { justify-content: center; margin-top: 12px; }
    .pr-dot { width: 6px; height: 6px; }
    .pr-dot.pr-active { width: 18px; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE LANDSCAPE  max-height: 500px AND max-width: 900px
   ─────────────────────────────────────────────────────────
   Two columns but tighter. Cards still pin to corners.
   Image height constrained to viewport height.
══════════════════════════════════════════════════════════ */
@media (max-height: 500px) and (max-width: 900px) {

    .pr-layout {
        display: grid;
        grid-template-columns: 44% 1fr;
        overflow: hidden;
    }
    .pr-left {
        padding: 20px 24px;
        gap: 12px;
        order: 1;
        overflow-y: auto;
    }
    .pr-right {
        order: 2;
        padding: 10px 10px 10px 0;
    }
    .pr-headline { font-size: clamp(16px, 3vw, 22px); }
    .pr-sub-headline { font-size: 12px; line-height: 1.5; }
    .pr-quote { font-size: 12px; line-height: 1.5; }
    .pr-quote-mark { font-size: 30px; }
    .pr-attribution { font-size: 11px; }
    .pr-btn { padding: 9px 18px; font-size: 12px; }
    .pr-testimonials-wrap { min-height: 80px; }

    /* Image fills landscape viewport height */
    .pr-slides-wrap {
        height: calc(100vh - 20px);
        max-height: 460px;
        min-height: 200px;
        border-radius: 16px;
        flex: none;
    }

    /* Landscape: glass cards centered */
    .pr-glass-cards {
        top: 50%;
        left: 8px;
        right: 8px;
        width: auto;
        transform: translateY(-50%);
        gap: 6px;
    }
    .pr-attr-row { padding: 5px 8px; }
    .pr-attr-label { font-size: 9px; }
    .pr-attr-value  { font-size: 9.5px; }
    .pr-product-name { font-size: 8.5px; }
    .pr-product-dosage { font-size: 8.5px; }
    .pr-product-img { width: 24px; height: 24px; }
}

/* ── Very small phones < 380px ─────────────────────────── */
@media (max-width: 380px) {
    .pr-left { padding: 24px 14px 16px; }
    .pr-right { padding: 0 10px 20px; }
    .pr-slides-wrap { height: 94vw; min-height: 240px; }
    .pr-headline { font-size: 20px; }
    .pr-glass-cards { left: 10px; right: 10px; width: auto; }
    .pr-attr-label, .pr-attr-value { font-size: 9.5px; }
}

/* ═══════════════════════════════════════════════════════════
   ELEMENTOR EDITOR
═══════════════════════════════════════════════════════════ */
.elementor-editor-active .pr-testimonial-slide:not(.pr-active),
.elementor-editor-active .pr-patient-slide:not(.pr-active) { display: none !important; }
.elementor-editor-active .pr-testimonial-slide.pr-active {
    opacity: 1; visibility: visible; position: relative; pointer-events: auto;
}
.elementor-editor-active .pr-patient-slide.pr-active {
    opacity: 1; visibility: visible; pointer-events: auto;
}

/* ── Admin Meta Box ─────────────────────────────────────── */
.pr-meta-wrap { padding: 8px 0; }
.pr-meta-section-title {
    font-size: 13px; font-weight: 700; color: #330066;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 10px 0 6px;
    border-bottom: 2px solid #EAE6F2; margin-bottom: 12px;
}
