/* --- MODAL V2 - DEFINITIVE VISUAL FIXES --- */

/* 1. Reset Overlay */
#service-modal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 99999 !important;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;

    /* Flex box centering just in case, but we will also use absolute positioning fallback */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

#service-modal.modal-overlay.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

/* 2. Content Card - Absolute Centering & Geometry */
#service-modal .modal-content {
    /* Absolute positioning to guarantee centering regardless of parent flex quirks */
    position: relative;
    margin: auto;
    /* Flexbox centering helper */

    width: 90%;
    max-width: 500px;
    max-height: 85vh;

    /* Decoration */
    background: #ffffff;

    /* FORCE Rounded Corners on ALL sides */
    border-radius: 24px !important;

    /* Clip content (images) that might bleed out */
    overflow-x: hidden;
    overflow-y: auto;

    /* Shadow */
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);

    /* Reset Transform for clean animation */
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

#service-modal.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* 3. Image Fixes */
#service-modal .modal-image {
    width: 100%;
    display: block;
    border-top-left-radius: 24px;
    /* Match container */
    border-top-right-radius: 24px;
    /* Match container */
    border-bottom: 0;
    margin: 0;
    padding: 0;
}

/* 4. Scrollbar hiding for cleaner UI */
#service-modal .modal-content::-webkit-scrollbar {
    width: 6px;
}

#service-modal .modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

/* 5. Close Button Position */
#service-modal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}