/* Product Comparison System */
.comparison-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.comparison-container.active {
    display: flex;
}

.comparison-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.comparison-header {
    background: linear-gradient(135deg, #c2185b, #e91e63);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comparison-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.comparison-close:hover {
    background: rgba(255,255,255,0.2);
}

.comparison-content {
    flex: 1;
    overflow: auto;
    padding: 2rem;
}

.comparison-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: top;
}

.comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table .feature-row {
    background: #fafbfc;
    font-weight: 600;
    color: #495057;
}

.comparison-table .product-header {
    background: white;
    text-align: center;
    padding: 1.5rem 1rem;
}

.product-comparison-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.product-comparison-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.product-comparison-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.3;
    margin: 0;
}

.product-comparison-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c2185b;
    margin: 0;
}

.product-comparison-seller {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.remove-product-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.remove-product-btn:hover {
    background: #c82333;
}

.comparison-feature {
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
}

.comparison-value {
    color: #333;
}

.comparison-value.highlight {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.comparison-value.unavailable {
    color: #6c757d;
    font-style: italic;
}

.comparison-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.comparison-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.comparison-action-btn.primary {
    background: #c2185b;
    color: white;
}

.comparison-action-btn.primary:hover {
    background: #ad1457;
}

.comparison-action-btn.secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.comparison-action-btn.secondary:hover {
    background: #e9ecef;
}

/* Compare Button on Product Cards */
.product-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 11;
}

.flag-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.95);
    border: 2px solid #dc3545;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #dc3545;
}

.flag-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.flag-btn i {
    font-size: 0.9rem;
}

.compare-checkbox {
    position: absolute;
    top: 50px;
    right: 10px;
    z-index: 10;
}

.compare-checkbox input[type="checkbox"] {
    display: none;
}

.compare-checkbox label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.95);
    border: 2px solid #c2185b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.compare-checkbox label:hover {
    border-color: #c2185b;
    background: #c2185b;
    color: white;
    transform: scale(1.1);
}

.compare-checkbox input[type="checkbox"]:checked + label {
    background: #c2185b;
    border-color: #c2185b;
    color: white;
    box-shadow: 0 4px 12px rgba(194, 24, 91, 0.3);
}

.compare-checkbox label i {
    font-size: 1rem;
    font-weight: bold;
}

/* Floating Compare Bar */
.floating-compare-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #c2185b, #e91e63);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(194, 24, 91, 0.3);
    display: none;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-compare-bar.visible {
    display: flex;
}

.floating-compare-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(194, 24, 91, 0.4);
}

.compare-count {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Rating Stars in Comparison */
.rating-stars {
    display: flex;
    gap: 2px;
    align-items: center;
}

.rating-stars .star {
    color: #ffc107;
    font-size: 0.9rem;
}

.rating-stars .star.empty {
    color: #e9ecef;
}

.rating-value {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

/* Availability Status */
.availability-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.availability-status.in-stock {
    background: #d4edda;
    color: #155724;
}

.availability-status.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.availability-status.limited {
    background: #fff3cd;
    color: #856404;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .comparison-container {
        padding: 1rem;
    }
    
    .comparison-modal {
        max-height: 95vh;
    }
    
    .comparison-header {
        padding: 1rem;
    }
    
    .comparison-content {
        padding: 1rem;
    }
    
    .comparison-table {
        min-width: 600px;
    }
    
    .product-comparison-card {
        min-width: 150px;
    }
    
    .product-comparison-image {
        width: 80px;
        height: 80px;
    }
    
    .floating-compare-bar {
        bottom: 10px;
        right: 10px;
        padding: 0.75rem 1rem;
        border-radius: 25px;
    }
    
    .floating-compare-bar span {
        display: none;
    }
}

/* Animation for adding/removing products */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.comparison-table td {
    animation: slideIn 0.3s ease;
}

/* Highlight differences */
.comparison-table .highlight-best {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.comparison-table .highlight-worst {
    background: #f8d7da;
    color: #721c24;
}

/* Empty state */
.comparison-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.comparison-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.comparison-empty h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.comparison-empty p {
    margin: 0;
    font-size: 0.95rem;
}