/**
 * Furni 360 Product Images - Frontend Styles
 */

/* Floating Button in main product image */
.furni-360-btn-wrapper {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
}

.btn-furni-360-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 6px 16px 6px 12px;
    color: #1a1b1a;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    user-select: none;
    opacity: 0.8;
}

.btn-furni-360-trigger:hover {
    background-color: var(--bgcLight);
}

.btn-furni-360-trigger .icon-360 {
    width: 35px;
    height: 30px;
    object-fit: contain;
    transition: transform 0.4s ease;
    display: block;
}

.btn-furni-360-trigger .btn-text {
    display: block;
    line-height: 1;
}

/* Modal Overlay */
.furni-360-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 27, 26, 0.7);
    z-index: 1050;
    transition: opacity 0.3s ease;
}

.furni-360-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    outline: none;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fullscreen modal state */
.furni-360-modal.furni-360-modal--fullscreen {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
}

/* Modal Close Button */
.furni-360-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(26, 27, 26, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1070;
    transition: all 0.2s ease;
}

.furni-360-modal-close:hover {
    background: rgba(26, 27, 26, 0.1);
    transform: scale(1.05);
}

.furni-360-modal-close img {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* Modal Body */
.furni-360-modal-body {
    position: relative;
    padding: 40px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

/* 360 Viewer Wrapper */
.furni-360-viewer-wrapper {
    position: relative;
    width: 100%;
    height: 650px; /* Default height - increased for larger default view */
    max-height: calc(90vh - 170px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fullscreen adjustments inside modal */
.furni-360-modal--fullscreen .furni-360-modal-body {
    padding-top: 60px;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
}

.furni-360-modal--fullscreen .furni-360-viewer-wrapper {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
}

/* ThreeSixty Class Styling */
.product-360-view {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.threesixty_images {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
}

.threesixty_images:active {
    cursor: grabbing;
}

.threesixty-frame {
    width: 100% !important;
    height: 100% !important;
    justify-content: center;
    align-items: center;
}

.threesixty-frame[style*="display: none"] {
    display: none !important;
}

.threesixty-frame:not([style*="display: none"]) {
    display: flex !important;
}

.threesixty-frame img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    user-select: none;
    -webkit-user-drag: none;
}

/* Instruction Text */
.furni-360-instruction {
    margin-top: 15px;
    font-size: 13px;
    color: #8c908c;
    text-align: center;
    user-select: none;
}

/* Controls Navigation Bar */
.furni-360-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.furni-360-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f4f5f4;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #1a1b1a;
    transition: all 0.2s ease;
    outline: none;
}

.furni-360-control-btn:hover {
    background: #1a1b1a;
    color: #ffffff;
    transform: scale(1.05);
}

.furni-360-control-btn:active {
    transform: scale(0.95);
}

.furni-360-control-btn .material-icons {
    font-size: 24px;
}

/* Loading Spinner styles */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    text-align: center;
    z-index: 1080;
}

.spinner > div {
    width: 12px;
    height: 12px;
    background-color: #1a1b1a;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    -webkit-animation-delay: -0.16s;
    animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
    0%, 80%, 100% { -webkit-transform: scale(0) }
    40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% { 
        -webkit-transform: scale(0);
        transform: scale(0);
    } 40% { 
        -webkit-transform: scale(1.0);
        transform: scale(1.0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .furni-360-btn-wrapper {
        bottom: 8px;
        left: 8px;
    }
    .btn-furni-360-trigger {
        padding: 4px 12px 4px 8px;
        font-size: 11px;
        border-radius: 16px;
    }
    .btn-furni-360-trigger .icon-360 {
        width: 25px;
        height: 21px;
    }
    .furni-360-modal {
        width: 96%;
        max-height: 96vh;
        max-height: 96dvh;
    }
    .furni-360-modal-body {
        padding: 30px 15px 15px 15px;
    }
    .furni-360-viewer-wrapper {
        height: calc(96vh - 160px);
        height: calc(96dvh - 160px);
        max-height: none;
    }
    .furni-360-controls {
        gap: 15px;
        margin-top: 15px;
    }
    .furni-360-control-btn {
        width: 40px;
        height: 40px;
    }
    .furni-360-control-btn .material-icons {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .furni-360-modal {
        width: 100%;
        height: 100vh;
        height: -webkit-fill-available;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    .furni-360-modal-body {
        padding: 50px 10px 20px 10px;
        height: 100%;
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }
    .furni-360-viewer-wrapper {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        max-height: none;
    }
    .furni-360-controls {
        gap: 12px;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    .furni-360-control-btn.btn-fullscreen {
        display: none;
    }
    .furni-360-instruction {
        margin-top: 8px;
        font-size: 11px;
    }
}
