
/* =========================================
   JABIRGFX DEPARTMENT POPUP
   Isolated & Responsive Styles
========================================= */

.jgdp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(2, 3, 12, .82);
    backdrop-filter: blur(13px);
    -webkit-backdrop-filter: blur(13px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s ease, visibility .28s ease;
}

.jgdp-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal */

.jgdp-modal {
    position: relative;
    width: min(1320px, 100%);
    max-height: calc(100vh - 56px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 48px;

    border: 1px solid rgba(151, 103, 255, .48);
    border-radius: 34px;

    background:
        radial-gradient(
            ellipse at 85% 0%,
            rgba(92, 48, 181, .22),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            #101126 0%,
            #080b19 60%,
            #090817 100%
        );

    box-shadow:
        0 0 80px rgba(92, 38, 255, .17),
        inset 0 1px rgba(255, 255, 255, .04);

    color: #f5f5ff;
    transform: translateY(16px) scale(.985);
    transition: transform .28s ease;
    scrollbar-width: thin;
    scrollbar-color: #7651cf transparent;
}

.jgdp-overlay.is-open .jgdp-modal {
    transform: translateY(0) scale(1);
}

.jgdp-modal::-webkit-scrollbar {
    width: 6px;
}

.jgdp-modal::-webkit-scrollbar-thumb {
    background: #7651cf;
    border-radius: 20px;
}

/* Close Button */

.jgdp-close {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 10;

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

    width: 54px;
    height: 54px;

    border: 1px solid rgba(185, 170, 255, .25);
    border-radius: 50%;

    background: rgba(255, 255, 255, .035);
    color: #fff;

    font-size: 32px;
    line-height: 1;
    cursor: pointer;

    transition: .25s ease;
}

.jgdp-close:hover {
    background: #6e43ed;
    transform: rotate(90deg);
}

/* Header */

.jgdp-eyebrow {
    margin: 0 70px 18px 0;
    color: #bba0ff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.jgdp-modal h2 {
    max-width: 1000px;
    margin: 0 60px 16px 0;
    color: #f5f5ff;
    font-size: clamp(32px, 4vw, 58px);
    line-height: 1.07;
    letter-spacing: -.055em;
    font-weight: 800;
}

.jgdp-intro {
    max-width: 930px;
    margin: 0 0 36px;
    color: #b9bfd2;
    font-size: 17px;
    line-height: 1.85;
}

/* Main Layout */

.jgdp-main-grid {
    display: grid;
    grid-template-columns: 1.2fr .9fr;
    gap: 24px;
}

.jgdp-panel {
    min-width: 0;
    padding: 28px;
    border: 1px solid rgba(151, 133, 221, .2);
    border-radius: 24px;
    background: rgba(255, 255, 255, .025);
}

.jgdp-panel h3 {
    margin: 0 0 22px;
    color: #d4c7ff;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 800;
}

/* Services Grid */

.jgdp-services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.jgdp-service {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 15px;

    border: 1px solid rgba(134, 87, 238, .2);
    border-radius: 15px;

    background: rgba(109, 76, 190, .09);
    color: #e4e4f3;

    font-size: 14px;
    line-height: 1.45;
    transition: .25s ease;
}

.jgdp-service:hover {
    border-color: rgba(160, 115, 255, .5);
    background: rgba(109, 76, 190, .17);
    transform: translateY(-2px);
}

.jgdp-service::before {
    content: "✦";
    flex: 0 0 auto;
    color: #bd8cff;
    font-size: 21px;
}

/* Work Cards Grid */

.jgdp-work {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Individual Work Card */

.jgdp-work-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    min-width: 0;
    min-height: 210px;
    aspect-ratio: 4 / 5;

    padding: 16px 14px;
    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 16px;

    background: linear-gradient(
        145deg,
        rgba(104, 50, 205, .42),
        rgba(22, 28, 65, .7)
    );

    transition: transform .3s ease, border-color .3s ease;
}

.jgdp-work-card:hover {
    transform: translateY(-5px);
    border-color: rgba(181, 144, 255, .65);
}

/* Work Card Image */

.jgdp-work-card img {
    position: absolute;
    inset: 0;
    z-index: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    transition: transform .55s ease;
}

.jgdp-work-card:hover img {
    transform: scale(1.08);
}

/* Image Dark Overlay */

.jgdp-work-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;

    background: linear-gradient(
        180deg,
        rgba(5, 5, 20, .03) 0%,
        rgba(5, 5, 20, .18) 35%,
        rgba(5, 5, 20, .92) 100%
    );

    pointer-events: none;
}

/* Work Card Content */

.jgdp-work-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.jgdp-work-content h4,
.jgdp-work-card strong {
    display: block;
    margin: 0 0 8px;

    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;

    overflow-wrap: anywhere;
}

