/* Try-On Feature Styles */
#try-on-button {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
}

#try-on-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.5);
}

#floating-try-on-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

#floating-try-on-btn:hover {
    transform: scale(1.1);
}

#floating-try-on-btn i {
    color: white;
    font-size: 24px;
}

#try-on-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Try-On Modal */
.try-on-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.try-on-modal.active {
    display: flex;
}

.try-on-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 25px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

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

.try-on-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.try-on-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.close-try-on {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.try-on-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.try-on-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #f5f5f5;
}

.try-on-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.try-on-item-info {
    flex: 1;
}

.try-on-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #333;
}

.try-on-item-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.remove-try-on {
    color: #ff4757;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.try-on-limit-warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.try-on-actions {
    display: flex;
    gap: 10px;
}

.btn-book-try-on {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-book-try-on:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
}

.btn-continue-shopping {
    flex: 1;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-continue-shopping:hover {
    background: #e9ecef;
}

/* Cart Tabs */
.cart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.cart-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cart-tab-btn.active {
    background: #e3f2fd;
    color: #1976d2;
}

.cart-tab-btn:hover {
    background: #f5f5f5;
}

/* Booking Form in Cart */
.try-on-booking-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #eee;
}

.try-on-booking-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.info-box {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

.info-box h4 {
    margin-top: 0;
    color: #1976d2;
    margin-bottom: 10px;
}

.info-box p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

/* Try-On Tab Layout */
.try-on-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.try-on-items-section {
    flex: 1;
    min-width: 300px;
}

.try-on-booking-section {
    width: 350px;
    flex-shrink: 0;
}

/* Try-On Items Grid */
.try-on-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Try-On Item Card (Matches JS classes) */
.try-on-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    position: relative;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.try-on-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.try-on-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.try-on-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.try-on-card:hover .try-on-card-image img {
    transform: scale(1.05);
}

.try-on-card-details {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.try-on-card-details h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.try-on-card-details .price {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

.btn-remove-try-on {
    margin-top: auto;
    width: 100%;
    padding: 8px;
    background: #fff0f0;
    color: #ff4757;
    border: 1px solid #ffcdd2;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-remove-try-on:hover {
    background: #ffebee;
}

/* Booking Form Card */
.booking-form-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 20px;
    border: 1px solid #eee;
}

.booking-form-card h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.booking-info {
    background: #e3f2fd;
    color: #1565c0;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 12px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

.empty-state .btn-primary {
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s;
}

.empty-state .btn-primary:hover {
    background: #000;
}

/* Responsive */
@media (max-width: 900px) {
    .try-on-container {
        flex-direction: column;
    }
    
    .try-on-booking-section {
        width: 100%;
    }
    
    .booking-form-card {
        position: static;
    }
}

/* ========================================
   Virtual Try-On Overlay on Product Image
   ======================================== */

.virtual-tryon-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    backdrop-filter: blur(10px);
    z-index: 10;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.virtual-tryon-overlay.show {
    opacity: 1;
    transform: translateY(0);
}

.virtual-tryon-overlay.minimized {
    padding: 10px;
    border-radius: 50%;
    bottom: 15px;
    left: 15px;
}

.virtual-tryon-overlay.minimized .tryon-overlay-content span {
    display: none;
}

.virtual-tryon-overlay.minimized .tryon-overlay-content i {
    margin: 0;
    font-size: 20px;
}

.virtual-tryon-overlay:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.virtual-tryon-overlay.minimized:hover {
    padding: 12px 18px;
    border-radius: 12px;
}

.virtual-tryon-overlay.minimized:hover .tryon-overlay-content span {
    display: inline;
}

.tryon-overlay-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 500;
}

.tryon-overlay-content i {
    font-size: 18px;
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.tryon-overlay-content span {
    font-size: 14px;
    white-space: nowrap;
}

/* ========================================
   Virtual Try-On Modal Styles
   ======================================== */

.virtual-tryon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.virtual-tryon-content {
    width: 100%;
    max-width: 800px;
    max-height: 95vh;
    background: #1a1a2e;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.virtual-tryon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.virtual-tryon-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.virtual-tryon-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.virtual-tryon-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.virtual-tryon-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.virtual-tryon-camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.virtual-tryon-camera-container video {
    display: none;
}

.virtual-tryon-camera-container canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect for selfie view */
}

.virtual-tryon-loading,
.virtual-tryon-error {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
}

.virtual-tryon-loading i,
.virtual-tryon-error i {
    font-size: 48px;
}

.virtual-tryon-error i {
    color: #ff6b6b;
}

.virtual-tryon-controls {
    padding: 15px 20px;
    background: #16213e;
}

.virtual-tryon-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
}

.virtual-tryon-product-info img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.virtual-tryon-product-info span {
    color: white;
    font-size: 14px;
    flex: 1;
}

.virtual-tryon-sliders {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slider-group label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    appearance: none;
    outline: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.virtual-tryon-actions {
    display: flex;
    gap: 10px;
}

.virtual-tryon-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-capture {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-flip {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-capture:hover,
.btn-flip:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.virtual-tryon-footer {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: #0f0f23;
}

.virtual-tryon-footer button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-add-cart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-try-home {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    color: white;
}

.btn-add-cart:hover,
.btn-try-home:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Virtual try-on button in product page */
.btn-virtual-tryon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.btn-virtual-tryon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Fallback toast for virtual try-on */
.virtual-tryon-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: #333;
    color: white;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

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

.virtual-tryon-toast.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.virtual-tryon-toast.error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.virtual-tryon-toast.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .virtual-tryon-content {
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .virtual-tryon-camera-container {
        flex: 1;
        aspect-ratio: unset;
    }
    
    .virtual-tryon-sliders {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .virtual-tryon-actions {
        flex-direction: column;
    }
    
    .virtual-tryon-footer {
        flex-direction: column;
    }
}
