/**
 * Compare Page Styles
 * استایل صفحه مقایسه محصولات
 */

.compare-section {
    padding: 40px 0;
    min-height: 60vh;
}

.compare-container {
    margin-top: 30px;
}

.compare-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 20px;
}

.compare-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
}

/* Compare Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.compare-table th,
.compare-table td {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.compare-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    vertical-align: top;
}

.compare-table tbody tr:last-child td {
    border-bottom: none;
}

.feature-column {
    text-align: right !important;
    font-weight: 600;
    color: #333;
    background: #f8f9fa !important;
    min-width: 180px;
    position: sticky;
    right: 0;
    z-index: 10;
}

.product-column {
    min-width: 250px;
    max-width: 300px;
}

/* Product Card in Compare */
.product-card-compare {
    position: relative;
    padding: 20px;
}

.remove-product-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
}

.remove-product-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.product-card-compare .product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-card-compare .product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.4;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-compare .product-price {
    margin-bottom: 15px;
}

.product-card-compare .old-price {
    display: block;
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.product-card-compare .current-price {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #007bff;
}

.product-card-compare .btn {
    width: 100%;
}

/* Feature Values */
.compare-table td {
    font-size: 14px;
    color: #555;
}

.feature-name {
    font-size: 15px;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    font-size: 16px;
    color: #666;
}

/* Print Styles */
@media print {
    .compare-actions,
    .breadcrumb-container,
    .remove-product-btn {
        display: none !important;
    }

    .compare-table {
        box-shadow: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .compare-table {
        font-size: 13px;
    }

    .compare-table th,
    .compare-table td {
        padding: 12px 8px;
    }

    .product-card-compare {
        padding: 15px 10px;
    }

    .product-card-compare .product-image {
        height: 150px;
    }

    .product-card-compare .product-name {
        font-size: 14px;
        min-height: auto;
    }

    .product-card-compare .current-price {
        font-size: 16px;
    }

    .feature-column {
        min-width: 120px;
        font-size: 13px;
    }

    .product-column {
        min-width: 200px;
    }
}
