/* ===== Lead magnet popup (nuosavas, sesijos laikmatis) ===== */

:root {
    --lsp-accent: #7cb342;
    --lsp-accent-dark: #689a36;
    --lsp-ink: #1c2321;
    --lsp-muted: #5c6b66;
}

#lsp-popup {
    display: none;
}

#lsp-popup.is-open {
    display: block;
}

/* --- Fonas --- */

.lsp-popup__overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 20, .6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 999998;
    animation: lsp-fade .35s ease both;
}

/* --- Kortelė --- */

.lsp-popup__box {
    position: fixed;
    top: 50%;
    left: 50%;
    width: calc(100% - 32px);
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .04);
    z-index: 999999;
    transform: translate(-50%, -50%);
    animation: lsp-rise .45s cubic-bezier(.2, .9, .3, 1) both;
}

#lsp-popup.lsp-popup--media .lsp-popup__box {
    max-width: 860px;
}

/* --- Uždarymas --- */

.lsp-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    color: #fff;
    background: rgba(20, 28, 24, .45);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    transition: background .2s ease, transform .2s ease;
}

.lsp-popup__close:hover {
    background: rgba(20, 28, 24, .75);
    transform: rotate(90deg);
}

.lsp-popup__close:focus-visible {
    outline: 2px solid var(--lsp-accent);
    outline-offset: 2px;
}

/* --- Turinio tinklelis --- */

.lsp-popup__content {
    display: grid;
    grid-template-columns: 1fr;
}

#lsp-popup.lsp-popup--media .lsp-popup__content {
    grid-template-columns: 42% 1fr;
    align-items: stretch;
}

.lsp-popup__image {
    position: relative;
    overflow: hidden;
    background: #f2f5f1;
}

.lsp-popup__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lsp-popup__body {
    padding: 48px 44px;
}

/* --- Tipografija --- */

.lsp-popup__title {
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--lsp-ink);
}

.lsp-popup__text {
    margin: 0 0 28px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--lsp-muted);
}

.lsp-popup__text p {
    margin: 0 0 12px;
}

.lsp-popup__text p:last-child {
    margin-bottom: 0;
}

/* --- Mygtukas --- */

.lsp-popup__btn {
    display: inline-block;
    padding: 16px 34px;
    border-radius: 8px;
    background: var(--lsp-accent);
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none !important;
    text-transform: uppercase;
    box-shadow: 0 10px 24px -10px rgba(124, 179, 66, .9);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.lsp-popup__btn:hover {
    background: var(--lsp-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -12px rgba(124, 179, 66, .95);
}

/* --- Divi layout'as viduje --- */

.lsp-popup__content > .et_pb_section,
.lsp-popup__content .et_pb_row {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* --- Animacijos --- */

@keyframes lsp-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lsp-rise {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 24px)) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .lsp-popup__overlay,
    .lsp-popup__box {
        animation: none;
    }
}

/* --- Mobilus --- */

@media (max-width: 820px) {
    #lsp-popup.lsp-popup--media .lsp-popup__content {
        grid-template-columns: 1fr;
    }

    #lsp-popup.lsp-popup--media .lsp-popup__image {
        max-height: 34vh;
    }

    .lsp-popup__body {
        padding: 32px 24px 36px;
    }

    .lsp-popup__title {
        font-size: 23px;
    }

    .lsp-popup__text {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .lsp-popup__btn {
        display: block;
        text-align: center;
        padding: 15px 20px;
    }
}
