/* ===========================================================================
   Custom popup  -  https://ocmod.net
   ---------------------------------------------------------------------------
   Bootstrap 3 markup. Every rule carries the [data-custom-popup] attribute
   together with .modal, so the popup keeps its own look on a theme that ships
   Bootstrap 4 or 5, on a theme with a rewritten .modal, and on a theme with no
   modal styles at all - and nothing else on the page is touched.
   =========================================================================== */

[data-custom-popup].modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10500;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 0;
    transition: opacity .25s ease;
    -webkit-overflow-scrolling: touch;
}

[data-custom-popup].modal.in {
    display: block;
    opacity: 1;
}

[data-custom-popup][data-dim="1"] {
    background: rgba(0, 0, 0, .5);
}

/* without dimming the rest of the page has to stay clickable */
[data-custom-popup][data-dim="0"] {
    pointer-events: none;
}

[data-custom-popup][data-dim="0"] .modal-dialog {
    pointer-events: auto;
}

[data-custom-popup].modal .modal-dialog {
    position: relative;
    width: auto;
    margin: 0;
    transform: none;
}

[data-custom-popup].modal .modal-content {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

[data-custom-popup].modal .modal-body {
    padding: 24px;
}

[data-custom-popup].modal .close {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
    padding: 0;
    border: 0;
    background: none;
    color: #999;
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
    opacity: .7;
    cursor: pointer;
    text-shadow: none;
}

[data-custom-popup].modal .close:hover {
    opacity: 1;
}

/* the content is the shop owner's html - keep it from breaking the box */
[data-custom-popup].modal .modal-body img {
    max-width: 100%;
    height: auto;
}

/* ---------- centred window ------------------------------------------------ */
[data-custom-popup][data-layout="modal"] {
    padding: 15px;
}

[data-custom-popup][data-layout="modal"] .modal-dialog {
    max-width: 600px;
    margin: 8vh auto;
}

/* ---------- corner card --------------------------------------------------- */
[data-custom-popup][data-layout="corner"] {
    overflow: visible;
    background: none;
}

[data-custom-popup][data-layout="corner"] .modal-dialog {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 340px;
    max-width: calc(100% - 30px);
}

[data-custom-popup][data-layout="corner"] .modal-content {
    border-color: #d9dde3;
}

[data-custom-popup][data-layout="corner"] .modal-body {
    padding: 20px;
}

/* ---------- bottom bar ---------------------------------------------------- */
[data-custom-popup][data-layout="bar"] {
    overflow: visible;
    background: none;
}

[data-custom-popup][data-layout="bar"] .modal-dialog {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
}

[data-custom-popup][data-layout="bar"] .modal-content {
    border-width: 1px 0 0;
    border-radius: 0;
}

[data-custom-popup][data-layout="bar"] .modal-body {
    max-width: 1140px;
    margin: 0 auto;
    padding: 18px 40px 18px 20px;
}

@media (max-width: 480px) {
    [data-custom-popup][data-layout="modal"] .modal-dialog {
        max-width: none;
        margin: 4vh 0;
    }

    [data-custom-popup][data-layout="corner"] .modal-dialog {
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
    }

    [data-custom-popup].modal .modal-body {
        padding: 18px;
    }
}
