/**
 * Popup Box – Split Theme
 * @description Layout for the custom "Split" popup theme: image column left, content column right, stacked on mobile.
 * @author tommyfrog
 * @url www.tommyfrog.de
 * @version 1.1
 * @create 2026-11-23 15:10:00
 * @since 2026-11-23
 *
 * Adjust via the popup's "Custom CSS" field, e.g.:
 *   .ays_split_window { --ays-split-image-width: 50%; --ays-split-accent: #2f6b4f; }
 */

div[class*=ays-pb-modal_].ays_split_window {
    --ays-split-image-width: 45%;
    --ays-split-accent: #3d7a5c;
    --ays-split-mobile-image-height: 180px;

    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    display: none;
    flex-direction: row;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    min-height: 320px;
    overflow: hidden;
    box-sizing: border-box;
    text-align: left;
    cursor: default;
    pointer-events: fill;
    animation-duration: .5s;
    animation-fill-mode: forwards;
}

/* The plugin toggles display:block via JS – the flex layout lives on the inner columns. */
div[class*=ays-pb-modal_].ays_split_window[style*="display: block"],
div[class*=ays-pb-modal_].ays_split_window[style*="display:block"] {
    display: flex !important;
}

/* ---------- Image column ---------- */

.ays_split_window .ays_split_image {
    flex: 0 0 var(--ays-split-image-width);
    width: var(--ays-split-image-width);
    background-color: #ddd;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
}

/* ---------- Content column ---------- */

.ays_split_window .ays_split_content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: thin;
}

.ays_split_window:not(.ays-pb-show-scrollbar) .ays_split_content {
    scrollbar-width: none;
}

.ays_split_window:not(.ays-pb-show-scrollbar) .ays_split_content::-webkit-scrollbar {
    width: 0;
}

.ays_split_window h2.ays_split_title {
    margin: 0 0 .5em;
    padding: 0;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    text-align: left;
    word-break: normal;
}

.ays_split_window .ays_split_description {
    margin: 0 0 1.25em;
    line-height: 1.5;
}

.ays_split_window .ays_split_description p {
    margin: 0 0 .5em;
}

/* The plugin adds its own padding to description (10px) and content box (20px) globally.
   In this theme only the "Content padding" option (on the column) should count. */
.ays-pb-modals .ays_split_window div.ays_pb_description,
.ays-pb-modals .ays_split_window .ays_content_box {
    padding: 0;
}

.ays_split_window .ays_split_main {
    width: 100%;
}

/* Sensible defaults for forms placed in the content (e.g. newsletter shortcode) */
.ays_split_window .ays_split_main input[type=text],
.ays_split_window .ays_split_main input[type=email],
.ays_split_window .ays_split_main input[type=tel] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 .6em;
    padding: .7em .9em;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 4px;
    font: inherit;
}

.ays_split_window .ays_split_main button,
.ays_split_window .ays_split_main input[type=submit] {
    width: 100%;
    padding: .8em 1em;
    border: 0;
    border-radius: 4px;
    background: var(--ays-split-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ays_split_window .ays_split_main button:hover,
.ays_split_window .ays_split_main input[type=submit]:hover {
    filter: brightness(1.1);
}

.ays_split_window p.ays_pb_timer {
    margin: 1em 0 0;
    font-size: 12px;
    opacity: .7;
}

/* ---------- Close button ---------- */

.ays_split_window .close-split-btn-container {
    position: absolute;
    top: 14px;
    right: 20px;
    z-index: 3;
    min-width: auto;
    margin: 0;
}

.ays_split_window .close-split-btn {
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none !important;
}

.ays_split_window .close-split-btn img.close_btn_img {
    display: block;
}

/* ---------- Mobile: image on top, content below ---------- */

@media screen and (max-width: 768px) {
    div[class*=ays-pb-modal_].ays_split_window[style*="display: block"],
    div[class*=ays-pb-modal_].ays_split_window[style*="display:block"] {
        flex-direction: column;
    }

    div[class*=ays-pb-modal_].ays_split_window {
        height: auto !important;
        max-height: 95vh;
    }

    .ays_split_window .ays_split_image {
        flex: 0 0 var(--ays-split-mobile-image-height);
        width: 100%;
        height: var(--ays-split-mobile-image-height);
    }

    .ays_split_window .ays_split_content {
        justify-content: flex-start;
        padding: 24px !important;
    }

    .ays_split_window h2.ays_split_title {
        font-size: 22px;
    }
}
