/* =========================================================
   SERVICE 02 — 3D TRUCK SPACE VISUALIZER
   VISUAL + ANIMATION LAYER
========================================================= */


/* =========================================================
   SCREEN ENTRY
========================================================= */

.shiftify-service .shiftify-screen.active {
    animation:
        truckScreenIn .55s ease forwards;
}

@keyframes truckScreenIn {

    0% {
        opacity: 0;
        transform: translateY(16px) scale(.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}


/* =========================================================
   INVENTORY VISUAL
========================================================= */

.shiftify-service .inventory-visual {
    width: 100%;
    max-width: 300px;
    height: 150px;
    margin: 18px auto 16px;

    position: relative;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);

    gap: 12px;
    padding: 12px;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #f8fafc
        );

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.7),
        0 8px 22px rgba(15,23,42,.05);
}


/* INVENTORY OBJECT */

.shiftify-service .inventory-object {

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;

    color: #475569;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    box-shadow:
        0 5px 12px rgba(15,23,42,.06);

    animation:
        inventoryFloat 3s ease-in-out infinite;
}


/* OBJECT LABEL */

.shiftify-service .inventory-object span {
    position: relative;
    z-index: 2;
}


/* SOFA */

.shiftify-service .inventory-object--sofa {

    background:
        linear-gradient(
            135deg,
            #fff7ed,
            #ffedd5
        );

    border-color: #fed7aa;

    animation-delay: 0s;
}


/* BOX */

.shiftify-service .inventory-object--box {

    width: 70px;
    height: 48px;

    align-self: center;
    justify-self: center;

    background:
        linear-gradient(
            135deg,
            #fef3c7,
            #fde68a
        );

    border-color: #fcd34d;

    animation-delay: .35s;
}


/* BED */

.shiftify-service .inventory-object--bed {

    background:
        linear-gradient(
            135deg,
            #f1f5f9,
            #e2e8f0
        );

    border-color: #cbd5e1;

    animation-delay: .7s;
}


/* TV */

.shiftify-service .inventory-object--tv {

    background:
        linear-gradient(
            135deg,
            #e0f2fe,
            #bae6fd
        );

    border-color: #7dd3fc;

    animation-delay: 1s;
}


@keyframes inventoryFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }

}


/* INVENTORY STATUS */

.shiftify-service .inventory-status {

    max-width: 300px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;

    gap: 7px;

    padding: 9px 11px;

    border: 1px solid #dcfce7;
    border-radius: 9px;

    background: #f0fdf4;

    font-size: 10px;
}


.shiftify-service .status-check {

    width: 19px;
    height: 19px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16a34a;
    color: #ffffff;

    font-size: 10px;
    font-weight: 800;
}


.shiftify-service .inventory-status span:nth-child(2) {
    color: #475569;
}


.shiftify-service .inventory-status strong {
    color: #15803d;
    font-size: 11px;
}


/* =========================================================
   TRUCK LOAD PLAN
========================================================= */

.shiftify-service .truck-container {

    width: 100%;
    max-width: 320px;
    height: 150px;

    margin: 18px auto 14px;

    display: flex;
    align-items: stretch;

    position: relative;

    perspective: 900px;
}


/* CABIN */

.shiftify-service .truck-cabin {

    width: 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    border-radius: 13px 5px 5px 13px;

    background:
        linear-gradient(
            145deg,
            #fb923c,
            #ea580c
        );

    color: #ffffff;

    font-size: 8px;
    font-weight: 800;

    box-shadow:
        0 10px 18px rgba(234,88,12,.18);

    transform: translateZ(8px);
}


.shiftify-service .truck-cabin::after {

    content: "";

    position: absolute;

    width: 38px;
    height: 27px;

    top: 25px;
    right: 8px;

    border-radius: 5px;

    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #bfdbfe
        );

    border: 2px solid rgba(255,255,255,.7);
}


/* TRUCK BODY */

