/* WooCommerce Virtual Fitting Room Styles */

/* ==========================================
   FITTING BUTTON (on products)
   ========================================== */

.wvf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.wvf-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.wvf-btn.wvf-in-fitting {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.wvf-btn.wvf-in-fitting:hover {
    opacity: 0.9;
}

.wvf-btn-icon {
    font-size: 16px;
}

/* Single product button */
.single-product .wvf-btn {
    width: auto;
    padding: 12px 24px;
    font-size: 14px;
}

/* ==========================================
   NOTIFICATION
   ========================================== */

.wvf-notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: #333;
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 999999;
    transition: top 0.3s ease;
    font-size: 14px;
}

.wvf-notification.show {
    top: 20px;
}

.wvf-notification-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.wvf-notification-link:hover {
    text-decoration: underline;
    color: #8b9cf7;
}

/* ==========================================
   FITTING ROOM PAGE
   ========================================== */

.wvf-fitting-room-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.wvf-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.wvf-header h2 {
    margin: 0;
    font-size: 28px;
}

.wvf-count {
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

/* Empty state */
.wvf-empty {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 16px;
}

.wvf-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.wvf-empty h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.wvf-empty p {
    color: #666;
    margin-bottom: 25px;
}

/* Products grid */
.wvf-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.wvf-product-item {
    position: relative;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wvf-product-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.wvf-product-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Checkbox */
.wvf-product-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.wvf-checkbox {
    display: none;
}

.wvf-checkbox + label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.wvf-checkbox + label:hover {
    border-color: #667eea;
}

.wvf-checkbox:checked + label {
    background: #667eea;
    border-color: #667eea;
}

.wvf-checkbox:checked + label::after {
    content: '✓';
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

/* Product image */
.wvf-product-image {
    position: relative;
    padding-top: 120%;
    background: #f5f5f5;
}

.wvf-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product info */
.wvf-product-info {
    padding: 15px;
}

.wvf-product-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.wvf-product-title a {
    color: #333;
    text-decoration: none;
}

.wvf-product-title a:hover {
    color: #667eea;
}

.wvf-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.wvf-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 14px;
}

.wvf-product-price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* Product actions */
.wvf-product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px 15px;
}

.wvf-remove-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wvf-remove-btn:hover {
    background: #fee;
    color: #e74c3c;
}

.wvf-add-to-cart-btn {
    flex: 1;
    padding: 10px 15px !important;
    font-size: 13px !important;
    text-align: center;
}

/* Fitting actions */
.wvf-fitting-actions {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 16px;
}

.wvf-try-on-btn {
    font-size: 18px !important;
    padding: 16px 40px !important;
}

.wvf-hint {
    margin: 15px 0 0;
    color: #888;
    font-size: 14px;
}

/* ==========================================
   BUTTONS
   ========================================== */

.wvf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wvf-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.wvf-button-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.wvf-button-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.wvf-button-secondary {
    background: #f0f0f0;
    color: #333;
}

.wvf-button-secondary:hover {
    background: #e5e5e5;
}

.wvf-button-success {
    background: #28a745;
    color: #fff;
}

.wvf-button-success:hover {
    background: #218838;
    color: #fff;
}

/* ==========================================
   MODAL
   ========================================== */

.wvf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
}

.wvf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wvf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.wvf-modal-content {
    position: relative;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    background: #fff;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    animation: wvfModalIn 0.3s ease;
}

@keyframes wvfModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wvf-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #666;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wvf-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* Modal steps */
.wvf-modal-step {
    display: none;
}

.wvf-modal-step.active {
    display: block;
}

.wvf-modal-step h3 {
    margin: 0 0 25px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    color: #333;
}

/* Selected products in modal */
.wvf-selected-products {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 12px;
}

.wvf-selected-products h4 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.wvf-selected-products-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wvf-selected-product-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.wvf-selected-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Upload area */
.wvf-upload-area {
    margin-bottom: 25px;
}

.wvf-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 3px dashed #ccc;
    border-radius: 16px;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wvf-upload-label:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.wvf-upload-label.dragover {
    border-color: #28a745;
    background: #f0fff4;
}

.wvf-upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.wvf-upload-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.wvf-upload-hint {
    font-size: 13px;
    color: #888;
}

/* Preview */
.wvf-preview-container {
    text-align: center;
}

.wvf-preview-container img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.wvf-change-photo {
    padding: 10px 20px;
    font-size: 14px;
    color: #667eea;
    background: transparent;
    border: 1px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wvf-change-photo:hover {
    background: #667eea;
    color: #fff;
}

/* Generate button */
.wvf-generate-btn {
    width: 100%;
    margin-top: 10px;
}

/* Loader */
.wvf-loader {
    text-align: center;
    padding: 60px 20px;
}

.wvf-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: wvfSpin 1s linear infinite;
}

@keyframes wvfSpin {
    to { transform: rotate(360deg); }
}

.wvf-loader-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}

.wvf-loader-hint {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Result */
.wvf-result-container {
    text-align: center;
    margin-bottom: 25px;
}

.wvf-result-container img {
    max-width: 100%;
    max-height: 55vh;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.wvf-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Error */
.wvf-error {
    text-align: center;
    padding: 50px 20px;
}

.wvf-error-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

.wvf-error-text {
    font-size: 16px;
    color: #e74c3c;
    margin-bottom: 25px;
}

/* ==========================================
   MY ACCOUNT BADGE
   ========================================== */

.woocommerce-MyAccount-navigation .wvf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    background: #667eea;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .wvf-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .wvf-product-info {
        padding: 12px;
    }
    
    .wvf-product-title {
        font-size: 14px;
    }
    
    .wvf-product-price {
        font-size: 16px;
    }
    
    .wvf-modal-content {
        padding: 25px;
        border-radius: 16px;
    }
    
    .wvf-result-actions {
        flex-direction: column;
    }
    
    .wvf-result-actions .wvf-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wvf-products-grid {
        grid-template-columns: 1fr;
    }
    
    .wvf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wvf-fitting-actions {
        padding: 20px;
    }
    
    .wvf-try-on-btn {
        width: 100%;
        font-size: 16px !important;
        padding: 14px 20px !important;
    }
}
