/* Smart Product Comparison Overlay Styles */
.comparison-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comparison-overlay.show {
    display: flex;
    opacity: 1;
    animation: fadeInOverlay 0.3s ease-out;
}

.comparison-container {
    background: white;
    border-radius: 20px;
    max-width: 95vw;
    max-height: 90vh;
    margin: auto;
    overflow: hidden;
    transform: scale(0.9) translateY(50px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.comparison-overlay.show .comparison-container {
    transform: scale(1) translateY(0);
}

.comparison-header {
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.comparison-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.comparison-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.comparison-content {
    padding: 0;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 250px repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
    min-height: 600px;
}

.comparison-features {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 0;
}

.feature-category {
    border-bottom: 1px solid #e9ecef;
}

.feature-category-header {
    background: #e9ecef;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dee2e6;
}

.feature-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.9rem;
    color: #6c757d;
    transition: background-color 0.2s ease;
}

.feature-item:hover {
    background: rgba(25, 135, 84, 0.05);
}

.product-column {
    border-right: 1px solid #e9ecef;
    position: relative;
    background: white;
    transition: all 0.3s ease;
}

.product-column:last-child {
    border-right: none;
}

.product-column:hover {
    box-shadow: inset 0 0 0 2px rgba(25, 135, 84, 0.1);
    background: rgba(25, 135, 84, 0.02);
}

.product-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(to bottom, #fff, #f8f9fa);
}

.product-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-image:hover {
    transform: scale(1.05);
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #198754;
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 15px;
}

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

.rating-count {
    color: #6c757d;
    font-size: 0.8rem;
}

.remove-product-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.remove-product-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.product-features {
    padding: 0;
}

.feature-value {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f3f4;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
}

.feature-value:hover {
    background: rgba(25, 135, 84, 0.05);
}

.feature-value.highlight {
    background: rgba(25, 135, 84, 0.1);
    font-weight: 600;
    color: #198754;
}

.feature-value.highlight::before {
    content: '★';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffc107;
}

.comparison-actions {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.add-to-comparison-btn {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
    border: 2px dashed #198754;
    padding: 60px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    min-height: 200px;
}

.add-to-comparison-btn:hover {
    background: rgba(25, 135, 84, 0.15);
    border-color: #20c997;
    transform: scale(1.02);
}

.comparison-stats {
    display: flex;
    gap: 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.comparison-actions-right {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary-action:hover {
    background: #157347;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-secondary-action {
    background: #6c757d;
    color: white;
}

.btn-secondary-action:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Floating Compare Button */
.floating-compare-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #198754, #20c997);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.3);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.floating-compare-btn.show {
    display: flex;
    animation: bounceIn 0.6s ease-out;
}

.floating-compare-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(25, 135, 84, 0.4);
}

.floating-compare-btn .compare-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Product Card Compare Button */
.product-card {
    position: relative;
}

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

.compare-checkbox-wrapper {
    background: white;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.compare-checkbox-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.compare-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #198754;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.compare-checkbox:checked {
    background: #198754;
    border-color: #198754;
}

.compare-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Animations */
@keyframes fadeInOverlay {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

.product-column {
    animation: slideInFromBottom 0.4s ease-out forwards;
}

.product-column:nth-child(2) { animation-delay: 0.1s; }
.product-column:nth-child(3) { animation-delay: 0.2s; }
.product-column:nth-child(4) { animation-delay: 0.3s; }

/* Responsive Design */
@media (max-width: 768px) {
    .comparison-container {
        max-width: 98vw;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .comparison-features {
        order: -1;
        border-right: none;
        border-bottom: 2px solid #e9ecef;
    }
    
    .feature-category-header {
        padding: 12px 15px;
        font-size: 0.8rem;
    }
    
    .feature-item {
        padding: 12px 15px;
        font-size: 0.8rem;
    }
    
    .floating-compare-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .product-header {
        padding: 20px 15px;
    }
    
    .product-image {
        width: 80px;
        height: 80px;
    }
}

/* Loading Animation */
.comparison-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #198754;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Highlight Effect */
.feature-highlight {
    background: linear-gradient(90deg, rgba(25, 135, 84, 0.1), rgba(32, 201, 151, 0.1));
    animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { background-opacity: 0.1; }
    50% { background-opacity: 0.2; }
}