.visualfit-button-wrapper {
    margin: 15px 0;
    position: relative;
    z-index: 1;
}

.visualfit-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 14px !important;
    font-weight: 600;
    border-radius: 8px !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    position: relative;
    z-index: 1;
}

.visualfit-preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    color: #fff !important;
}

.visualfit-preview-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.visualfit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.visualfit-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.visualfit-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.visualfit-modal-close:hover {
    background: #e5e7eb;
}

.visualfit-container {
    display: flex;
    height: 80vh;
    max-height: 700px;
}

.visualfit-sidebar {
    width: 340px;
    background: #f9fafb;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
}

.visualfit-sidebar h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #111827;
}

.visualfit-step {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
}

.visualfit-step h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #374151;
}

.visualfit-step h5 {
    margin: 15px 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.visualfit-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.visualfit-upload-zone:hover,
.visualfit-upload-zone.dragover {
    border-color: #6366f1;
    background: #f5f3ff;
}

.visualfit-upload-zone .upload-prompt {
    color: #6b7280;
}

.visualfit-upload-zone .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.visualfit-upload-zone p {
    margin: 0 0 5px 0;
    font-weight: 500;
    font-size: 14px;
}

.visualfit-upload-zone small {
    color: #9ca3af;
    font-size: 12px;
}

.sample-rooms-section {
    margin-top: 15px;
}

.sample-rooms-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sample-rooms-toggle.active {
    background: #e5e7eb;
}

.sample-rooms-dropdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
}

.sample-room {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.sample-room:hover {
    transform: scale(1.02);
}

.sample-room.active {
    border-color: #6366f1;
}

.sample-room img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    display: block;
}

.sample-room span {
    display: block;
    padding: 5px;
    font-size: 11px;
    text-align: center;
    background: #f3f4f6;
    color: #374151;
}

.photos-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.photo-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.photo-thumb {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.photo-thumb.active {
    border-color: #6366f1;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb .remove-photo {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-thumb:hover .remove-photo {
    opacity: 1;
}

.zoom-controls {
    margin-bottom: 15px;
}

.zoom-controls label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.zoom-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zoom-buttons .button {
    min-width: 32px;
    padding: 4px 8px !important;
}

.zoom-buttons #visualfit-zoom-level {
    font-size: 12px;
    color: #6b7280;
    min-width: 40px;
    text-align: center;
}

#visualfit-pan-toggle.active {
    background: #6366f1 !important;
    color: #fff !important;
    border-color: #6366f1 !important;
}

.size-control {
    margin-bottom: 15px;
}

.size-control label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.size-control input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

#visualfit-size-value {
    font-size: 13px;
    color: #6b7280;
}

.compare-products {
    margin-bottom: 15px;
}

.compare-products h5 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    border: 2px solid transparent;
}

.product-item:hover {
    background: #f3f4f6;
}

.product-item.active {
    background: #ede9fe;
    border-color: #6366f1;
}

.product-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.product-item span {
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.view-controls {
    margin-bottom: 15px;
}

.view-controls .button {
    width: 100%;
}

#visualfit-before-after.active {
    background: #6366f1 !important;
    color: #fff !important;
    border-color: #6366f1 !important;
}

.share-section {
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.share-buttons-row {
    display: flex;
    gap: 8px;
}

.share-buttons-row .button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.share-buttons-row .button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.share-buttons-row .button-primary {
    background: #6366f1;
    border-color: #6366f1;
}

.share-buttons-row .button-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

#visualfit-share-toggle.active {
    background: #e5e7eb;
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
}

.share-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.share-icon-btn:hover {
    background: #f3f4f6;
    border-color: #6366f1;
}

.share-icon-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #374151;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.preview-actions .button {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.visualfit-canvas-area {
    flex: 1;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#visualfit-canvas {
    max-width: 100%;
    max-height: 100%;
}

#visualfit-canvas-placeholder {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
}

#visualfit-canvas-placeholder .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
}

#visualfit-canvas-placeholder p {
    margin: 0;
    font-size: 14px;
}

.visualfit-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000000;
}

.visualfit-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .visualfit-container {
        flex-direction: column;
        height: auto;
        max-height: none;
    }
    
    .visualfit-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 350px;
    }
    
    .visualfit-canvas-area {
        min-height: 400px;
    }
    
    .sample-rooms-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .sample-room img {
        height: 50px;
    }
    
    .share-buttons {
        flex-wrap: wrap;
    }
    
    .share-buttons .button-primary {
        flex: 1 1 100%;
    }
}
