/* =========================================================
   UEJ VIRTUAL TRY-ON
========================================================= */

.uej-tryon-button {
    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin: 14px 0;

    border: 1px solid #0b5963;

    background: #ffffff;
    color: #0b5963;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        background .25s ease,
        color .25s ease,
        transform .25s ease;
}

.uej-tryon-button:hover {
    background: #0b5963;
    color: #ffffff;
}

.uej-tryon-button:active {
    transform: scale(.99);
}


/* =========================================================
   MODAL
========================================================= */

.uej-tryon-modal {
    position: fixed;
    inset: 0;

    z-index: 9999999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;
}

.uej-tryon-modal.is-open {
    display: flex;
}

.uej-tryon-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(7, 15, 17, .72);

    backdrop-filter: blur(7px);
}

.uej-tryon-panel {
    position: relative;
    z-index: 2;

    width: min(620px, 100%);

    max-height: 94vh;
    overflow-y: auto;

    padding: 28px;

    background: #ffffff;

    box-shadow:
        0 40px 100px rgba(0,0,0,.28);
}

.uej-tryon-close {
    position: absolute;

    top: 10px;
    right: 12px;

    width: 42px;
    height: 42px;

    border: 0;

    background: transparent;

    font-size: 29px;
    font-weight: 300;

    color: #111;

    cursor: pointer;

    z-index: 5;
}


/* =========================================================
   HEADER
========================================================= */

.uej-tryon-header {
    text-align: center;

    padding:
        5px 30px 20px;
}

.uej-tryon-header > span {
    color: #0b5963;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .22em;
}

.uej-tryon-header h2 {
    margin: 7px 0 6px;

    font-size: 28px;
    line-height: 1.2;
}

.uej-tryon-header p {
    max-width: 430px;

    margin: auto;

    color: #727272;

    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   CAMERA AREA
========================================================= */

.uej-tryon-view {
    position: relative;

    width: 100%;

    aspect-ratio: 4 / 3;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #f4f7f7,
            #edf2f2
        );
}

#uej-tryon-canvas {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;
}

.uej-tryon-loading {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;

    color: #777;

    font-size: 13px;

    pointer-events: none;
}

.uej-tryon-loading.is-hidden {
    display: none;
}


/* =========================================================
   STATUS
========================================================= */

.uej-tryon-status {
    min-height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 9px 12px;

    text-align: center;

    color: #606060;

    font-size: 12px;
}


/* =========================================================
   ACTION BUTTONS
========================================================= */

.uej-tryon-actions {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 10px;
}

.uej-tryon-primary,
.uej-tryon-secondary {
    min-height: 48px;

    padding: 11px 16px;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .1em;
    text-transform: uppercase;

    cursor: pointer;
}

.uej-tryon-primary {
    border: 1px solid #0b5963;

    background: #0b5963;
    color: #ffffff;
}

.uej-tryon-secondary {
    border: 1px solid #d6d6d6;

    background: #ffffff;
    color: #222222;
}

.uej-tryon-primary:disabled,
.uej-tryon-secondary:disabled {
    opacity: .45;
    cursor: not-allowed;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

    .uej-tryon-modal {
        padding: 0;

        align-items: flex-end;
    }

    .uej-tryon-panel {
        width: 100%;

        max-height: 97vh;

        padding:
            22px 14px 24px;

        border-radius:
            18px 18px 0 0;
    }

    .uej-tryon-header h2 {
        font-size: 24px;
    }

    .uej-tryon-view {
        aspect-ratio: 3 / 4;
    }

}
/* =========================================================
   UEJ LIVE TRY-ON CONTROLS
========================================================= */

.uej-tryon-view {
    position: relative;
}


/* CAMERA FLIP */

.uej-tryon-flip {
    position: absolute;
    top: 14px;
    right: 14px;

    z-index: 30;

    min-height: 42px;

    padding: 9px 15px;

    border: 1px solid rgba(255,255,255,.55);
    border-radius: 50px;

    background: rgba(0,0,0,.55);
    color: #fff;

    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;

    cursor: pointer;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition:
        background .2s ease,
        transform .2s ease;
}

.uej-tryon-flip:hover {
    background: #075b63;
}

.uej-tryon-flip:active {
    transform: scale(.96);
}


/* ADJUSTMENT PANEL */

.uej-tryon-adjustments {
    padding: 16px 18px;

    border-top: 1px solid #e8e8e8;

    background: #fff;
}

.uej-tryon-control {
    margin-bottom: 13px;
}

.uej-tryon-control-head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 5px;

    font-size: 12px;
    font-weight: 600;

    color: #333;
}

.uej-tryon-control output {
    color: #075b63;
    font-weight: 700;
}


/* SLIDERS */

.uej-tryon-control input[type="range"] {
    width: 100%;
    height: 5px;

    margin: 0;

    cursor: pointer;

    accent-color: #075b63;
}


/* RESET */

.uej-tryon-reset {
    width: 100%;

    margin-top: 3px;
    padding: 10px 14px;

    border: 1px solid #075b63;
    border-radius: 5px;

    background: #fff;
    color: #075b63;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.uej-tryon-reset:hover {
    background: #075b63;
    color: #fff;
}


/* MOBILE */

@media (max-width: 600px) {

    .uej-tryon-flip {
        top: 10px;
        right: 10px;

        min-height: 38px;

        padding: 8px 12px;

        font-size: 11px;
    }

    .uej-tryon-adjustments {
        padding: 12px 14px;
    }

    .uej-tryon-control {
        margin-bottom: 10px;
    }
}
/* =========================================================
   UEJ TRY-ON — LIVE COMPOSITED CAMERA FIX
   Canvas must be the visible camera.
========================================================= */

.uej-tryon-view {
    position: relative !important;
    overflow: hidden !important;
    background: #000 !important;
}


/*
 * Keep camera video running,
 * but NEVER show the raw video to the customer.
 *
 * JavaScript reads this video and draws it
 * into the canvas.
 */
#uej-tryon-video {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    left: -9999px !important;
    top: -9999px !important;

    opacity: 0 !important;
    visibility: hidden !important;

    pointer-events: none !important;

    z-index: -1 !important;
}


/*
 * THIS is the live preview.
 *
 * Camera + ring are both rendered here.
 */
#uej-tryon-canvas {
    display: block !important;

    position: relative !important;

    z-index: 10 !important;

    width: 100% !important;
    height: auto !important;

    max-width: 100% !important;

    margin: 0 !important;

    background: #000 !important;
}


/*
 * Controls must remain over canvas.
 */
.uej-tryon-flip {
    z-index: 40 !important;
}


/*
 * Loading message over live canvas.
 */
#uej-tryon-loading {
    z-index: 30 !important;
}