/**
 * Prosty konfigurator 3D - Style
 */

/* Integracja z WooCommerce gallery */
.woocommerce-product-gallery .tdcfg-configurator {
    margin: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
    width: 100%;
}

.tdcfg-configurator {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.tdcfg-configurator h3 {
    margin: 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    font-size: 18px;
    font-weight: 600;
}

.tdcfg-viewer {
    width: 100%;
    height: 500px;
    background: #f8f9fa;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

/* W galerii produktu - większy rozmiar */
.woocommerce-product-gallery .tdcfg-viewer {
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Pełnoekranowy modal - pełna wysokość */
#tdcfg-fullscreen-modal .tdcfg-viewer,
#tdcfg-fullscreen-modal canvas,
#tdcfg-fullscreen-modal #3d-container,
#tdcfg-fullscreen-modal .tdcfg-canvas-area,
#tdcfg-fullscreen-modal #tdcfg-modal-canvas-container {
    height: 100vh !important;
}

.tdcfg-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.tdcfg-controls-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
}

.tdcfg-configure-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
    transition: all 0.3s ease;
}

.tdcfg-configure-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.4);
}





.tdcfg-viewer canvas {
    max-width: 100%;
    max-height: 100%;
}

.tdcfg-loading {
    color: #666;
    font-size: 16px;
}

.tdcfg-controls {
    padding: 20px;
    background: #fff;
}

/* Kontrolki w galerii produktu */
.woocommerce-product-gallery .tdcfg-controls {
    margin-top: 20px;
    padding: 25px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tdcfg-controls h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.tdcfg-element {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

.tdcfg-element label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}

.tdcfg-element input[type="checkbox"] {
    margin-right: 10px;
}

.tdcfg-colors {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.tdcfg-color {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.tdcfg-color input[type="radio"] {
    margin-right: 10px;
}

.tdcfg-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ddd;
    margin-right: 10px;
    display: inline-block;
}

.tdcfg-color input[type="radio"]:checked + .tdcfg-color-swatch {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}



/* Responsywność */
@media (max-width: 768px) {
    .tdcfg-viewer {
        height: 300px;
    }
    
    .tdcfg-controls {
        padding: 15px;
    }
    
    .tdcfg-element {
        padding: 12px;
    }
    

}
#model-3d-instructions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
#model-3d-instructions.active {
    display: flex;
}
#model-3d-instructions.hidden {
    display: none;
}
#model-3d-instructions .instruction-modal {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: sans-serif;
}
#model-3d-instructions .instruction-modal h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
}
#model-3d-instructions .mouse-grid {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 15px;
}
#model-3d-instructions .mouse-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#model-3d-instructions .mouse-item p {
    font-size: 14px;
    margin-top: 10px;
    color: #555;
    line-height: 1.4;
}
#model-3d-instructions .mouse-svg {
    width: 60px;
    height: auto;
    fill: none;
    stroke: #333;
    stroke-width: 2;
}
#model-3d-instructions .mouse-body {
    fill: #fff;
}
#model-3d-instructions .btn {
    fill: #fff;
    transition: fill 0.2s;
}
#model-3d-instructions .scroll-wheel {
    fill: #333;
}
#model-3d-instructions .left-active .left-btn {
    animation: tdcfg-click-pulse 1.5s infinite;
}
#model-3d-instructions .right-active .right-btn {
    animation: tdcfg-click-pulse 1.5s infinite;
    animation-delay: 0.5s;
}
#model-3d-instructions .scroll-active .scroll-wheel {
    animation: tdcfg-scroll-move 1.5s infinite;
}
@keyframes tdcfg-click-pulse {
    0%, 100% { fill: #fff; }
    50% { fill: #ff6b6b; }
}
@keyframes tdcfg-scroll-move {
    0% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
    100% { transform: translateY(0); }
}
#model-3d-instructions #close-instructions {
    background: #222;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}
#model-3d-instructions #close-instructions:hover {
    background: #444;
}
@media (max-width: 768px) {
    #model-3d-instructions .mouse-grid {
        display: none;
    }
    #model-3d-instructions .instruction-modal h3::after {
        content: " (Użyj jednego palca do obracania, dwóch do przybliżania)";
        font-size: 14px;
        display: block;
        margin-top: 10px;
        font-weight: normal;
    }
}
