﻿/* ==========================================================
   Product360 Viewer
   Version : 1.0
   Author  : ChatGPT + Pargat Singh
==========================================================*/

:root {
    --viewer-border: #000;
    --viewer-bg: #ffffff;
    --overlay-bg: rgba(0,0,0,.75);
    --header-height: 55px;
    --footer-height: 40px;
    --border-radius: 6px;
}

/* Disable page scroll while popup is open */

body.product360-open {
    overflow: hidden;
}

/***************************************************
                Overlay
****************************************************/

#product360Overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

/***************************************************
                Main Window
****************************************************/

#product360Window {
    width: 80vw;
    height: 80vh;
    background: var(--viewer-bg);
    border: 1px solid var(--viewer-border);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
    animation: Product360Fade .25s ease;
}

/***************************************************
                Header
****************************************************/

#product360Header {
    height: var(--header-height);
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #fafafa;
    flex-shrink: 0;
}

#product360Title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

#product360Close {
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    border: 1px solid #999;
    cursor: pointer;
    font-size: 24px;
    transition: .2s;
}

    #product360Close:hover {
        background: #e11d48;
        color: #fff;
        border-color: #e11d48;
    }

/***************************************************
                    Viewer
****************************************************/

#product360Viewer {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #efefef;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: grab;
}

    #product360Viewer:active {
        cursor: grabbing;
    }

/***************************************************
                Product Image
****************************************************/

#product360Image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .08s linear;
    pointer-events: none;
}

/***************************************************
                    Footer
****************************************************/

#product360Footer {
    height: var(--footer-height);
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #fafafa;
    font-size: 14px;
    color: #555;
    flex-shrink: 0;
}

#product360Frame {
    font-weight: bold;
}

#product360Zoom {
    font-weight: bold;
}

/***************************************************
                Loader
****************************************************/

#product360Loader {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.92);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 100;
}

.product360Spinner {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 5px solid #ddd;
    border-top: 5px solid #111;
    animation: spin 1s linear infinite;
}

#product360LoadingText {
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

#product360Progress {
    margin-top: 8px;
    color: #666;
    font-size: 14px;
}

/***************************************************
            Toolbar
****************************************************/

#product360Toolbar {
    position: absolute;
    right: 15px;
    top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}

.product360ToolButton {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    border: 1px solid #999;
    background: white;
    cursor: pointer;
    font-size: 18px;
    transition: .2s;
}

    .product360ToolButton:hover {
        background: #111;
        color: #fff;
    }

/***************************************************
            Animation
****************************************************/

@keyframes spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes Product360Fade {

    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/***************************************************
            Responsive
****************************************************/

@media(max-width:992px) {

    #product360Window {
        width: 92vw;
        height: 90vh;
    }
}

@media(max-width:768px) {

    #product360Window {
        width: 98vw;
        height: 96vh;
    }

    #product360Header {
        padding: 0 10px;
    }

    #product360Footer {
        padding: 0 10px;
        font-size: 12px;
    }

    #product360Title {
        font-size: 15px;
    }
}
