﻿/* Site accent: blue #007bff. The PayPal button is the single main focus of the popup. */
:root {
    --pp-accent: #007bff;
    --pp-accent-dark: #0062cc;
    --pp-accent-soft: #e8f2ff;
    --pp-accent-soft-border: #cfe3ff;
    --pp-blue: #007bff;
    --pp-blue-dark: #0062cc;
    --pp-text: #1f2937;
    --pp-muted: #6b7280;
    --pp-line: #e5e7eb;
}

/* ===== Cart-page button (styled like the PayPal Checkout button) ===== */
.open-paypal-popup.paypal-style-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    padding: 11px 30px !important;
    background: linear-gradient(180deg, #ffd25e 0%, #ffc439 100%) !important;
    color: #2c2e2f !important;
    text-transform: none !important;
    text-decoration: none !important;
    border-radius: 30px;
    box-shadow: 0 6px 16px rgba(230, 169, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .6) !important;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

    .open-paypal-popup.paypal-style-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 9px 20px rgba(230, 169, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .6) !important;
    }

        .open-paypal-popup.paypal-style-btn:hover::after {
            transform: translateX(3px);
        }

    .open-paypal-popup.paypal-style-btn:focus-visible {
        outline: 2px solid var(--pp-blue);
        outline-offset: 3px;
    }


.pplogo-center {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap:5px;
}
/*.open-paypal-popup.paypal-style-btn .pplogo-center::after {
    content: "\203A";
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    margin-top: -3px;
    color: #003087;
    transition: transform .2s ease;
}*/

.open-paypal-popup .pp-logo {
    font-family: Verdana, Tahoma, sans-serif;
    font-style: italic;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -.5px;
    line-height: 1;
}

.open-paypal-popup .pp-pay {
    color: #003087;
}

.open-paypal-popup .pp-pal {
    color: #009cde;
}

.open-paypal-popup .pp-text {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: #2c2e2f;
}

/* ===== Modal shell =====
   Hidden by default (display:none). It is shown only when JS adds the "is-open" class
   (on click of #open-paypal-popup). Fade/slide-in uses keyframes because CSS transitions
   don't run when switching from display:none. */
.paypal-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    /* No opacity animation on this root element: it would stop the overlay's
       backdrop-filter (blur) from seeing the page behind it. Fade the overlay and box instead. */
    .paypal-modal.is-open {
        display: flex;
    }

        .paypal-modal.is-open .paypal-modal__overlay {
            animation: paypal-fade-in .25s ease;
        }

.paypal-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.paypal-modal__box {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-x: hidden;
    overflow-y: auto; /* scrolls on very short screens instead of cutting content off */
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .3);
    outline: none;
}

.paypal-modal.is-open .paypal-modal__box {
    animation: paypal-pop-in .3s ease both;
}

/* ===== Header: light tint so it does not compete with the PayPal button ===== */
.paypal-modal__header {
    position: relative;
    padding: 24px 24px 30px;
    text-align: center;
    background: var(--pp-accent-soft);
    border-bottom: 1px solid var(--pp-accent-soft-border);
}

.paypal-modal__icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pp-accent);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 123, 255, .3);
}

    .paypal-modal__icon svg {
        width: 24px;
        height: 24px;
    }

.paypal-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .2px;
    color: var(--pp-accent-dark);
}

.paypal-modal__subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--pp-muted);
}

/* ===== Body ===== */
.paypal-modal__body {
    padding: 20px 24px 8px;
}

/* Important notice card - grows with its content, never clips text */
.paypal-modal__box .paypal-modal__info {
    display: flow-root; /* contains floated / out-of-flow children so the border wraps everything */
    position: relative;
    float: none;
    box-sizing: border-box;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--pp-line);
    border-left: 4px solid var(--pp-accent);
    border-radius: 8px;
}

.paypal-modal__info-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.paypal-modal__badge {
    flex: 0 0 auto;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    line-height: 1.4;
    text-transform: uppercase;
    color: #b45309;
    background: #fff1e0;
    border: 1px solid #f5d0a0;
    border-radius: 20px;
}

.paypal-modal__info-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--pp-text);
}

