
/*==========================================================
  HELCU — COMMON IMAGE MODAL
  Used by:
  Doctor | Pharmacy | Clinic | Hospital | Healthcare

  Features:
  - Fullscreen image viewer
  - Premium dark overlay
  - Zoom support
  - Pan / drag support
  - Mobile pinch-zoom ready
  - Responsive
==========================================================*/


/*==========================================================
  MODAL
==========================================================*/

.hc-image-modal {

    display: none;

    position: fixed;

    inset: 0;

    z-index: 9999;

    width: 100%;
    height: 100%;

    padding: 20px;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    background:
        rgba(0, 0, 0, 0.88);

    backdrop-filter: blur(7px);

    -webkit-backdrop-filter: blur(7px);

    opacity: 0;

    transition:
        opacity 0.22s ease;

    touch-action: none;
}


/*==========================================================
  ACTIVE MODAL
==========================================================*/

.hc-image-modal.is-open {

    display: flex;

    opacity: 1;
}


/*==========================================================
  MODAL CONTENT
==========================================================*/

.hc-image-modal-content {

    position: relative;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    background: transparent;

    box-shadow: none;

    overflow: hidden;

    touch-action: none;
}


/*==========================================================
  IMAGE
==========================================================*/

.hc-image-modal-image {

    display: block;

    width: auto;
    height: auto;

    max-width: 92vw;
    max-height: 92vh;

    object-fit: contain;

    border-radius: 6px;

    user-select: none;
    -webkit-user-select: none;

    -webkit-user-drag: none;

    cursor: zoom-in;

    transform:
        translate3d(0, 0, 0)
        scale(1);

    transform-origin: center center;

    will-change:
        transform;

    box-shadow:
        0 18px 55px rgba(0, 0, 0, 0.48);

    touch-action: none;

    transition:
        transform 0.18s ease;
}


/*==========================================================
  ZOOMED IMAGE
==========================================================*/

.hc-image-modal-image.is-zoomed {

    cursor: grab;

    transition: none;
}


.hc-image-modal-image.is-dragging {

    cursor: grabbing;

    transition: none;
}


/*==========================================================
  OPEN ANIMATION
==========================================================*/

.hc-image-modal.is-open
.hc-image-modal-image {

    animation:
        hcImageModalZoomIn
        0.24s
        ease
        both;
}


@keyframes hcImageModalZoomIn {

    from {

        opacity: 0;

        transform:
            translate3d(0, 0, 0)
            scale(0.82);
    }

    to {

        opacity: 1;

        transform:
            translate3d(0, 0, 0)
            scale(1);
    }
}


/*==========================================================
  CLOSE BUTTON
==========================================================*/

.hc-image-modal-close {

    position: fixed;

    top: 18px;
    right: 22px;

    z-index: 10001;

    width: 46px;
    height: 46px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid
        rgba(255, 255, 255, 0.16);

    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.10);

    color: #ffffff;

    font-family:
        Arial,
        sans-serif;

    font-size: 31px;

    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    user-select: none;

    backdrop-filter: blur(8px);

    -webkit-backdrop-filter: blur(8px);

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        color 0.18s ease;
}


/*==========================================================
  CLOSE BUTTON HOVER
==========================================================*/

.hc-image-modal-close:hover {

    background:
        rgba(255, 255, 255, 0.18);

    border-color:
        rgba(255, 255, 255, 0.30);

    color: #ffffff;

    transform: scale(1.06);
}


/*==========================================================
  CLOSE BUTTON ACTIVE
==========================================================*/

.hc-image-modal-close:active {

    transform: scale(0.94);
}


/*==========================================================
  FOCUS
==========================================================*/

.hc-image-modal-close:focus-visible {

    outline: 2px solid
        rgba(255, 255, 255, 0.75);

    outline-offset: 3px;
}


/*==========================================================
  IMAGE TRIGGER
  Doctor / Pharmacy / Clinic / Hospital DP
==========================================================*/

.hc-image-modal-trigger {

    cursor: zoom-in;

    user-select: none;

    -webkit-user-select: none;
}


/*==========================================================
  MOBILE
  0px → 767.98px
==========================================================*/

@media (max-width: 767.98px) {

    .hc-image-modal {

        padding: 10px;
    }


    .hc-image-modal-content {

        width: 100%;
        height: 100%;
    }


    .hc-image-modal-image {

        max-width: 96vw;
        max-height: 90vh;

        border-radius: 5px;

        box-shadow:
            0 14px 40px rgba(0, 0, 0, 0.52);
    }


    .hc-image-modal-close {

        top: 14px;
        right: 16px;

        width: 42px;
        height: 42px;

        font-size: 28px;
    }
}


/*==========================================================
  TABLET
  768px → 1199.98px
==========================================================*/

@media (min-width: 768px)
and (max-width: 1199.98px) {

    .hc-image-modal {

        padding: 18px;
    }


    .hc-image-modal-image {

        max-width: 94vw;
        max-height: 92vh;
    }


    .hc-image-modal-close {

        top: 18px;
        right: 22px;
    }
}


/*==========================================================
  DESKTOP
  1200px+
==========================================================*/

@media (min-width: 1200px) {

    .hc-image-modal {

        padding: 24px;
    }


    .hc-image-modal-image {

        max-width: 90vw;
        max-height: 90vh;
    }


    .hc-image-modal-close {

        top: 22px;
        right: 28px;

        width: 48px;
        height: 48px;

        font-size: 32px;
    }
}


/*==========================================================
  REDUCED MOTION
==========================================================*/

@media (prefers-reduced-motion: reduce) {

    .hc-image-modal,
    .hc-image-modal-image,
    .hc-image-modal-close {

        transition: none;
    }

    .hc-image-modal.is-open
    .hc-image-modal-image {

        animation: none;
    }
}

