/* MODALS */
.backgroundModal{
    position: fixed;
    inset: 0;
    top: var(--viv-visual-offset-top, 0);
    left: 0;
    width: 100vw;
    width: var(--viv-visual-vw, 100vw);
    height: 100vh;
    height: 100dvh;
    height: var(--viv-visual-vh, 100dvh);
    min-height: -webkit-fill-available;
    /* Abgedunkelt statt solid weiss: laesst (bei neuer Bridge) die geblurrte
       Host-Seite durchscheinen und wirkt wie ein professionelles Overlay. */
    background-color: rgba(17, 19, 24, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2147483646;
    opacity: 0;
    animation: backgroundModalIn 220ms ease forwards;
    will-change: opacity, backdrop-filter;
}

.backgroundModal.closing{
    opacity: 0;
    animation: none;
    transition: opacity 220ms ease, backdrop-filter 220ms ease;
    backdrop-filter: blur(0);
}

@keyframes backgroundModalIn{
    to{
        opacity: 1;
    }
}


.contentModal{
    position: fixed;
    inset: 0;
    top: var(--viv-visual-offset-top, 0);
    width: 100%;
    width: var(--viv-visual-vw, 100%);
    height: 100vh;
    height: 100dvh;
    height: var(--viv-visual-vh, 100dvh);
    min-height: -webkit-fill-available;
    max-height: none;
    z-index: 2147483647;
    display: none;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    box-sizing: border-box;
    transition: opacity var(--content-modal-duration, 320ms) ease;
    will-change: opacity;
    contain: layout style paint;
    isolation: isolate;
}

.contentModal.is-open{
    opacity: 1;
    pointer-events: auto;
}

/* Bei offenem Popup: darunterliegende Liste sofort ausblenden, damit der (Vollbild-)
   iframe transparent wird und die geblurrte Host-Seite durchscheint. */
body.vivlico-modal-open .mainContent{
    display: none !important;
}

/* Body transparent halten, damit neue Bridge-Einbindungen den Host zeigen. */
html, body{
    background: transparent;
}

/* Mobil: Karte randlos (Safe-Area beachtet). */
@media (max-width: 767px){
    .contentModal__aligner{
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    }
    .contentModal__surface{
        max-width: none;
        border-radius: 0;
    }

    /* Safari mobil: unterhalb des Visual Viewports (URL-/Suchleiste) bleibt sonst
       ein transparenter Streifen sichtbar, weil html/body transparent sind. */
    body.vivlico-modal-open .backgroundModal:not(.closing){
        height: calc(var(--viv-visual-vh, 100dvh) + var(--viv-visual-bottom-gap, 0px));
    }

    body.vivlico-modal-open .contentModal.is-open,
    body.vivlico-modal-open .contentModal.is-closing{
        height: calc(var(--viv-visual-vh, 100dvh) + var(--viv-visual-bottom-gap, 0px));
    }

    body.vivlico-modal-open .contentModal__aligner{
        padding-bottom: 0;
        min-height: 100%;
    }

    body.vivlico-modal-open .contentModal__surface{
        min-height: 100%;
    }

    body.vivlico-modal-open .contentModal .mobileFooter{
        padding-bottom: calc(max(11px, env(safe-area-inset-bottom, 0px)) + var(--viv-visual-bottom-gap, 0px));
    }
}

.contentModal.is-closing{
    opacity: 0;
    pointer-events: none;
}

.contentModal__aligner{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(9px, env(safe-area-inset-top, 0px)) max(9px, env(safe-area-inset-right, 0px)) max(9px, env(safe-area-inset-bottom, 0px)) max(9px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    pointer-events: none;
}

.contentModal__surface{
    width: 100%;
    max-width: 576px;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    background-color: var(--cardColor);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    box-sizing: border-box;
    -webkit-box-shadow: 4px 5px 16px 0px rgba(110, 112, 113, 0.2);
    -moz-box-shadow: 4px 5px 16px 0px rgba(110, 112, 113, 0.2);
    box-shadow: 4px 5px 16px 0px rgba(110, 112, 113, 0.2);
    opacity: 0.98;
    transform: translate3d(0, 13px, 0) scale(0.985);
    transition: opacity var(--content-modal-duration, 320ms) ease, transform var(--content-modal-duration, 320ms) cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.contentModal.is-open .contentModal__surface{
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.contentModal.is-closing .contentModal__surface{
    opacity: 0.98;
    transform: translate3d(0, 9px, 0) scale(0.99);
}

.contentModal__viewport{
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.contentModal.password{
    display: flex;
    flex-direction: column;
    opacity: 1;
    pointer-events: auto;
    background-color: var(--cardColor);
}

@media (max-width: 1023px) {
    .contentModal .mobileShoppingCart,
    .contentModal .mobileShoppingCart .contactData .inputContainer .flexBox,
    .contentModal .mobileShoppingCart .contactData .tableContainer{
        scrollbar-width: none;
    }
    .contentModal .mobileShoppingCart::-webkit-scrollbar,
    .contentModal .mobileShoppingCart .contactData .inputContainer .flexBox::-webkit-scrollbar,
    .contentModal .mobileShoppingCart .contactData .tableContainer::-webkit-scrollbar{
        display: none;
        width: 0;
        height: 0;
    }
}

@media (min-width: 1024px) {
    .contentModal .mobileShoppingCart{
        scrollbar-width: thin;
        scrollbar-color: var(--writeColorParagraph2) transparent;
    }
    .contentModal .mobileShoppingCart::-webkit-scrollbar{
        display: block;
        width: 6px;
    }
    .contentModal .mobileShoppingCart::-webkit-scrollbar-thumb{
        background: var(--writeColorParagraph2);
        border-radius: 6px;
    }
    .contentModal .mobileShoppingCart::-webkit-scrollbar-thumb:hover{
        background: var(--writeColorParagraph3);
    }
    .contentModal .mobileShoppingCart::-webkit-scrollbar-track{
        background: transparent;
    }
}