.shiftify-service .truck-body {

    flex: 1;

    position: relative;

    overflow: hidden;

    border-radius: 5px 13px 13px 5px;

    background:
        linear-gradient(
            145deg,
            #ffffff,
            #e2e8f0
        );

    border: 1px solid #cbd5e1;

    box-shadow:
        0 10px 24px rgba(15,23,42,.10);

    transform:
        perspective(700px)
        rotateY(-2deg);
}


/* TRUCK GRID */

.shiftify-service .truck-grid {

    position: absolute;
    inset: 8px;

    opacity: .55;

    background-image:
        linear-gradient(
            to right,
            #cbd5e1 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            #cbd5e1 1px,
            transparent 1px
        );

    background-size:
        20px 20px;

    border-radius: 6px;
}


/* LOAD ITEMS */

.shiftify-service .load-item {

    position: absolute;

    z-index: 3;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    font-size: 7px;
    font-weight: 800;

    color: #475569;

    box-shadow:
        0 5px 10px rgba(15,23,42,.12);

    animation:
        loadItemPulse 2.8s ease-in-out infinite;
}


/* SOFA */

.shiftify-service .load-item--sofa {

    width: 78px;
    height: 32px;

    left: 17px;
    bottom: 15px;

    background:
        linear-gradient(
            135deg,
            #fed7aa,
            #fdba74
        );

    animation-delay: .2s;
}


/* BED */

.shiftify-service .load-item--bed {

    width: 68px;
    height: 38px;

    right: 16px;
    bottom: 13px;

    background:
        linear-gradient(
            135deg,
            #e2e8f0,
            #cbd5e1
        );

    animation-delay: .6s;
}


/* BOX */

.shiftify-service .load-item--box {

    width: 34px;
    height: 30px;

    right: 55px;
    top: 18px;

    background:
        linear-gradient(
            135deg,
            #fde68a,
            #facc15
        );

    animation-delay: 1s;
}


@keyframes loadItemPulse {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }

}


/* SPACE INDICATOR */

.shiftify-service .space-indicator {

    max-width: 320px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 9px 12px;

    border-radius: 9px;

    background: #fff7ed;

    border: 1px solid #fed7aa;

    font-size: 10px;
}


.shiftify-service .space-indicator span {
    color: #78716c;
}


.shiftify-service .space-indicator strong {
    color: #ea580c;
    font-size: 12px;
}


/* =========================================================
   3D TRUCK VISUAL
========================================================= */

.shiftify-service .truck-3d-stage {

    width: 100%;
    max-width: 330px;
    height: 175px;

    margin: 12px auto 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    perspective: 900px;
}


/* MAIN 3D TRUCK */

.shiftify-service .truck-3d {

    width: 235px;
    height: 125px;

    position: relative;

    transform-style: preserve-3d;

    transform:
        rotateX(58deg)
        rotateZ(-32deg);

    animation:
        truck3dFloat 4s ease-in-out infinite;
}


@keyframes truck3dFloat {

    0%,
    100% {
        transform:
            rotateX(58deg)
            rotateZ(-32deg)
            translateY(0);
    }

    50% {
        transform:
            rotateX(58deg)
            rotateZ(-32deg)
            translateY(-6px);
    }

}


/* TOP / OPENING */

.shiftify-service .truck-3d-top {

    position: absolute;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #cbd5e1;

    border-radius: 7px;

    background:
        linear-gradient(
            135deg,
            #f8fafc,
            #e2e8f0
        );

    color: #64748b;

    font-size: 8px;
    font-weight: 800;

    transform:
        translateZ(28px);
}


.shiftify-service .truck-3d-top::before {

    content: "";

    position: absolute;

    inset: 8px;

    border: 1px dashed #94a3b8;

    border-radius: 4px;
}


/* INNER SPACE */

.shiftify-service .truck-3d-inner {

    position: absolute;

    inset: 13px;

    transform-style: preserve-3d;

    transform:
        translateZ(2px);

    border-radius: 4px;

    background:
        linear-gradient(
            135deg,
            #f1f5f9,
            #cbd5e1
        );

    border: 1px solid #94a3b8;
}


