/* ========================================
   Website Modals (Page Builder content)
   ======================================== */

.pb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pb-modal-backdrop.pb-modal-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.pb-modal {
    position: fixed;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.pb-modal.pb-modal--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Size variants */
.pb-modal--small {
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
}

.pb-modal--medium {
    width: 600px;
    max-width: 90vw;
    max-height: 85vh;
}

.pb-modal--large {
    width: 900px;
    max-width: 95vw;
    max-height: 90vh;
}

.pb-modal--fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
}

/* Position variants */
.pb-modal--center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
}

.pb-modal--center.pb-modal--visible {
    transform: translate(-50%, -50%);
}

.pb-modal--top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-40px);
}

.pb-modal--top.pb-modal--visible {
    transform: translateX(-50%) translateY(0);
}

.pb-modal--bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
}

.pb-modal--bottom.pb-modal--visible {
    transform: translateX(-50%) translateY(0);
}

.pb-modal--fullscreen {
    top: 0;
    left: 0;
}

/* Close button */
.pb-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #333;
    transition: background 0.2s;
}

.pb-modal__close:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Content area */
.pb-modal__content {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: inherit;
}

.pb-modal__content img {
    max-width: 100%;
    height: auto;
}

/* Prevent full-width sections from breaking out of the modal */
.pb-modal__content .pb-section--full-width {
    width: 100%;
    margin-left: 0;
}

.pb-modal--fullscreen .pb-modal__content {
    height: 100vh;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .pb-modal--small,
    .pb-modal--medium,
    .pb-modal--large {
        width: 95vw;
    }

    .pb-modal--top {
        top: 10px;
    }

    .pb-modal--bottom {
        bottom: 10px;
    }
}
