/* ============================
   Shoes Virtual Try-On — AR Camera Styles
   Dual mode: 3D model-viewer + 2D drag overlay
   ============================ */

/* ----------------------------------------
   3D Model Viewer
   ---------------------------------------- */
#svto-3d-container {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e0e0e0;
}

#svto-3d-viewer {
    width: 100%;
    min-height: 380px;
    border-radius: 12px;
    --poster-color: transparent;
}

/* "View in AR" button inside model-viewer */
.svto-3d-ar-btn {
    background: linear-gradient(135deg, #6c63ff, #5a4fff);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
    transition: all 0.2s;
    z-index: 10;
}

.svto-3d-ar-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 28px rgba(108, 99, 255, 0.5);
}

.svto-3d-ar-btn:active {
    transform: translateX(-50%) scale(0.97);
}

/* 3D Hint */
.svto-3d-hint {
    text-align: center;
    padding: 10px 16px;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    background: #fafafa;
    border-top: 1px solid #eee;
}

/* 3D Controls */
#svto-3d-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0;
    gap: 12px;
}

/* ----------------------------------------
   2D Camera AR Container
   ---------------------------------------- */
#svto-ar-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    touch-action: none;
    user-select: none;
}

#svto-ar-video {
    width: 100%;
    display: block;
    border-radius: 12px;
}

/* Draggable Shoe Overlay */
.svto-ar-shoe-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: auto;
    cursor: grab;
    z-index: 10;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    transition: filter 0.15s, transform 0.1s;
    pointer-events: auto;
    display: none;
}

.svto-ar-shoe-overlay.dragging {
    cursor: grabbing;
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.6));
    transform: scale(1.05);
}

/* Hint Text */
.svto-ar-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    z-index: 15;
    pointer-events: none;
    white-space: nowrap;
    animation: svto-hint-pulse 2s ease-in-out infinite;
}

@keyframes svto-hint-pulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 0.5; }
}

/* Hidden canvas for capture */
#svto-ar-canvas {
    display: none;
}

/* AR Status */
#svto-ar-status {
    padding: 20px;
    text-align: center;
    color: #ff6b6b;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

/* ----------------------------------------
   AR Controls (shared)
   ---------------------------------------- */
#svto-ar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}

/* Size/Rotate Slider Control */
.svto-ar-size-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f7ff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 6px 14px;
}

.svto-ar-size-control label {
    font-size: 16px;
    line-height: 1;
}

#svto-ar-size-slider,
#svto-ar-rotate-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#svto-ar-size-slider::-webkit-slider-thumb,
#svto-ar-rotate-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6c63ff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

#svto-ar-size-slider::-moz-range-thumb,
#svto-ar-rotate-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #6c63ff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Capture/Switch/Back Buttons */
.svto-ar-capture-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid #6c63ff;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svto-ar-capture-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
}

.svto-ar-capture-btn:active {
    transform: scale(0.95);
    background: #6c63ff;
}

.svto-ar-capture-btn::after {
    content: '';
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #6c63ff;
    display: block;
}

.svto-ar-switch-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.svto-ar-switch-btn:hover {
    border-color: #6c63ff;
    background: #f8f7ff;
}

.svto-ar-back-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.svto-ar-back-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* AR Tab Toggle */
.svto-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.svto-mode-toggle button {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.svto-mode-toggle button.active {
    background: #6c63ff;
    color: #fff;
}

.svto-mode-toggle button:hover:not(.active) {
    background: #f8f7ff;
    color: #6c63ff;
}

/* ----------------------------------------
   Mobile Responsive
   ---------------------------------------- */
@media (max-width: 600px) {
    #svto-ar-container {
        border-radius: 0;
        margin: -20px -20px 16px;
        width: calc(100% + 40px);
    }

    #svto-ar-video {
        border-radius: 0;
    }

    .svto-ar-capture-btn {
        width: 72px;
        height: 72px;
    }

    .svto-ar-capture-btn::after {
        width: 52px;
        height: 52px;
    }

    #svto-ar-size-slider,
    #svto-ar-rotate-slider {
        width: 60px;
    }

    #svto-3d-viewer {
        min-height: 300px;
    }

    .svto-3d-ar-btn {
        padding: 10px 22px;
        font-size: 14px;
    }
}
