/* =========================================================
   CRYSTAL CLEANING - SERVICE MODAL RESPONSIVE FIX V50
   Keeps long service content below the nav and inside viewport.
   Loaded LAST intentionally.
   ========================================================= */

.service-modal[hidden]{
    display:none!important;
}

.service-modal{
    position:fixed!important;
    inset:0!important;
    z-index:8500!important;
    display:grid!important;
    place-items:center!important;
    width:100%!important;
    height:100%!important;
    padding:112px 24px 24px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
}

.service-modal__backdrop{
    position:absolute!important;
    inset:0!important;
    background:rgba(8,14,11,.68)!important;
    -webkit-backdrop-filter:blur(8px)!important;
    backdrop-filter:blur(8px)!important;
}

.service-modal__dialog{
    position:relative!important;
    z-index:2!important;

    width:min(1040px,96vw)!important;
    max-width:1040px!important;

    height:auto!important;
    min-height:0!important;
    max-height:calc(100vh - 136px)!important;
    max-height:calc(100dvh - 136px)!important;

    display:grid!important;
    grid-template-columns:minmax(0,45%) minmax(0,55%)!important;
    grid-template-rows:minmax(0,1fr)!important;

    overflow:hidden!important;
    border-radius:24px!important;
    background:#fff!important;
    box-shadow:0 35px 100px rgba(0,0,0,.32)!important;
    box-sizing:border-box!important;
}

.service-modal__media,
.service-modal__content{
    min-width:0!important;
    min-height:0!important;
    box-sizing:border-box!important;
}

.service-modal__media{
    position:relative!important;
    height:100%!important;
    overflow:hidden!important;
    background:#eef2eb!important;
}

.service-modal__media img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:100%!important;
    object-fit:cover!important;
    object-position:center!important;
}

.service-modal__content{
    height:auto!important;
    max-height:calc(100vh - 136px)!important;
    max-height:calc(100dvh - 136px)!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding:34px 36px 38px!important;
    scrollbar-width:thin;
    scrollbar-color:#8ebc46 #eef2eb;
}

.service-modal__content::-webkit-scrollbar{
    width:8px;
}

.service-modal__content::-webkit-scrollbar-track{
    background:#eef2eb;
}

.service-modal__content::-webkit-scrollbar-thumb{
    border:2px solid #eef2eb;
    border-radius:999px;
    background:#8ebc46;
}

.service-modal__close{
    position:absolute!important;
    z-index:20!important;
    top:14px!important;
    right:14px!important;
    width:40px!important;
    height:40px!important;
    display:grid!important;
    place-items:center!important;
    border:1px solid rgba(0,0,0,.08)!important;
    border-radius:50%!important;
    color:#223029!important;
    background:rgba(255,255,255,.92)!important;
    box-shadow:0 7px 18px rgba(0,0,0,.10)!important;
    cursor:pointer!important;
    font-size:22px!important;
    line-height:1!important;
}

.service-modal__content h3{
    padding-right:36px!important;
}

/* Prevent long descriptions/items from forcing the dialog wider. */
.service-modal__content,
.service-modal__content p,
.service-modal__content div,
.service-modal__content li,
.service-modal__content span,
.service-modal__content strong{
    overflow-wrap:anywhere;
}

/* Keep action area reachable after long content. */
.service-modal__content .service-button,
.service-modal__content .site-button,
.service-modal__content a[class*="button"]{
    flex-shrink:0;
}

/* Medium laptop heights: reduce top/bottom chrome but still stay under nav. */
@media (min-width:821px) and (max-height:820px){
    .service-modal{
        padding-top:100px!important;
        padding-bottom:16px!important;
    }

    .service-modal__dialog,
    .service-modal__content{
        max-height:calc(100vh - 116px)!important;
        max-height:calc(100dvh - 116px)!important;
    }

    .service-modal__content{
        padding:26px 30px 32px!important;
    }
}

/* Tablet */
@media (max-width:820px){
    .service-modal{
        padding:96px 14px 14px!important;
        align-items:start!important;
    }

    .service-modal__dialog{
        width:100%!important;
        max-width:100%!important;
        max-height:calc(100vh - 110px)!important;
        max-height:calc(100dvh - 110px)!important;
        grid-template-columns:1fr!important;
        grid-template-rows:auto minmax(0,1fr)!important;
        border-radius:20px!important;
    }

    .service-modal__media{
        width:100%!important;
        height:230px!important;
        min-height:230px!important;
    }

    .service-modal__media img{
        min-height:0!important;
        height:100%!important;
    }

    .service-modal__content{
        max-height:none!important;
        overflow-y:auto!important;
        padding:27px 20px 30px!important;
    }

    .service-modal__close{
        top:10px!important;
        right:10px!important;
        width:38px!important;
        height:38px!important;
    }
}

/* Phone: modal itself scrolls naturally if content is very large. */
@media (max-width:520px){
    .service-modal{
        padding:88px 10px 10px!important;
    }

    .service-modal__dialog{
        max-height:calc(100vh - 98px)!important;
        max-height:calc(100dvh - 98px)!important;
        border-radius:17px!important;
    }

    .service-modal__media{
        height:190px!important;
        min-height:190px!important;
    }

    .service-modal__content{
        padding:24px 16px 26px!important;
    }

    .service-modal__content h3{
        padding-right:30px!important;
        font-size:clamp(28px,9vw,38px)!important;
    }
}

/* Very short screens */
@media (max-height:620px){
    .service-modal{
        padding-top:82px!important;
        padding-bottom:8px!important;
    }

    .service-modal__dialog{
        max-height:calc(100vh - 90px)!important;
        max-height:calc(100dvh - 90px)!important;
    }
}
