/* ==========================================================================
   OP Kontaktpopup – Frontend Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Overlay (Hintergrund mit Blur-Effekt)
   -------------------------------------------------------------------------- */
.op-kontaktpopup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    /* Hintergrund-Abdunklung + Blur über backdrop-filter */
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    /* Standardmäßig unsichtbar */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.op-kontaktpopup-overlay.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Popup-Box (fliegt von unten ein)
   -------------------------------------------------------------------------- */
.op-kontaktpopup-popup {
    position: relative;
    background: #ffffff;
    border-radius: 1rem 1rem 0 0;
    padding: 2rem 2rem 2.5rem;
    width: 100%;
    max-width: 100vw;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);

    /* Startzustand: unterhalb des Viewports */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.op-kontaktpopup-overlay.is-active .op-kontaktpopup-popup {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Schließen-Button
   -------------------------------------------------------------------------- */
.op-kontaktpopup-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    color: #555555;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 0;
}

.op-kontaktpopup-close:hover,
.op-kontaktpopup-close:focus-visible {
    background-color: rgba(0, 0, 0, 0.08);
    color: #000000;
    outline: none;
}

/* --------------------------------------------------------------------------
   Popup-Inhalt (Block-Editor-Output)
   -------------------------------------------------------------------------- */
.op-kontaktpopup-content {
    margin-top: 0.5rem;
}

/* Abstände für typische Gutenberg-Blöcke im Popup */
.op-kontaktpopup-content > * {
    margin-top: 0;
    margin-bottom: 1rem;
}

.op-kontaktpopup-content > *:last-child {
    margin-bottom: 0;
}

/* Buttons im Popup-Inhalt (z. B. Anruf, WhatsApp) */
.op-kontaktpopup-content .wp-block-button__link,
.op-kontaktpopup-content a.wp-element-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    justify-content: center;
    padding: 0.85em 1.5em;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Trigger-Button
   -------------------------------------------------------------------------- */
.op-kontaktpopup-trigger {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Scrollsperre am Body, wenn Popup geöffnet
   -------------------------------------------------------------------------- */
body.op-popup-open {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Drag-Handle (optional, zeigt an, dass das Popup scrollbar ist)
   -------------------------------------------------------------------------- */
.op-kontaktpopup-popup::before {
    content: '';
    display: block;
    width: 2.5rem;
    height: 4px;
    background-color: #cccccc;
    border-radius: 2px;
    margin: 0 auto 1.25rem;
}