.paypal-modal__box .paypal-modal__points {
    display: flex;
    flex-direction: column;
    position: static !important;
    float: none !important;
    gap: 10px;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .paypal-modal__box .paypal-modal__points li {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0;
        padding: 0;
        list-style: none;
    }

        .paypal-modal__box .paypal-modal__points li::before {
            content: none;
        }

/* If the list sits OUTSIDE the card in the HTML (card = header row, list = next sibling),
   draw them as one continuous card instead. Has no effect when the list is inside the card. */
.paypal-modal__box .paypal-modal__info:has(+ .paypal-modal__points) {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.paypal-modal__box .paypal-modal__info + .paypal-modal__points {
    box-sizing: border-box;
    margin: 0 0 20px;
    padding: 0 16px 14px;
    background: #fff;
    border: 1px solid var(--pp-line);
    border-top: 0;
    border-left: 4px solid var(--pp-accent);
    border-radius: 0 0 8px 8px;
}

.paypal-modal__points svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

    .paypal-modal__points svg circle,
    .paypal-modal__points svg path {
        stroke: var(--pp-accent);
    }

/* Unique class so the site's global ".note" styles can't affect it */
.paypal-modal__box .paypal-modal__note {
    position: static;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--pp-text);
}

    .paypal-modal__box .paypal-modal__note strong {
        font-weight: 700;
        color: var(--pp-accent-dark);
        background: none;
    }

/* ===== PayPal button panel =====
   Forced to a column layout: if the site CSS makes this element a row flex/inline box,
   the "Click below" label would be pushed sideways next to the button. */
#paypal-button-container {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 96px;
    margin: 0 !important;
    float: none !important;
    padding: 12px 16px 16px;
    background: #fff8e1;
    border: 2px solid #ffc439;
    border-radius: 14px;
    box-shadow: 0 0 0 4px rgba(255, 196, 57, .25), 0 10px 24px rgba(230, 169, 0, .35);
    animation: paypal-glow 2.2s ease-in-out infinite;
    transition: box-shadow .2s ease;
}

    /* PayPal's rendered button fills the whole panel */
    #paypal-button-container > div,
    #paypal-button-container .paypal-buttons {
        flex: 0 0 auto;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    #paypal-button-container::before {
        content: "Click below to pay securely  \2193";
        display: block;
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.3;
        letter-spacing: .3px;
        text-transform: uppercase;
        color: #8a6100;
    }

    #paypal-button-container:hover {
        box-shadow: 0 0 0 5px rgba(255, 196, 57, .35), 0 14px 28px rgba(230, 169, 0, .45);
    }

    /* Loading shimmer until the PayPal SDK renders its button */
    #paypal-button-container:empty {
        background: linear-gradient(90deg, #fff3cd 25%, #fff9e6 50%, #fff3cd 75%);
        background-size: 200% 100%;
        animation: paypal-shimmer 1.2s infinite linear;
    }

/* ===== Trust badges ===== */
.paypal-modal__trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 14px;
    list-style: none;
    margin: 20px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--pp-line);
}

    .paypal-modal__trust li {
        display: flex;
        align-items: center;
        gap: 5px;
        margin: 0;
        padding: 0;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        color: var(--pp-muted);
        list-style: none;
    }

        .paypal-modal__trust li::before {
            content: none;
        }

    .paypal-modal__trust svg {
        flex: 0 0 auto;
        color: var(--pp-accent);
    }

/* ===== Footer: cancel is a quiet secondary action ===== */
.paypal-modal__footer {
    padding: 4px 24px 20px;
    text-align: center;
}

.paypal-modal__cancel {
    display: inline-block;
    width: auto;
    padding: 8px 18px;
    border: 0;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--pp-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(107, 114, 128, .4);
    border-radius: 8px;
    cursor: pointer;
    transition: color .2s, background .2s;
}

    .paypal-modal__cancel:hover {
        color: var(--pp-blue-dark);
        background: #f3f6fb;
        text-decoration-color: currentColor;
    }

    .paypal-modal__cancel:focus-visible {
        outline: 2px solid var(--pp-blue);
        outline-offset: 2px;
    }

/* ===== Close button ===== */
.paypal-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--pp-accent-dark);
    background: rgba(0, 98, 204, .1);
    cursor: pointer;
    transition: background .2s, transform .25s;
}

    .paypal-modal__close:hover {
        background: rgba(0, 98, 204, .2);
        transform: rotate(90deg);
    }

    .paypal-modal__close:focus-visible {
        outline: 2px solid var(--pp-blue);
        outline-offset: 2px;
    }

/* ===== Animations ===== */
@keyframes paypal-glow {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(255, 196, 57, .25), 0 10px 24px rgba(230, 169, 0, .35);
    }

    50% {
        box-shadow: 0 0 0 9px rgba(255, 196, 57, .12), 0 10px 24px rgba(230, 169, 0, .5);
    }
}

@keyframes paypal-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes paypal-pop-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes paypal-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

/* ===== Responsive ===== */
/* Short screens: tighten spacing so the popup fits without scrolling */
@media (max-height: 760px) {
    .paypal-modal__header {
        padding: 16px 20px 14px;
    }

    .paypal-modal__icon {
        width: 36px;
        height: 36px;
        margin-bottom: 6px;
    }

        .paypal-modal__icon svg {
            width: 20px;
            height: 20px;
        }

    .paypal-modal__title {
        font-size: 18px;
    }

    .paypal-modal__body {
        padding: 14px 20px 4px;
    }

    .paypal-modal__box .paypal-modal__info {
        margin-bottom: 14px;
        padding: 10px 12px;
    }

    .paypal-modal__info-head {
        margin-bottom: 8px;
    }

    .paypal-modal__box .paypal-modal__points {
        gap: 8px;
    }

    .paypal-modal__box .paypal-modal__info + .paypal-modal__points {
        margin-bottom: 14px;
        padding: 0 12px 10px;
    }

    #paypal-button-container {
        padding: 8px 12px 12px;
    }

        #paypal-button-container::before {
            margin-bottom: 6px;
        }

    .paypal-modal__trust {
        margin-top: 14px;
        padding-top: 10px;
    }

    .paypal-modal__footer {
        padding: 0 20px 10px;
    }
}

@media (max-width: 480px) {
    .paypal-modal {
        padding: 12px;
    }

    .paypal-modal__trust {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .paypal-modal.is-open .paypal-modal__overlay,
    .paypal-modal.is-open .paypal-modal__box {
        animation: none;
    }

    .paypal-modal__close,
    #open-paypal-popup.paypal-style-btn, #open-paypal-popup.paypal-style-btn::after,
    #paypal-button-container, .paypal-modal__cancel {
        transition: none;
    }

    #paypal-button-container {
        animation: none;
    }
}