/* =========================================================
   3D CARGO CUBES
========================================================= */

.shiftify-service .cube {

    position: absolute;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 4px;

    color: #475569;

    font-size: 7px;
    font-weight: 800;

    box-shadow:
        4px 5px 10px rgba(15,23,42,.16);

    transform-style: preserve-3d;

    animation:
        cargoFloat 3s ease-in-out infinite;
}


/* LARGE */

.shiftify-service .cube--large {

    width: 75px;
    height: 35px;

    left: 17px;
    bottom: 13px;

    background:
        linear-gradient(
            135deg,
            #fed7aa,
            #fb923c
        );

    animation-delay: 0s;
}


/* MEDIUM */

.shiftify-service .cube--medium {

    width: 58px;
    height: 30px;

    right: 17px;
    bottom: 14px;

    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #93c5fd
        );

    animation-delay: .5s;
}


/* SMALL */

.shiftify-service .cube--small {

    width: 27px;
    height: 27px;

    right: 60px;
    top: 16px;

    background:
        linear-gradient(
            135deg,
            #fde68a,
            #facc15
        );

    animation-delay: .9s;
}


/* SECOND BOX */

.shiftify-service .cube--two {

    right: 27px;
    top: 22px;

    animation-delay: 1.2s;
}


@keyframes cargoFloat {

    0%,
    100% {
        transform:
            translateZ(0)
            translateY(0);
    }

    50% {
        transform:
            translateZ(5px)
            translateY(-3px);
    }

}


/* VISUALIZE STATUS */

.shiftify-service .visualize-status {

    max-width: 330px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 9px 11px;

    border: 1px solid #dcfce7;
    border-radius: 9px;

    background: #f0fdf4;

    color: #475569;

    font-size: 10px;
}


.shiftify-service .visualize-status > span {

    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #16a34a;

    color: #ffffff;

    font-size: 9px;
    font-weight: 800;
}


.shiftify-service .visualize-status strong {

    color: #166534;
    font-size: 10px;
}


/* =========================================================
   EXECUTION SUMMARY
========================================================= */

.shiftify-service .execution-summary {

    width: 100%;
    max-width: 320px;

    margin: 18px auto 0;

    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border: 1px solid #e2e8f0;
    border-radius: 11px;

    overflow: hidden;

    background: #ffffff;

    box-shadow:
        0 8px 20px rgba(15,23,42,.05);
}


.shiftify-service .execution-summary > div {

    min-width: 0;

    padding: 11px 7px;

    text-align: center;

    border-right: 1px solid #e2e8f0;
}


.shiftify-service .execution-summary > div:last-child {
    border-right: 0;
}


.shiftify-service .execution-summary span {

    display: block;

    margin-bottom: 4px;

    color: #94a3b8;

    font-size: 8px;
    line-height: 1.3;
}


.shiftify-service .execution-summary strong {

    display: block;

    color: #111827;

    font-size: 11px;
    font-weight: 800;
}


/* =========================================================
   ACTIVE SCREEN VISUAL POLISH
========================================================= */

.shiftify-service .shiftify-screen.active
.inventory-object,
.shiftify-service .shiftify-screen.active
.load-item,
.shiftify-service .shiftify-screen.active
.cube {
    will-change: transform;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .shiftify-service .inventory-visual {
        max-width: 275px;
        height: 140px;
        gap: 9px;
        padding: 9px;
    }

    .shiftify-service .truck-container {
        max-width: 285px;
        height: 135px;
    }

    .shiftify-service .truck-cabin {
        width: 62px;
    }

    .shiftify-service .truck-3d-stage {
        height: 155px;
        max-width: 290px;
    }

    .shiftify-service .truck-3d {
        width: 205px;
        height: 112px;
    }

    .shiftify-service .execution-summary {
        max-width: 285px;
    }

    .shiftify-service .execution-summary > div {
        padding: 9px 5px;
    }

}