.jgdp-work-content span,
.jgdp-work-card small {
    display: block;
    color: #d5cbed;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    line-height: 1.5;
    text-transform: uppercase;
}

/* Fallback Decoration */

.jgdp-work-card::after {
    content: "";
    position: absolute;
    z-index: 1;

    width: 100px;
    height: 100px;

    right: -35px;
    top: 25px;

    border-radius: 50%;
    background: rgba(180, 122, 255, .13);
    filter: blur(15px);
    pointer-events: none;
}

/* Footer */

.jgdp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-top: 30px;
    padding-top: 28px;

    border-top: 1px solid rgba(183, 168, 255, .17);
}

.jgdp-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

/* Buttons */

.jgdp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;
    padding: 0 22px;

    border-radius: 15px;
    text-decoration: none !important;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.jgdp-btn:hover {
    transform: translateY(-2px);
}

.jgdp-btn-secondary {
    border: 1px solid rgba(196, 184, 255, .22);
    background: rgba(255, 255, 255, .035);
    color: #e9e7ff !important;
}

.jgdp-btn-secondary:hover {
    background: rgba(255, 255, 255, .09);
}

.jgdp-btn-primary {
    border: 1px solid #7e51ff;
    background: linear-gradient(110deg, #8754f7, #5144e6);
    color: #fff !important;
    box-shadow: 0 8px 28px rgba(91, 54, 227, .2);
}

.jgdp-btn-primary:hover {
    box-shadow: 0 10px 32px rgba(91, 54, 227, .4);
}

/* Body Lock */

body.jgdp-lock {
    overflow: hidden;
}

/* =========================================
   TABLET RESPONSIVE
========================================= */

@media (max-width: 900px) {

    .jgdp-modal {
        padding: 34px;
    }

    .jgdp-main-grid {
        grid-template-columns: 1fr;
    }

    .jgdp-work-card {
        min-height: 190px;
    }

    .jgdp-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 560px) {

    .jgdp-overlay {
        padding: 10px;
        align-items: center;
    }

    .jgdp-modal {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 26px 18px;
        border-radius: 23px;
    }

    .jgdp-close {
        top: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
        font-size: 26px;
    }

    .jgdp-eyebrow {
        margin-right: 45px;
        margin-bottom: 15px;
        font-size: 10px;
        letter-spacing: 1.8px;
    }

    .jgdp-modal h2 {
        margin-right: 28px;
        font-size: 31px;
    }

    .jgdp-intro {
        margin-bottom: 24px;
        font-size: 14px;
        line-height: 1.7;
    }

    .jgdp-main-grid {
        gap: 15px;
    }

    .jgdp-panel {
        padding: 17px;
        border-radius: 18px;
    }

    .jgdp-panel h3 {
        margin-bottom: 16px;
        font-size: 11px;
        letter-spacing: 1.3px;
    }

    .jgdp-services {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .jgdp-service {
        min-height: 52px;
        padding: 12px;
        font-size: 13px;
    }

    .jgdp-work {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .jgdp-work-card {
        min-height: 165px;
        padding: 12px 10px;
        border-radius: 13px;
    }

    .jgdp-work-content h4,
    .jgdp-work-card strong {
        font-size: 12px;
    }

    .jgdp-work-content span,
    .jgdp-work-card small {
        font-size: 8px;
        letter-spacing: .6px;
    }

    .jgdp-footer {
        gap: 18px;
        margin-top: 22px;
        padding-top: 20px;
    }

    .jgdp-team {
        gap: 12px;
    }

    .jgdp-team small {
        font-size: 11px;
    }

    .jgdp-actions {
        width: 100%;
        flex-direction: column;
    }

    .jgdp-btn {
        width: 100%;
        min-height: 49px;
    }
}

/* Small Mobile */

@media (max-width: 360px) {

    .jgdp-modal {
        padding: 23px 14px;
    }

    .jgdp-work {
        grid-template-columns: 1fr;
    }

    .jgdp-work-card {
        min-height: 200px;
        aspect-ratio: 16 / 10;
    }

    .jgdp-modal h2 {
        font-size: 27px;
    }
}

/* Reduced Motion */

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

    .jgdp-overlay,
    .jgdp-modal,
    .jgdp-work-card,
    .jgdp-work-card img,
    .jgdp-btn,
    .jgdp-close {
        transition: none !important;
    }
}

/* =====================================
   JABIRGFX POPUP — CARD OVERFLOW FIX
===================================== */

.jgdp-main-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
    width: 100%;
    min-width: 0;
}

.jgdp-panel {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.jgdp-work {
    display: grid;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.jgdp-work-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.jgdp-work-content {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.jgdp-work-content h4 {
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Tablet & Mobile */

@media (max-width: 900px) {
    .jgdp-main-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 560px) {
    .jgdp-work {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .jgdp-work {
        grid-template-columns: minmax(0, 1fr);
    }
}
